3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php gc_enable(); class x { private $value; public function __construct($value) { $this->value = $value; }}for($j = 0; $j < 100; $j++) { $array = array(); $objects = array(); for($i = 0; $i < 5000; $i++) { $value = md5('Hallo'); $objects[] = new x($value); $array[] = $value; } echo number_format(memory_get_usage(true), 0,',','.') . "\n"; unset($array); unset($objects); unset($value); echo number_format(memory_get_usage(true), 0,',','.') . "\n";}
based on U8NSV
Output for 7.0.0 - 7.1.0
2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152 2.097.152
Output for 5.6.7 - 5.6.28
3.145.728 2.621.440 3.145.728 2.883.584 3.407.872 2.883.584 3.407.872 2.883.584 3.407.872 2.883.584 3.407.872 2.883.584 3.407.872 2.883.584 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728
Output for 5.5.24 - 5.5.35
3.145.728 2.621.440 3.145.728 2.883.584 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.145.728
Output for 5.4.10 - 5.4.45
3.145.728 2.621.440 3.145.728 2.883.584 3.407.872 2.883.584 3.407.872 2.883.584 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872
Output for 5.4.0 - 5.4.9
3.145.728 2.621.440 3.145.728 2.883.584 3.407.872 2.883.584 3.407.872 2.883.584 3.407.872 2.883.584 3.407.872 2.883.584 3.407.872 3.145.728 3.407.872 3.145.728 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872 3.407.872
Output for 5.3.11 - 5.3.29
4.718.592 3.670.016 4.718.592 3.932.160 4.718.592 3.932.160 4.980.736 4.194.304 4.980.736 4.194.304 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592 4.980.736 4.718.592
Output for 5.3.0 - 5.3.10
4.718.592 3.670.016 4.718.592 3.670.016 4.718.592 3.932.160 4.980.736 3.932.160 4.980.736 3.932.160 4.980.736 3.932.160 4.980.736 3.932.160 4.980.736 3.932.160 4.980.736 4.194.304 4.980.736 4.456.448 4.980.736 4.718.592 4.980.736 4.980.736 4.980.736 4.718.592 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736 4.980.736
Output for 5.0.0 - 5.2.17
Fatal error: Call to undefined function gc_enable() in /in/0uouo on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/0uouo on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/0uouo on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/0uouo on line 4
Process exited with code 255.