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