3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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.1.0
Initial: 347672 bytes Final: 4546184 bytes Peak: 10946216 bytes
Output for 7.0.0 - 7.0.14
Initial: 347704 bytes Final: 4546216 bytes Peak: 10946248 bytes
Output for hhvm-3.10.0 - 3.12.0
Initial: 2097152 bytes Final: 8388608 bytes Peak: 8388608 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.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.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