3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class x { private $value; public function __construct($value) { $this->value = $value; }}for($j = 0; $j < 10; $j++) { $array = array(); $objects = array(); for($i = 0; $i < 50000; $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
12.591.104 8.388.608 12.591.104 8.388.608 12.591.104 8.388.608 12.591.104 8.388.608 12.591.104 8.388.608 12.591.104 8.388.608 12.591.104 8.388.608 12.591.104 8.388.608 12.591.104 8.388.608 12.591.104 8.388.608
Output for hhvm-3.12.0
7.605.384 309.224 7.605.384 309.224 7.605.384 309.224 7.605.384 309.224 7.605.384 309.224 7.605.384 309.224 7.605.384 309.224 7.605.384 309.224 7.605.384 309.224 7.605.384 309.224
Output for hhvm-3.10.0
7.603.712 307.552 7.603.776 307.616 7.603.776 307.616 7.603.776 307.616 7.603.776 307.616 7.603.776 307.616 7.603.776 307.616 7.603.776 307.616 7.603.776 307.616 7.603.776 307.616
Output for 5.6.7 - 5.6.28
26.738.688 6.291.456 26.738.688 7.077.888 26.738.688 7.340.032 26.738.688 7.340.032 26.738.688 7.340.032 26.738.688 7.864.320 26.738.688 8.126.464 26.738.688 8.126.464 26.738.688 8.388.608 27.000.832 8.388.608
Output for 5.5.24 - 5.5.35
26.738.688 6.291.456 26.738.688 7.077.888 26.738.688 7.340.032 26.738.688 8.126.464 26.738.688 8.650.752 26.738.688 8.650.752 26.738.688 8.650.752 27.000.832 8.650.752 27.000.832 8.650.752 27.000.832 8.912.896
Output for 5.4.10 - 5.4.45
26.738.688 6.291.456 26.738.688 6.553.600 26.738.688 6.815.744 26.738.688 6.815.744 26.738.688 6.815.744 26.738.688 7.077.888 26.738.688 7.340.032 27.000.832 7.602.176 27.000.832 7.864.320 27.000.832 8.388.608
Output for 5.4.0 - 5.4.9
26.738.688 6.291.456 26.738.688 7.077.888 26.738.688 7.340.032 26.738.688 7.864.320 26.738.688 7.864.320 26.738.688 8.126.464 26.738.688 8.388.608 27.000.832 8.388.608 27.000.832 8.388.608 27.000.832 8.388.608
Output for 5.3.11 - 5.3.29
38.273.024 7.602.176 38.273.024 8.388.608 38.273.024 8.912.896 38.535.168 9.961.472 38.535.168 10.747.904 38.535.168 11.272.192 38.535.168 11.272.192 38.535.168 11.534.336 38.535.168 11.534.336 38.535.168 11.796.480
Output for 5.3.0 - 5.3.10
38.273.024 7.340.032 38.273.024 7.864.320 38.535.168 8.126.464 38.535.168 8.388.608 38.535.168 8.912.896 38.535.168 9.175.040 38.535.168 9.961.472 38.535.168 10.223.616 38.535.168 10.747.904 38.535.168 11.010.048
Output for 5.2.10 - 5.2.17
35.913.728 5.767.168 35.913.728 6.029.312 35.913.728 7.077.888 35.913.728 7.602.176 35.913.728 8.388.608 35.913.728 9.175.040 35.913.728 9.437.184 36.175.872 9.437.184 36.175.872 9.961.472 36.175.872 10.747.904
Output for 5.2.7 - 5.2.9
35.913.728 7.077.888 35.913.728 7.864.320 35.913.728 9.175.040 35.913.728 9.437.184 35.913.728 9.437.184 35.913.728 10.223.616 35.913.728 10.485.760 36.175.872 10.747.904 36.175.872 11.796.480 36.175.872 12.058.624
Output for 5.2.6
35.913.728 6.291.456 35.913.728 7.340.032 35.913.728 7.864.320 35.913.728 8.650.752 35.913.728 8.912.896 35.913.728 8.912.896 35.913.728 9.175.040 36.175.872 9.961.472 36.175.872 10.485.760 36.175.872 11.010.048
Output for 5.2.3 - 5.2.5
35.127.296 7.864.320 35.127.296 8.388.608 35.127.296 9.699.328 35.127.296 10.223.616 35.127.296 10.747.904 35.127.296 11.534.336 35.127.296 12.058.624 35.389.440 12.845.056 35.389.440 13.893.632 35.389.440 15.466.496
Output for 5.2.2
35.127.296 8.388.608 35.127.296 10.747.904 35.127.296 11.010.048 35.127.296 12.058.624 35.127.296 12.320.768 35.127.296 13.107.200 35.127.296 13.893.632 35.389.440 14.417.920 35.389.440 14.417.920 35.389.440 14.417.920
Output for 5.2.1
35.127.296 8.126.464 35.127.296 9.437.184 35.127.296 10.485.760 35.127.296 9.961.472 35.127.296 10.747.904 35.127.296 11.010.048 35.127.296 11.272.192 35.127.296 12.845.056 35.127.296 14.680.064 35.127.296 15.204.352
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/rBmFv 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/rBmFv on line 2
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/rBmFv on line 2
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/rBmFv on line 2
Process exited with code 255.