3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [0, 1, 2, 3]; foreach ($a as &$x) { foreach ($a as &$y) { echo "$x - $y\n"; if ($x == 0 && $y == 1) { unset($a[1]); unset($a[2]); } } }
based on r6gXt
Output for 7.0.0 - 7.2.0
0 - 0 0 - 1 0 - 3 3 - 0 3 - 3
Output for 5.5.0 - 5.6.30, hhvm-3.10.1 - 3.17.3
0 - 0 0 - 1 0 - 3