This seems fairly pointless, but it's possible using string access and modification by character.
foreach ($strings as &$string) {
for ($i=0; $i < 3; $i++) {
$string[$i] = '*';
$string[-($i+1)] = '*';
}
}
Note that this won't work properly if the string contains multibyte characters, because it's accessing the string as a byte array.
Also note that this requires PHP 7.1 in order to use the negative indexes. If you don't have PHP 7.1 I don't know of a way to replace the last three characters without using any functions.