3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array( 'a' => array('value' => 2), 'b' => array('value' => 4), 'c' => array('value' => 6) ); print_r($arr); foreach ($arr as &$a) { $a['value'] /= 2; } foreach ($arr as $a) { print_r($a); } unset($a) foreach ($arr as $a) { print_r($a); }
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected 'foreach' (T_FOREACH), expecting ';' in /in/bkT0o on line 23
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_FOREACH, expecting ';' in /in/bkT0o on line 23
Process exited with code 255.