3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = ["Hi!",[1,2]]; foreach($arr as [$a,$b]) { var_dump($a,$b); // NULL NULL 1 2 }
Output for 8.5.0 - 8.5.12
Warning: Cannot use string as array in /in/M754F on line 5 Warning: Cannot use string as array in /in/M754F on line 5 NULL NULL int(1) int(2)
Output for 7.3.17 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.36, 8.3.0 - 8.3.37, 8.4.1 - 8.4.27
NULL NULL int(1) int(2)
Output for 7.0.8
Parse error: syntax error, unexpected ')', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /in/M754F on line 5
Process exited with code 255.
Output for 5.5.35 - 5.5.38, 5.6.0 - 5.6.2
Parse error: syntax error, unexpected '[' in /in/M754F on line 5
Process exited with code 255.

preferences:
36.96 ms | 1173 KiB | 6 Q