3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = 'foo'; var_dump(memory_get_usage()); foreach (range(1,100) as $i) { $$i = $foo; } foreach (range(1,100) as $y) { $$y &= $foo; } var_dump(memory_get_usage());
based on fVDt8
Output for 7.1.0
int(347288) int(359352)
Output for 7.0.3 - 7.0.14
int(347296) int(359360)
Output for 7.0.0 - 7.0.2
int(346784) int(358848)
Output for hhvm-3.12.0
int(2097152) int(2097152)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.7 - 5.6.28
int(218632) int(237072)
Output for 5.5.24 - 5.5.35
int(218632) int(237048)
Output for 5.4.10 - 5.4.45
int(219056) int(237472)
Output for 5.4.0 - 5.4.9
int(218528) int(236944)
Output for 5.3.11 - 5.3.29
int(622152) int(640584)
Output for 5.3.0 - 5.3.10
int(621848) int(640280)
Output for 5.2.10 - 5.2.17
int(79784) int(97400)
Output for 5.2.7 - 5.2.9
int(80480) int(112608)
Output for 5.2.3 - 5.2.6
int(80800) int(112928)
Output for 5.2.2
int(78696) int(110880)
Output for 5.2.1
int(78696) int(109840)
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/Cj4q8 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/Cj4q8 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/Cj4q8 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/Cj4q8 on line 3