3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $row = 0; $dest = []; $a = 1; while ($row < 2000000) { $dest[] = [ $a, 1, ]; if ($row % 100000 === 0) { echo (memory_get_usage(true) / 1000000) . PHP_EOL; } $row++; }
Output for 7.0.30 - 7.3.0alpha1
2.097152 44.044288 Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in /in/qQonc on line 8
Process exited with code 255.
Output for hhvm-3.22.0
0.323344 8.824712 21.512144
Process exited with code 139.
Output for hhvm-3.21.3
0.325056 8.822328 17.319552
Process exited with code 139.
Output for hhvm-3.18.5
0.325512 7.222784 14.120008 23.114312 27.91444
Process exited with code 139.
Output for 5.6.30
0.262144 54.525952 Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/qQonc on line 9
Process exited with code 255.