3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array(1024 * 1024); // array(); for ($i = 0; $i < 1024 * 1024; ++$i) $array[$i] = 0; echo memory_get_peak_usage();
based on 2huCn
Output for 7.2.0
33942072
Output for 7.1.0, 7.1.7 - 7.1.10
33905432
Output for 7.1.5 - 7.1.6
33905480
Output for 7.0.0 - 7.0.20
33905448
Output for 5.3.20 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/v6Wvn on line 5
Process exited with code 255.