3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class x { public $value; public function __constuct($value) { $this->value = $value; } } $array = []; for($i = 0; $i < 50000; $i++) { $array[] = new x(md5('hallo')); $array[] = new x(md5('bla')); } echo number_format(memory_get_usage(), 0, ',', '.'); echo "\n"; echo number_format(memory_get_usage(true), 0, ',', '.'); echo "\n"; unset($array); echo number_format(memory_get_usage(), 0, ',', '.'); echo "\n"; echo number_format(memory_get_usage(true), 0, ',', '.');
based on gHNGp
Output for 7.1.0
11.189.352 12.587.008 1.390.904 8.388.608
Output for 7.0.0 - 7.0.14
11.189.400 12.587.008 1.390.952 8.388.608
Output for 5.6.7 - 5.6.28
31.197.360 31.981.568 8.547.016 9.699.328
Output for 5.5.24 - 5.5.35
31.197.312 31.981.568 8.546.992 9.699.328
Output for 5.4.0 - 5.4.45
31.197.864 31.981.568 8.547.504 9.699.328
Output for 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/6tF3R on line 11
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/6tF3R on line 11
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/6tF3R 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/6tF3R 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/6tF3R on line 4
Process exited with code 255.