3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a=range(1, 500); foreach($a as $k=>$v) { } var_dump(memory_get_peak_usage()); foreach($a as $k=>$v) { $a[$k]++; } var_dump(memory_get_peak_usage());
Output for 7.1.0
int(381856) int(388320)
Output for 7.0.0 - 7.0.14
int(381832) int(388328)
Output for 5.6.7 - 5.6.28
int(292360) int(364760)
Output for 5.4.0 - 5.4.9, 5.5.24 - 5.5.35
int(292360) int(364656)
Output for 5.4.10 - 5.4.45
int(292904) int(365200)
Output for 5.3.11 - 5.3.29
int(696056) int(768392)
Output for 5.3.0 - 5.3.10
int(695752) int(768088)
Output for 5.2.10 - 5.2.17
int(149584) int(217880)
Output for 5.2.7 - 5.2.9
int(149664) int(217960)
Output for 5.2.3 - 5.2.6
int(149984) int(218280)
Output for 5.2.2
int(147904) int(216200)
Output for 5.2.1
int(147392) int(215688)
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_peak_usage() in /in/A2ssv on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_peak_usage() in /in/A2ssv on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_peak_usage() in /in/A2ssv on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_peak_usage() in /in/A2ssv on line 7