3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $res = array_fill(0, 100, array()); $m = memory_get_usage(true); for ($i = 0; $i < 10000; $i++) { $res = $res + array(); } echo "$i operations of \$res+=array() eats: " . (memory_get_usage(true) - $m) . "\n";
based on 64TZi
Output for 5.2.1 - 7.2.0
10000 operations of $res+=array() eats: 0
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/E5kE8 on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/E5kE8 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/E5kE8 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/E5kE8 on line 4