3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo() { static $bar = "1234567890123456789012345678901234567890"; return $bar; } var_dump(memory_get_usage()); foo(); var_dump(memory_get_usage());
Output for 7.1.0
int(346672) int(346728)
Output for 7.0.0 - 7.0.14
int(346704) int(346760)
Output for hhvm-3.10.0 - 3.12.0
int(2097152) int(2097152)
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.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.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