3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php ini_set('display_errors', true); error_reporting(E_ALL); $array = [1,2,3]; foreach($array as &$val) { echo "{$val} - ", current($array), PHP_EOL; }
based on ecAFC
Output for 7.0.0 - 7.3.1
1 - 1 2 - 1 3 - 1
Output for 5.4.10 - 5.6.38
1 - 2 2 - 3 3 -
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/6Y1sj on line 4
Process exited with code 255.