3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __construct() { $this->bar = new Bar($this); } } 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.2.0
1,216,928 1,217,792 1,218,624 1,219,456 1,220,288 1,221,120 1,221,952 1,222,784 1,223,616 1,224,448
Output for 7.1.0, 7.1.7
1,180,288 1,181,152 1,181,984 1,182,816 1,183,648 1,184,480 1,185,312 1,186,144 1,186,976 1,187,808
Output for 7.1.5 - 7.1.6
1,180,488 1,181,352 1,182,184 1,183,016 1,183,848 1,184,680 1,185,512 1,186,344 1,187,176 1,188,008
Output for 7.0.0 - 7.0.20
1,180,312 1,181,176 1,182,008 1,182,840 1,183,672 1,184,504 1,185,336 1,186,168 1,187,000 1,187,832
Output for 5.6.0 - 5.6.28
984,864 985,616 986,320 987,024 987,728 988,432 989,136 989,840 990,544 991,248
Output for 5.5.0 - 5.5.38
984,864 985,600 986,304 987,008 987,712 988,416 989,120 989,824 990,528 991,232
Output for 5.4.0 - 5.4.45
985,368 986,104 986,808 987,512 988,216 988,920 989,624 990,328 991,032 991,736
Output for 5.3.11 - 5.3.29
1,388,920 1,389,656 1,390,360 1,391,064 1,391,768 1,392,472 1,393,176 1,393,880 1,394,584 1,395,288
Output for 5.3.0 - 5.3.10
1,388,600 1,389,336 1,390,040 1,390,744 1,391,448 1,392,152 1,392,856 1,393,560 1,394,264 1,394,968
Output for 5.2.10 - 5.2.17
814,640 815,360 816,048 816,736 817,424 818,112 818,800 819,488 820,176 820,864
Output for 5.2.7 - 5.2.9
815,752 816,472 817,160 817,848 818,536 819,224 819,912 820,600 821,288 821,976
Output for 5.2.3 - 5.2.6
816,072 816,792 817,480 818,168 818,856 819,544 820,232 820,920 821,608 822,296
Output for 5.2.2
813,976 814,696 815,384 816,072 816,760 817,448 818,136 818,824 819,512 820,200
Output for 5.2.1
813,928 814,648 815,336 816,024 816,712 817,400 818,088 818,776 819,464 820,152
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/BQ2cp on line 21
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/BQ2cp on line 21
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/BQ2cp on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/BQ2cp on line 21

preferences:
181.52 ms | 401 KiB | 216 Q