3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(); for ($i = 0; $i < 10000; $i += 1) { $a[] = json_decode('{"a": "b"}'); } var_dump((memory_get_peak_usage(true) / 1024 / 1024) . "MB");
Output for 5.2.6 - 5.2.17, 7.0.0 - 7.1.0
string(3) "6MB"
Output for 5.4.0 - 5.6.28
string(6) "6.75MB"
Output for 5.3.0 - 5.3.29
string(3) "7MB"
Output for 5.2.1 - 5.2.5
string(6) "5.75MB"
Output for 5.2.0
Fatal error: Call to undefined function memory_get_peak_usage() in /in/EmiCs on line 7
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/EmiCs on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/EmiCs on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/EmiCs on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/EmiCs on line 5