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(); $foo->__destruct(); unset($foo); if ($i > 990) { echo number_format(memory_get_usage()) . "\n"; } }
Output for 7.1.0
348,608 348,640 348,640 348,640 348,640 348,640 348,640 348,640 348,640 348,640
Output for 7.0.0 - 7.0.14
348,632 348,664 348,664 348,664 348,664 348,664 348,664 348,664 348,664 348,664
Output for 5.6.7 - 5.6.28
223,232 223,280 223,280 223,280 223,280 223,280 223,280 223,280 223,280 223,280
Output for 5.5.24 - 5.5.35
223,216 223,248 223,248 223,248 223,248 223,248 223,248 223,248 223,248 223,248
Output for 5.4.0 - 5.4.45
223,712 223,744 223,744 223,744 223,744 223,744 223,744 223,744 223,744 223,744
Output for 5.3.11 - 5.3.29
627,352 627,384 627,384 627,384 627,384 627,384 627,384 627,384 627,384 627,384
Output for 5.3.0 - 5.3.10
627,048 627,080 627,080 627,080 627,080 627,080 627,080 627,080 627,080 627,080
Output for 5.2.10 - 5.2.17
85,400 85,432 85,432 85,432 85,432 85,432 85,432 85,432 85,432 85,432
Output for 5.2.7 - 5.2.9
87,144 87,176 87,176 87,176 87,176 87,176 87,176 87,176 87,176 87,176
Output for 5.2.3 - 5.2.6
87,464 87,496 87,496 87,496 87,496 87,496 87,496 87,496 87,496 87,496
Output for 5.2.1 - 5.2.2
85,360 85,392 85,392 85,392 85,392 85,392 85,392 85,392 85,392 85,392
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/MGMjN on line 25
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/MGMjN on line 25
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/MGMjN on line 25
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/MGMjN on line 25