3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function __construct() { $this->bar = new Bar($this); } function __destruct() { unset($this->bar); } } class Bar { function __construct($foo = null) { $this->foo = $foo; } } $i = 1; while ($i++ < 1000) { $foo = new Foo(); unset($foo); if ($i > 990) { echo number_format(memory_get_usage()) . "\n"; } }
Output for 7.1.0
1,180,432 1,181,296 1,182,128 1,182,960 1,183,792 1,184,624 1,185,456 1,186,288 1,187,120 1,187,952
Output for 7.0.0 - 7.0.14
1,180,456 1,181,320 1,182,152 1,182,984 1,183,816 1,184,648 1,185,480 1,186,312 1,187,144 1,187,976
Output for 5.6.0 - 5.6.28
985,520 986,272 986,976 987,680 988,384 989,088 989,792 990,496 991,200 991,904
Output for 5.5.0 - 5.5.35
985,488 986,224 986,928 987,632 988,336 989,040 989,744 990,448 991,152 991,856
Output for 5.4.0 - 5.4.45
986,056 986,792 987,496 988,200 988,904 989,608 990,312 991,016 991,720 992,424
Output for 5.3.11 - 5.3.29
1,389,592 1,390,328 1,391,032 1,391,736 1,392,440 1,393,144 1,393,848 1,394,552 1,395,256 1,395,960
Output for 5.3.0 - 5.3.10
1,389,288 1,390,024 1,390,728 1,391,432 1,392,136 1,392,840 1,393,544 1,394,248 1,394,952 1,395,656
Output for 5.2.10 - 5.2.17
815,408 816,128 816,816 817,504 818,192 818,880 819,568 820,256 820,944 821,632
Output for 5.2.7 - 5.2.9
816,632 817,352 818,040 818,728 819,416 820,104 820,792 821,480 822,168 822,856
Output for 5.2.3 - 5.2.6
816,920 817,640 818,328 819,016 819,704 820,392 821,080 821,768 822,456 823,144
Output for 5.2.2
814,792 815,512 816,200 816,888 817,576 818,264 818,952 819,640 820,328 821,016
Output for 5.2.1
814,856 815,576 816,264 816,952 817,640 818,328 819,016 819,704 820,392 821,080
Output for 5.0.0 - 5.2.0
<br /> <b>Fatal error</b>: Call to undefined function memory_get_usage() in <b>/in/JDE31</b> on line <b>24</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/JDE31</b> on line <b>24</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/JDE31</b> on line <b>24</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/JDE31</b> on line <b>24</b><br />