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[] = 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, ',', '.');
Output for 7.4.0 - 7.4.1
11.229.584 12.587.008 1.431.136 8.388.608
Output for 7.3.0 - 7.3.13
11.229.528 12.587.008 1.431.080 8.388.608
Output for 7.2.0 - 7.2.26
11.225.824 12.587.008 1.427.376 8.388.608
Output for 7.1.0 - 7.1.33
11.189.280 12.587.008 1.390.832 8.388.608
Output for 7.0.0 - 7.0.33
11.189.328 12.587.008 1.390.880 8.388.608
Output for 5.6.0 - 5.6.40
31.197.144 31.981.568 8.546.832 9.699.328
Output for 5.5.0 - 5.5.38
31.197.144 31.981.568 8.546.808 9.699.328
Output for 5.4.0 - 5.4.45
31.197.648 31.981.568 8.547.320 9.699.328
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/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.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/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.

preferences:
249.47 ms | 401 KiB | 325 Q