3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { static $bar = "1234567890123456789012345678901234567890"; return $bar; } var_dump(memory_get_usage()); $f = foo(); var_dump(memory_get_usage());
Output for 7.2.0
int(383448) int(383504)
Output for 7.1.0, 7.1.7
int(346776) int(346832)
Output for 7.1.5 - 7.1.6
int(346928) int(346984)
Output for 7.0.0 - 7.0.20
int(346808) int(346864)
Output for 5.6.7 - 5.6.28
int(218448) int(218696)
Output for 5.5.24 - 5.5.35
int(218448) int(218704)
Output for 5.4.0 - 5.4.45
int(218968) int(219200)
Output for 5.3.11 - 5.3.29
int(620800) int(621040)
Output for 5.3.0 - 5.3.10
int(620496) int(620736)
Output for 5.2.10 - 5.2.17
int(78552) int(78952)
Output for 5.2.7 - 5.2.9
int(79272) int(79624)
Output for 5.2.3 - 5.2.6
int(79592) int(79944)
Output for 5.2.2
int(77488) int(77760)
Output for 5.2.1
int(77392) int(77760)
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/sIoe5 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/sIoe5 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/sIoe5 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/sIoe5 on line 8

preferences:
120.6 ms | 401 KiB | 175 Q