3v4l.org

run code in 200+ 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() / 1024 / 1024) . "MB");
Output for 7.2.0 - 7.2.6
string(17) "5.5645980834961MB"
Output for 7.1.0, 7.1.7 - 7.1.20
string(16) "5.529655456543MB"
Output for 7.1.5 - 7.1.6
string(17) "5.5297775268555MB"
Output for 7.0.0 - 7.0.20
string(16) "5.529670715332MB"
Output for 5.4.0 - 5.4.9, 5.5.24 - 5.6.28
string(17) "6.3315353393555MB"
Output for 5.4.10 - 5.4.45
string(17) "6.3320388793945MB"
Output for 5.3.11 - 5.3.29
string(17) "6.6482162475586MB"
Output for 5.3.0 - 5.3.10
string(17) "6.6478805541992MB"
Output for 5.2.10 - 5.2.17
string(17) "5.7117233276367MB"
Output for 5.2.7 - 5.2.9
string(17) "5.7117614746094MB"
Output for 5.2.6
string(17) "5.7121276855469MB"
Output for 5.2.3 - 5.2.5
string(16) "5.712043762207MB"
Output for 5.2.2
string(17) "5.7101821899414MB"
Output for 5.2.1
string(17) "5.7097396850586MB"
Output for 5.2.0
Fatal error: Call to undefined function memory_get_peak_usage() in /in/BFtmE 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/BFtmE 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/BFtmE 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/BFtmE 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/BFtmE on line 5