3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'x' => 'Laura Smith', 'y' => 'John. Smith', 'z' => 'John Doe' ]; foreach ($array as $key => $value) { $array[$key] = strstr($value, ' ', true); } var_export($array);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
198.03 ms | 2156 KiB | 12 Q