3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 'foo'; var_dump(memory_get_usage()); foreach (range(1,100) as $i) { $$i = $foo; } var_dump(memory_get_usage());
Output for 7.2.0
int(383616) int(392192)
Output for 7.0.3 - 7.0.20, 7.1.0, 7.1.7
int(346944) int(355808)
Output for 7.1.5 - 7.1.6
int(347184) int(356048)
Output for 7.0.0 - 7.0.2
int(346432) int(355296)
Output for 5.6.8 - 5.6.28
int(217888) int(228184)
Output for 5.5.24 - 5.5.35
int(217888) int(228168)
Output for 5.4.10 - 5.4.45
int(218360) int(228640)
Output for 5.4.0 - 5.4.9
int(217832) int(228112)
Output for 5.3.11 - 5.3.29
int(620752) int(631040)
Output for 5.3.0 - 5.3.10
int(620448) int(630736)
Output for 5.2.10 - 5.2.17
int(78384) int(88664)
Output for 5.2.7 - 5.2.9
int(79080) int(103936)
Output for 5.2.3 - 5.2.6
int(79400) int(104256)
Output for 5.2.2
int(77296) int(102136)
Output for 5.2.1
int(77296) int(101000)
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/fVDt8 on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/fVDt8 on line 3
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/fVDt8 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/fVDt8 on line 3

preferences:
152.21 ms | 401 KiB | 174 Q