3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(); for ($i = 0; $i < 100000; $i += 1) { $a[] = new ArrayObject(array("a" => "b")); } var_dump((memory_get_peak_usage(true) / 1024 / 1024) . "MB");
Output for 7.0.0 - 7.1.0
string(13) "60.00390625MB"
Output for hhvm-3.12.0
string(17) "9.1570663452148MB"
Output for hhvm-3.10.0
string(17) "9.1554412841797MB"
Output for 5.2.2, 5.2.7 - 5.2.17, 5.4.10 - 5.4.45, 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/H1kmh on line 5
Process exited with code 255.
Output for 5.4.0 - 5.4.9, 5.5.24 - 5.6.21
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 136 bytes) in /in/H1kmh on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 8388608 bytes) in /in/H1kmh on line 5
Process exited with code 255.
Output for 5.2.1, 5.2.3 - 5.2.6
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24 bytes) in /in/H1kmh on line 5
Process exited with code 255.
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_peak_usage() in /in/H1kmh on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/H1kmh on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/H1kmh on line 5