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 gc_collect_cycles(); echo "\n"; echo number_format(memory_get_usage(), 0, ',', '.'); echo "\n"; echo number_format(memory_get_usage(true), 0, ',', '.');
based on BZY1G
Output for 7.1.0
10.949.040 12.587.008 0 10.949.016 12.587.008
Output for 7.0.0 - 7.0.14
10.949.088 12.587.008 0 10.949.064 12.587.008
Output for hhvm-3.13.2
8.388.608 8.807.032 0 8.388.608 8.806.992
Output for hhvm-3.12.0
8.388.608 8.806.872 0 8.388.608 8.806.832
Output for hhvm-3.10.0
8.388.608 8.805.264 0 8.388.608 8.805.224
Output for 5.6.0 - 5.6.28
20.473.112 20.971.520 0 20.472.944 20.971.520
Output for 5.5.0 - 5.5.38
20.473.112 20.971.520 0 20.472.928 20.971.520
Output for 5.4.10 - 5.4.45
20.473.632 20.971.520 0 20.473.448 20.971.520
Output for 5.4.0 - 5.4.9
20.473.608 20.971.520 0 20.473.424 20.971.520
Output for 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/RWZQR on line 11
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/RWZQR 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/RWZQR 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/RWZQR 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/RWZQR on line 4
Process exited with code 255.