3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(1,2,3); foreach($a as $i => $v) { echo "$v\n"; $a[$i] = $v * 2; } var_dump($a); var_dump(dir_list());
based on ru9Zv
Output for 7.0.0 - 7.2.0
1 2 3 array(3) { [0]=> int(2) [1]=> int(4) [2]=> int(6) } Fatal error: Uncaught Error: Call to undefined function dir_list() in /in/YZ2hZ:11 Stack trace: #0 {main} thrown in /in/YZ2hZ on line 11
Process exited with code 255.
Output for 5.3.19 - 5.6.28
1 2 3 array(3) { [0]=> int(2) [1]=> int(4) [2]=> int(6) } Fatal error: Call to undefined function dir_list() in /in/YZ2hZ on line 11
Process exited with code 255.