3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo memory_get_peak_usage(), PHP_EOL; $a = range(1, 10000); $a[9998] = 0; echo memory_get_peak_usage(), PHP_EOL; // 380824 // 874320 // 381368 // 1464752
based on AsDgc
Output for 7.2.0
418040 911568
Output for 7.0.0 - 7.1.0, 7.1.7 - 7.1.10
381368 874928
Output for 7.1.5 - 7.1.6
381368 875088
Output for 5.6.8 - 5.6.28
220728 1709944
Output for 5.5.24 - 5.5.35
220728 1709896
Output for 5.4.11 - 5.4.45
220664 1710392
Output for 5.3.21 - 5.3.29
627040 2112816