3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = array("1", "2", "3", "4"); foreach($test as $value) { echo $value.PHP_EOL; $value = 1; } foreach($test as &$value) { echo $value.PHP_EOL; $value = 1; } foreach($test as $value) { echo $value.PHP_EOL; }
based on N3P8s
Output for 5.0.2 - 7.2.0
1 2 3 4 1 2 3 4 1 1 1 1
Output for 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 6 1PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 6 2PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 6 3PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 6 4PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 11 1PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 11 2PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 11 3PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 11 4PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 16 1PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 16 1PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 16 1PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Uh92Z on line 16 1PHP_EOL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/Uh92Z on line 10
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/Uh92Z on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/Uh92Z on line 10
Process exited with code 255.