3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { static $bar = "1234567890123456789012345678901234567890"; return $bar; } var_dump(memory_get_usage()); foo(); var_dump(memory_get_usage());
Output for 7.2.0
int(383376) int(383432)
Output for 7.1.0, 7.1.7
int(346672) int(346728)
Output for 7.1.5 - 7.1.6
int(346824) int(346880)
Output for 7.0.0 - 7.0.20
int(346704) int(346760)
Output for 5.6.0 - 5.6.28
int(218360) int(218408)
Output for 5.5.0 - 5.5.38
int(218360) int(218392)
Output for 5.4.0 - 5.4.45
int(218880) int(218912)
Output for 5.3.11 - 5.3.29
int(620248) int(620280)
Output for 5.3.0 - 5.3.10
int(619944) int(619976)
Output for 5.2.10 - 5.2.17
int(78000) int(78200)
Output for 5.2.7 - 5.2.9
int(78648) int(79000)
Output for 5.2.3 - 5.2.6
int(78968) int(79320)
Output for 5.2.2
int(76864) int(77136)
Output for 5.2.1
int(76768) int(77136)
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/ZvkZU on line 8
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/ZvkZU on line 8
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/ZvkZU on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/ZvkZU on line 8

preferences:
169.32 ms | 401 KiB | 216 Q