3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(); for ($i = 0; $i < 10000; $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(3) "8MB"
Output for 5.2.1 - 5.2.5, 5.6.28
string(3) "9MB"
Output for 5.4.0 - 5.6.21
string(6) "8.25MB"
Output for 5.3.0 - 5.3.29
string(7) "10.75MB"
Output for 5.2.6 - 5.2.17
string(6) "9.25MB"
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_peak_usage() in /in/pXWE0 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/pXWE0 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/pXWE0 on line 5