3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [1,2,3,4,5,6,7,8,9]; foreach ($a as $key => &$value) { if ($key === 400000) { unset($a[$key]); // var_dump(key($a)); // break; } var_dump(current($a)); } // var_dump(key($a));
based on iXvYQ
Output for 7.0.0 - 7.2.0
int(1) int(1) int(1) int(1) int(1) int(1) int(1) int(1) int(1)
Output for 5.4.2 - 5.6.28
int(2) int(3) int(4) int(5) int(6) int(7) int(8) int(9) bool(false)
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/FYfaf on line 3
Process exited with code 255.