3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(10, 20); $n = 0; foreach($a as &$v) { echo $v; $a[] = 42; var_dump($a); if $n++ > 3 {break;} }
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '$n' (T_VARIABLE), expecting '(' in /in/iB0Bf on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /in/iB0Bf on line 8
Process exited with code 255.