3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(); $a[1] = 'toto'; $m = memory_get_usage(); $a[2] = 'titi'; $m2 = memory_get_usage(); $a[1000000] = 'tata'; echo $m2-$m . ' '. memory_get_usage() - $m;
Output for 7.1.0
Notice: A non well formed numeric value encountered in /in/149LU on line 8 -347368
Output for 7.0.0 - 7.0.14
-347352
Output for hhvm-3.10.0 - 3.12.0
-2097152
Output for 5.5.0 - 5.6.21
-217400
Output for 5.4.10 - 5.4.45
-217920
Output for 5.4.0 - 5.4.9
-217392
Output for 5.3.11 - 5.3.29
-620784
Output for 5.3.0 - 5.3.10
-620480
Output for 5.2.10 - 5.2.17
-78424
Output for 5.2.7 - 5.2.9
-78984
Output for 5.2.3 - 5.2.6
-79304
Output for 5.2.1 - 5.2.2
-77168
Output for 5.0.0 - 5.2.0
<br /> <b>Fatal error</b>: Call to undefined function memory_get_usage() in <b>/in/149LU</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/149LU</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/149LU</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/149LU</b> on line <b>4</b><br />