3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1, 2, 3); $values = &a; foreach ($values as $value) { $values[3] = "bob"; if ($value == "bob") { $values[3] = "We made it into the if"; } } var_dump($values);
Output for 7.0.0
Parse error: syntax error, unexpected ';', expecting '[' in /in/Fkk0s on line 4
Process exited with code 255.
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Parse error: syntax error, unexpected ';', expecting '(' in /in/Fkk0s on line 4
Process exited with code 255.

preferences:
161.11 ms | 1395 KiB | 24 Q