3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function __construct() { $this->bar = new Bar($this); } } class Bar { function __construct($foo = null) { $this->foo = $foo; } } for($i=0;$i<50000;$i++) { $foo = new Foo(); unset($foo); if($i % 10000 == 0) { echo number_format(memory_get_usage()) . "\n"; } }
Output for 7.1.0
349,248 472,992 472,992 472,992 472,992
Output for 7.0.0 - 7.0.14
349,272 473,016 473,016 473,016 473,016
Output for hhvm-3.12.0
2,097,152 6,291,456 10,485,760 14,680,064 18,874,368
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.8 - 5.6.28
223,248 1,207,024 1,207,024 1,207,024 1,207,024
Output for 5.5.24 - 5.5.35
223,232 1,206,992 1,206,992 1,206,992 1,206,992
Output for 5.4.0 - 5.4.45
223,736 1,207,496 1,207,496 1,207,496 1,207,496
Output for 5.3.11 - 5.3.29
627,440 1,611,216 1,611,216 1,611,216 1,611,216
Output for 5.3.0 - 5.3.10
627,136 1,610,912 1,610,912 1,610,912 1,610,912
Output for 5.2.10 - 5.2.17
85,352 8,489,320 16,942,472 23,822,736 33,848,728
Output for 5.2.7 - 5.2.9
86,408 8,490,984 16,944,584 23,825,320 33,851,824
Output for 5.2.6
86,728 8,491,488 16,945,104 23,825,856 33,852,360
Output for 5.2.3 - 5.2.5
86,728 8,491,440 16,944,864 23,825,616 33,851,808
Output for 5.2.2
84,624 8,489,392 16,942,728 23,823,504 33,849,696
Output for 5.2.1
84,624 8,489,080 16,942,488 23,823,240 33,849,368
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/cZT5S on line 20
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/cZT5S on line 20
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/cZT5S on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/cZT5S on line 20