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[] = md5('hallo'); $array[] = md5('bla'); } $x = new x($array); echo number_format(memory_get_usage(), 0, ',', '.'); echo "\n"; echo number_format(memory_get_usage(true), 0, ',', '.'); echo "\n"; unset($value); unset($x); echo number_format(memory_get_usage(), 0, ',', '.'); echo "\n"; echo number_format(memory_get_usage(true), 0, ',', '.');
based on 6tF3R
Output for 7.1.0
10.949.040 12.587.008 10.949.016 12.587.008
Output for 7.0.0 - 7.0.14
10.949.088 12.587.008 10.949.064 12.587.008
Output for 5.6.7 - 5.6.28
20.472.864 20.971.520 20.472.696 20.971.520
Output for 5.5.24 - 5.5.35
20.472.864 20.971.520 20.472.680 20.971.520
Output for 5.4.10 - 5.4.45
20.473.400 20.971.520 20.473.216 20.971.520
Output for 5.4.0 - 5.4.9
20.473.344 20.971.520 20.473.160 20.971.520
Output for 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/BZY1G on line 11
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/BZY1G 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/BZY1G 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/BZY1G 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/BZY1G on line 4
Process exited with code 255.