3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo memory_get_peak_usage() . "\n"; $var = ['hallo']; var_dump($var); echo memory_get_peak_usage() . "\n"; $var['test'] = 'hallo2'; var_dump($var); echo memory_get_peak_usage() . "\n";
based on HoNcr
Output for 7.2.0 - 7.2.6
418672 array(1) { [0]=> string(5) "hallo" } 418672 array(2) { [0]=> string(5) "hallo" ["test"]=> string(6) "hallo2" } 418672
Output for 7.0.0 - 7.1.20
381968 array(1) { [0]=> string(5) "hallo" } 381968 array(2) { [0]=> string(5) "hallo" ["test"]=> string(6) "hallo2" } 381968
Output for hhvm-3.15.4
2097152 array(1) { [0]=> string(5) "hallo" } 2097152 array(2) { [0]=> string(5) "hallo" ["test"]=> string(6) "hallo2" } 2097152
Output for 5.6.0 - 5.6.30
220688 array(1) { [0]=> string(5) "hallo" } 220688 array(2) { [0]=> string(5) "hallo" ["test"]=> string(6) "hallo2" } 220688