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.3.0 - 7.3.1
Initial: 388152 bytes Final: 4586664 bytes Peak: 10986696 bytes
Output for 7.2.0 - 7.2.13
Initial: 384272 bytes Final: 4582784 bytes Peak: 10982816 bytes
Output for 7.1.25
Initial: 347600 bytes Final: 4546112 bytes Peak: 10946144 bytes
Output for 7.1.0, 7.1.7
Initial: 347672 bytes Final: 4546184 bytes Peak: 10946216 bytes
Output for 7.1.5 - 7.1.6
Initial: 347928 bytes Final: 4546440 bytes Peak: 10946472 bytes
Output for 7.0.0 - 7.0.20
Initial: 347704 bytes Final: 4546216 bytes Peak: 10946248 bytes
Output for 5.6.8 - 5.6.28
Initial: 218048 bytes Final: 1267056 bytes Peak: 20468848 bytes
Output for 5.5.24 - 5.5.35
Initial: 218048 bytes Final: 1267032 bytes Peak: 20468832 bytes
Output for 5.4.10 - 5.4.45
Initial: 218568 bytes Final: 1267552 bytes Peak: 20469240 bytes
Output for 5.4.0 - 5.4.9
Initial: 218040 bytes Final: 1267024 bytes Peak: 20468792 bytes
Output for 5.3.11 - 5.3.29
Initial: 622288 bytes Final: 1671288 bytes Peak: 20873104 bytes
Output for 5.3.0 - 5.3.10
Initial: 621984 bytes Final: 1670984 bytes Peak: 20872824 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/ssINq 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/ssINq 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/ssINq 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/ssINq on line 2

preferences:
176.69 ms | 401 KiB | 190 Q