3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [1, 2, 3, 4, 5]; foreach ($array as &$v1) { foreach ($array as &$v2) { if ($v1 == 1 && $v2 == 1) { unset($array[1]); } echo "($v1, $v2) "; } }
based on 37VeL
Output for 7.0.0 - 7.2.0
(1, 1) (1, 3) (1, 4) (1, 5) (3, 1) (3, 3) (3, 4) (3, 5) (4, 1) (4, 3) (4, 4) (4, 5) (5, 1) (5, 3) (5, 4) (5, 5)
Output for 5.4.11 - 5.6.28
(1, 1) (1, 3) (1, 4) (1, 5)
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Jv5T5 on line 3
Process exited with code 255.