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_colect_cycles(); echo "After: ".memory_get_usage()."\n";
Output for 7.1.0
Before: 348416 After: 471328 Fatal error: Uncaught Error: Call to undefined function gc_colect_cycles() in /in/JXRHf:15 Stack trace: #0 {main} thrown in /in/JXRHf on line 15
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Before: 348432 After: 471344 Fatal error: Uncaught Error: Call to undefined function gc_colect_cycles() in /in/JXRHf:15 Stack trace: #0 {main} thrown in /in/JXRHf on line 15
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Before: 2097152 After: 2097152 Fatal error: Call to undefined function gc_colect_cycles() in /in/JXRHf on line 15
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Before: 221544 After: 1204664 Fatal error: Call to undefined function gc_colect_cycles() in /in/JXRHf on line 15
Process exited with code 255.
Output for 5.5.24 - 5.5.35
Before: 221536 After: 1204640 Fatal error: Call to undefined function gc_colect_cycles() in /in/JXRHf on line 15
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Before: 222048 After: 1205152 Fatal error: Call to undefined function gc_colect_cycles() in /in/JXRHf on line 15
Process exited with code 255.
Output for 5.3.11 - 5.3.29
Before: 625360 After: 1608600 Fatal error: Call to undefined function gc_colect_cycles() in /in/JXRHf on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.10
Before: 625056 After: 1608296 Fatal error: Call to undefined function gc_colect_cycles() in /in/JXRHf on line 15
Process exited with code 255.
Output for 5.2.10 - 5.2.17
Before: 83056 After: 820704 Fatal error: Call to undefined function gc_colect_cycles() in /in/JXRHf 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_colect_cycles() in /in/JXRHf 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_colect_cycles() in /in/JXRHf on line 15
Process exited with code 255.
Output for 5.2.2
Before: 82072 After: 950040 Fatal error: Call to undefined function gc_colect_cycles() in /in/JXRHf on line 15
Process exited with code 255.
Output for 5.2.1
Before: 82072 After: 851744 Fatal error: Call to undefined function gc_colect_cycles() in /in/JXRHf 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/JXRHf 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/JXRHf 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/JXRHf 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/JXRHf on line 3
Process exited with code 255.