3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hello = "hello"; foreach($hello[] as $test) { echo $test; }
Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.28, 5.4.0 - 5.4.31
Fatal error: Cannot use [] for reading in /in/HOO1P on line 3
Process exited with code 255.
Output for 5.2.1 - 5.2.2
Fatal error: Invalid opcode 81/16/8. in /in/HOO1P on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Fatal error: [] operator not supported for strings in /in/HOO1P on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: [] operator not supported for strings in /in/HOO1P on line 3

preferences:
215.62 ms | 1386 KiB | 121 Q