3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $list = array('A', 'B', 'C', 'D'); foreach ($list as $key => &$val) { var_dump($val); unset($list[1], $list[2], $list[3]); } echo var_dump($list); var_dump("1e1" == "10");
Output for 5.2.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(1) "A" array(1) { [0]=> &string(1) "A" } bool(true)
Output for 5.0.0 - 5.2.1
string(1) "A" string(1) "B" string(1) "C" string(1) "D" array(1) { [0]=> string(1) "A" } bool(true)
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/tV9pW on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /in/tV9pW on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/tV9pW on line 4
Process exited with code 255.