3v4l.org

run code in 300+ PHP versions simultaneously
<?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, ',', '.');
Output for 7.4.0 - 7.4.1
10.989.248 12.587.008 10.989.224 12.587.008
Output for 7.3.0 - 7.3.13
10.989.216 12.587.008 10.989.192 12.587.008
Output for 7.2.0 - 7.2.26
10.985.512 12.587.008 10.985.488 12.587.008
Output for 7.1.0 - 7.1.33
10.948.968 12.587.008 10.948.944 12.587.008
Output for 7.0.0 - 7.0.33
10.949.016 12.587.008 10.948.992 12.587.008
Output for 5.6.0 - 5.6.40
20.472.672 20.971.520 20.472.504 20.971.520
Output for 5.5.0 - 5.5.38
20.472.672 20.971.520 20.472.488 20.971.520
Output for 5.4.10 - 5.4.45
20.473.208 20.971.520 20.473.024 20.971.520
Output for 5.4.0 - 5.4.9
20.473.152 20.971.520 20.472.968 20.971.520
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.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.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/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.

preferences:
231.1 ms | 401 KiB | 325 Q