3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //$arr = array(1 => 'b', 0 => 'a'); $arr = array(1 => 'b'); $arr[0] = 'a'; foreach ($arr as $k => $v) { echo $k . ' ' . $v . PHP_EOL; }
based on QWf79
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
1 b 0 a
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/D3cBS on line 8 1 bPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/D3cBS on line 8 0 aPHP_EOL