3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=range(1, 500); foreach($a as $k=>$v) { } var_dump(memory_get_usage()); foreach($a as $k=>$v) { $a[$k]++; } var_dump(memory_get_usage());
Output for 7.2.0
int(404360) int(404392)
Output for 7.1.0, 7.1.7
int(367752) int(367784)
Output for 7.1.5 - 7.1.6
int(367960) int(367992)
Output for 7.0.0 - 7.0.20
int(367760) int(367792)
Output for 5.6.7 - 5.6.28
int(290728) int(290792)
Output for 5.5.24 - 5.5.35
int(290728) int(290776)
Output for 5.4.10 - 5.4.45
int(291272) int(291296)
Output for 5.4.0 - 5.4.9
int(290728) int(290768)
Output for 5.3.11 - 5.3.29
int(694296) int(694336)
Output for 5.3.0 - 5.3.10
int(693992) int(694032)
Output for 5.2.10 - 5.2.17
int(147912) int(147952)
Output for 5.2.7 - 5.2.9
int(149664) int(213848)
Output for 5.2.3 - 5.2.6
int(149984) int(214168)
Output for 5.2.2
int(147904) int(212088)
Output for 5.2.1
int(147392) int(179000)
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/C8KPH on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/C8KPH on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/C8KPH on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/C8KPH on line 7

preferences:
114.39 ms | 401 KiB | 175 Q