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"; } $i++; }
Output for 7.3.0
1,221,584 1,222,448 1,223,280 1,224,112 1,224,944 1,225,776 1,226,608 1,227,440 1,228,272
Output for 7.2.0 - 7.2.13
1,217,720 1,218,584 1,219,416 1,220,248 1,221,080 1,221,912 1,222,744 1,223,576 1,224,408
Output for 7.1.0 - 7.1.25
1,181,048 1,181,912 1,182,744 1,183,576 1,184,408 1,185,240 1,186,072 1,186,904 1,187,736
Output for 7.0.0 - 7.0.33
1,181,072 1,181,936 1,182,768 1,183,600 1,184,432 1,185,264 1,186,096 1,186,928 1,187,760
Output for 5.6.0 - 5.6.38
985,464 986,216 986,920 987,624 988,328 989,032 989,736 990,440 991,144
Output for 5.5.0 - 5.5.38
985,456 986,192 986,896 987,600 988,304 989,008 989,712 990,416 991,120
Output for 5.4.0 - 5.4.45
985,944 986,680 987,384 988,088 988,792 989,496 990,200 990,904 991,608
Output for 5.3.11 - 5.3.29
1,389,200 1,389,936 1,390,640 1,391,344 1,392,048 1,392,752 1,393,456 1,394,160 1,394,864
Output for 5.3.0 - 5.3.10
1,388,872 1,389,608 1,390,312 1,391,016 1,391,720 1,392,424 1,393,128 1,393,832 1,394,536
Output for 5.2.10 - 5.2.17
814,912 815,632 816,320 817,008 817,696 818,384 819,072 819,760 820,448
Output for 5.2.7 - 5.2.9
816,024 816,744 817,432 818,120 818,808 819,496 820,184 820,872 821,560
Output for 5.2.3 - 5.2.6
816,328 817,048 817,736 818,424 819,112 819,800 820,488 821,176 821,864
Output for 5.2.1 - 5.2.2
814,584 815,304 815,992 816,680 817,368 818,056 818,744 819,432 820,120
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/gYOsH 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/gYOsH 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/gYOsH 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/gYOsH on line 21

preferences:
216.56 ms | 401 KiB | 287 Q