3v4l.org

run code in 300+ PHP versions simultaneously
<?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.4.0 - 7.4.1
389,040 389,072 389,072 389,072 389,072 389,072 389,072 389,072 389,072 389,072
Output for 7.3.0 - 7.3.13
389,168 389,200 389,200 389,200 389,200 389,200 389,200 389,200 389,200 389,200
Output for 7.2.0 - 7.2.26
385,208 385,240 385,240 385,240 385,240 385,240 385,240 385,240 385,240 385,240
Output for 7.1.0 - 7.1.33
348,536 348,568 348,568 348,568 348,568 348,568 348,568 348,568 348,568 348,568
Output for 7.0.0 - 7.0.33
348,560 348,592 348,592 348,592 348,592 348,592 348,592 348,592 348,592 348,592
Output for 5.6.0 - 5.6.40
223,048 223,096 223,096 223,096 223,096 223,096 223,096 223,096 223,096 223,096
Output for 5.5.0 - 5.5.38
223,032 223,064 223,064 223,064 223,064 223,064 223,064 223,064 223,064 223,064
Output for 5.4.0 - 5.4.45
223,528 223,560 223,560 223,560 223,560 223,560 223,560 223,560 223,560 223,560
Output for 5.3.11 - 5.3.29
626,808 626,840 626,840 626,840 626,840 626,840 626,840 626,840 626,840 626,840
Output for 5.3.0 - 5.3.10
626,504 626,536 626,536 626,536 626,536 626,536 626,536 626,536 626,536 626,536
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.0.5, 5.1.0 - 5.1.6, 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.3.11, 4.4.0 - 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

preferences:
204.85 ms | 401 KiB | 325 Q