3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(memory_get_peak_usage(true)); $a = range(1, 100000); var_dump(memory_get_peak_usage(true)); $a[-1] = 1; var_dump(memory_get_peak_usage(true));
based on BlUJo
Output for 7.3.0alpha1
int(2097152) int(6295552) int(11538432)
Output for 7.0.0 - 7.2.6
int(2097152) int(6295552) int(11014144)
Output for 5.4.12 - 5.6.28
int(262144) int(15204352) int(15204352)
Output for 5.3.22 - 5.3.29
int(786432) int(15728640) int(15728640)