3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Initial: ".memory_get_usage()." bytes \n"; /* prints Initial: 361400 bytes */ // let's use up some memory for ($i = 0; $i < 100000; $i++) { $array []= md5($i); } // let's remove half of the array for ($i = 0; $i < 100000; $i++) { unset($array[$i]); } echo "Final: ".memory_get_usage()." bytes \n"; /* prints Final: 885912 bytes */ echo "Peak: ".memory_get_peak_usage()." bytes \n"; /* prints Peak: 13687072 bytes */ ?>
Output for 7.4.0 - 7.4.1
Initial: 388232 bytes Final: 4586744 bytes Peak: 10986776 bytes
Output for 7.3.0 - 7.3.13
Initial: 388152 bytes Final: 4586664 bytes Peak: 10986696 bytes
Output for 7.2.0 - 7.2.26
Initial: 384272 bytes Final: 4582784 bytes Peak: 10982816 bytes
Output for 7.1.0 - 7.1.33
Initial: 347600 bytes Final: 4546112 bytes Peak: 10946144 bytes
Output for 7.0.0 - 7.0.33
Initial: 347632 bytes Final: 4546144 bytes Peak: 10946176 bytes
Output for 5.6.0 - 5.6.40
Initial: 217864 bytes Final: 1266872 bytes Peak: 20468664 bytes
Output for 5.5.0 - 5.5.38
Initial: 217864 bytes Final: 1266848 bytes Peak: 20468600 bytes
Output for 5.4.10 - 5.4.45
Initial: 218384 bytes Final: 1267368 bytes Peak: 20469136 bytes
Output for 5.4.0 - 5.4.9
Initial: 217856 bytes Final: 1266840 bytes Peak: 20468608 bytes
Output for 5.3.11 - 5.3.29
Initial: 621744 bytes Final: 1670744 bytes Peak: 20872560 bytes
Output for 5.3.0 - 5.3.10
Initial: 621440 bytes Final: 1670440 bytes Peak: 20872208 bytes
Output for 5.2.10 - 5.2.17
Initial: 79928 bytes Final: 1128912 bytes Peak: 19531176 bytes
Output for 5.2.7 - 5.2.9
Initial: 80456 bytes Final: 1260088 bytes Peak: 19531272 bytes
Output for 5.2.6
Initial: 80776 bytes Final: 1260344 bytes Peak: 19531640 bytes
Output for 5.2.3 - 5.2.5
Initial: 80776 bytes Final: 1260416 bytes Peak: 19531688 bytes
Output for 5.2.2
Initial: 78704 bytes Final: 1258264 bytes Peak: 19529536 bytes
Output for 5.2.1
Initial: 78704 bytes Final: 1159976 bytes Peak: 19529016 bytes
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/bXNik on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/bXNik on line 2
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: memory_get_usage() in /in/bXNik on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/bXNik on line 2

preferences:
212.69 ms | 401 KiB | 325 Q