3v4l.org

run code in 300+ PHP versions simultaneously
<?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";}
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.3.0 - 7.3.12, 7.4.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 7.2.0 - 7.2.25
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 14.688.256 10.485.760 14.688.256 10.485.760 14.688.256 10.485.760 14.688.256 10.485.760
Output for 5.6.0 - 5.6.40
26.738.688 6.553.600 26.738.688 7.077.888 26.738.688 7.077.888 26.738.688 7.340.032 26.738.688 7.340.032 26.738.688 7.602.176 26.738.688 8.388.608 27.000.832 8.912.896 27.000.832 8.912.896 27.000.832 8.912.896
Output for 5.5.0 - 5.5.38
26.738.688 6.553.600 26.738.688 7.077.888 26.738.688 7.077.888 26.738.688 7.340.032 26.738.688 7.602.176 26.738.688 7.602.176 26.738.688 7.864.320 27.000.832 8.126.464 27.000.832 8.388.608 27.000.832 8.650.752
Output for 5.4.10 - 5.4.45
26.738.688 6.553.600 26.738.688 7.077.888 26.738.688 7.340.032 26.738.688 7.602.176 26.738.688 7.864.320 26.738.688 8.126.464 26.738.688 8.388.608 26.738.688 8.912.896 27.000.832 8.912.896 27.000.832 8.912.896
Output for 5.4.0 - 5.4.9
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 6.815.744 26.738.688 6.815.744 26.738.688 6.815.744 27.000.832 7.077.888 27.000.832 7.077.888 27.000.832 7.340.032
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.0.5, 5.1.0 - 5.1.6, 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.3.11, 4.4.0 - 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.

preferences:
193.88 ms | 401 KiB | 322 Q