3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo(array $a) { echo memory_get_usage(), PHP_EOL; echo count($a), PHP_EOL; echo memory_get_usage(), PHP_EOL; } $array = range(1, 100000); echo memory_get_usage(), PHP_EOL; foo($array); echo memory_get_usage(), PHP_EOL;
Output for 7.0.0 - 7.1.0
4545536 4545568 100000 4545568 4545568
Output for 5.6.0 - 5.6.28
14867928 14868016 100000 14868016 14868016
Output for 5.5.0 - 5.5.37
14867928 14868000 100000 14868000 14868000
Output for 5.4.0 - 5.4.45
14868464 14868536 100000 14868536 14868536
Output for 5.3.11 - 5.3.29
15271048 15271080 100000 15271080 15271080
Output for 5.3.0 - 5.3.10
15270728 15270760 100000 15270760 15270760
Output for 5.2.10 - 5.2.17
13929992 13930288 100000 13930288 13930192
Output for 5.2.7 - 5.2.9
13931616 13931840 100000 13931936 13931936
Output for 5.2.6
13931952 13932176 100000 13932272 13932272
Output for 5.2.3 - 5.2.5
13931904 13932128 100000 13932224 13932224
Output for 5.2.2
13929232 13929416 100000 13929512 13929512
Output for 5.2.1
13929328 13929512 100000 13929512 13929512
Output for 5.1.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/kSWZJ on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in /in/kSWZJ on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_ARRAY, expecting ')' in /in/kSWZJ 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_ARRAY, expecting ')' in /in/kSWZJ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/kSWZJ on line 3
Process exited with code 255.