3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Tester { public function doNothing() { $res = array(); for ( $i = 0; $i < 10000; $i++) { $res[$i] = new StdClass; } } } $t = new Tester(); echo "Before: ".memory_get_usage()."\n"; $t->doNothing(); echo "After: ".memory_get_usage()."\n"; gc_collect_cycles(); echo "After: ".memory_get_usage()."\n";
Output for 7.1.0
Before: 348368 After: 471280 After: 471280
Output for 7.0.0 - 7.0.14
Before: 348384 After: 471296 After: 471296
Output for hhvm-3.10.0 - 3.12.0
Before: 2097152 After: 2097152 After: 2097152
Output for 5.6.0 - 5.6.28
Before: 221456 After: 1204576 After: 1204576
Output for 5.5.0 - 5.5.38
Before: 221448 After: 1204552 After: 1204552
Output for 5.4.0 - 5.4.45
Before: 221960 After: 1205064 After: 1205064
Output for 5.3.11 - 5.3.29
Before: 625200 After: 1608440 After: 1608440
Output for 5.3.0 - 5.3.10
Before: 624896 After: 1608136 After: 1608136
Output for 5.2.10 - 5.2.17
Before: 83056 After: 820704 Fatal error: Call to undefined function gc_collect_cycles() in /in/jAUDb on line 15
Process exited with code 255.
Output for 5.2.7 - 5.2.9
Before: 83824 After: 951840 Fatal error: Call to undefined function gc_collect_cycles() in /in/jAUDb on line 15
Process exited with code 255.
Output for 5.2.3 - 5.2.6
Before: 84144 After: 952160 Fatal error: Call to undefined function gc_collect_cycles() in /in/jAUDb on line 15
Process exited with code 255.
Output for 5.2.2
Before: 82072 After: 950040 Fatal error: Call to undefined function gc_collect_cycles() in /in/jAUDb on line 15
Process exited with code 255.
Output for 5.2.1
Before: 82072 After: 851744 Fatal error: Call to undefined function gc_collect_cycles() in /in/jAUDb on line 15
Process exited with code 255.
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/jAUDb on line 12
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/jAUDb on line 3
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/jAUDb on line 3
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/jAUDb on line 3
Process exited with code 255.