3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo memory_get_peak_usage(), PHP_EOL; $a = range(1, 10000); $a[9999] = 0; echo memory_get_peak_usage(), PHP_EOL; // 380824 // 874320 // 381368 // 1464752
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
422360 653320
Output for 8.1.0 - 8.1.28
422664 915776
Output for 8.0.0 - 8.0.30
422504 915280
Output for 7.4.0 - 7.4.33
422680 915584
Output for 7.3.16 - 7.3.33
422432 915504
Output for 7.2.29 - 7.2.33
418000 911528
Output for 7.2.0 - 7.2.6
418040 911568
Output for 7.0.0 - 7.0.20, 7.1.0, 7.1.7 - 7.1.20
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

preferences:
195.9 ms | 401 KiB | 183 Q