3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = []; for ($i = 0; $i < 10000; $i++) { $a = [$i, $a]; } print_r($a, true);
Output for 7.1.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 48238592 bytes) in /in/OHWJS on line 7
Process exited with code 255.
Output for 5.4.0 - 5.4.6, 5.4.10, 5.4.13 - 5.4.14, 5.4.17, 5.4.27 - 5.6.28, 7.0.0 - 7.0.14
Array ( [0] => 9999 [1] => Array ( [0] => 9998 [1] => Array ( [0] => 9997 [1] => Array ( [0] => 9996 [1] => Array ( [0] => 9995 [1] => Array ( [0] => 9994 [1] => Array ( [0] => 9993 [1] => Array ( [0] => 9992 [1] => Array ( [0] => 9991 [1] => Array ( [0] => 9990 [1] => Array ( [0] => 9989 [1] => Array ( [0] => 9988 [1] => Array ( [0] => 9987 [1] => Array ( [0] => 9986 [1] => Array ( [0] => 9985 [1] => Array ( [0] => 9984 [1] => Array ( [0] => 9983 [1] => Array ( [0] => 9982 [1] => Array ( [0] => 9981 [1] => Array ( [0] => 9980 [1] => Array ( [0] => 9979 [1] => Array ( [0] => 9978 [1] => Array ( [0] => 9977 [1] => Array ( [0] => 9976 [1] => Array ( [0] => 9975 [1] => Array ( [0] => 9974 [1] => Array ( [0] => 9973 [1] => Array ( [0] => 9972 [1] => Array ( [0] => 9971 [1] => Array ( [0] => 9970 [1] => Array ( [0] => 9969 [1] => Array ( [0] => 9968 [1] => Array ( [0] => 9967 [1] => Array ( [0] => 9966 [1] => Array ( [0] => 9965 [1] => Array ( [0] => 9964 [1] => Array ( [0] => 9963 [1] => Array ( [0] => 9962 [1] => Array ( [0] => 9961 [1] => Array ( [0] => 9960 [1] => Array ( [0] => 9959 [1] => Array ( [0] => 9958 [1] => Array ( [0] => 9957 [1] => Array ( [0] => 9956 [1] => Array ( [0] => 9955 [1] => Array ( [0] => 9954 [1] => Array ( [0] => 9953 [1] => Array ( [0] => 9952 [1] => Array ( [0] => 9951 [1] => Array ( [0] => 9950 [1] => Array ( [0] => 9949 [1] => Array
Process exited with code 137.
Output for 5.4.7 - 5.4.9, 5.4.11 - 5.4.12, 5.4.15 - 5.4.16, 5.4.18 - 5.4.26, hhvm-3.10.0 - 3.12.0

Process exited with code 137.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/OHWJS on line 3
Process exited with code 255.