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 === 4) { unset($a[$key]); var_dump(key($a)); break; } } var_dump(key($a));
based on iWON4
Output for 7.0.0 - 7.2.0
int(0) int(0)
Output for 5.4.1 - 5.6.28
int(5) int(5)
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/9N1Nf on line 3
Process exited with code 255.