3v4l.org

run code in 300+ PHP versions simultaneously
<?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.4.0 - 7.4.1
Before: 388848 After: 511760 After: 511760
Output for 7.3.0 - 7.3.13
Before: 388792 After: 511704 After: 511704
Output for 7.2.0 - 7.2.26
Before: 384936 After: 507848 After: 507848
Output for 7.1.0 - 7.1.33
Before: 348296 After: 471208 After: 471208
Output for 7.0.0 - 7.0.33
Before: 348312 After: 471224 After: 471224
Output for 5.6.0 - 5.6.40
Before: 221272 After: 1204392 After: 1204392
Output for 5.5.0 - 5.5.38
Before: 221264 After: 1204368 After: 1204368
Output for 5.4.0 - 5.4.45
Before: 221776 After: 1204880 After: 1204880
Output for 5.3.11 - 5.3.29
Before: 624656 After: 1607896 After: 1607896
Output for 5.3.0 - 5.3.10
Before: 624352 After: 1607592 After: 1607592
Output for 5.2.10 - 5.2.17
Before: 82528 After: 820176 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: 83296 After: 951312 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: 83616 After: 951632 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: 81672 After: 949640 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: 81672 After: 851344 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.0.5, 5.1.0 - 5.1.6, 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.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/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.

preferences:
236.09 ms | 401 KiB | 325 Q