3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
string(17) "5.3181991577148MB"
Output for 8.1.0 - 8.1.28
string(17) "5.5684967041016MB"
Output for 8.0.0 - 8.0.30
string(17) "5.5680541992188MB"
Output for 7.4.0 - 7.4.33
string(17) "5.5683441162109MB"
Output for 7.3.0 - 7.3.33
string(17) "5.5682678222656MB"
Output for 7.2.17 - 7.2.33
string(17) "5.5645599365234MB"
Output for 7.2.0 - 7.2.6
string(17) "5.5645980834961MB"
Output for 7.1.26 - 7.1.33
string(17) "5.5295867919922MB"
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.5.35, 5.6.8 - 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.0.5, 5.1.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.3.11, 4.4.0 - 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

preferences:
242.92 ms | 401 KiB | 343 Q