3v4l.org

run code in 300+ PHP versions simultaneously
<?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.3.0 - 7.3.12
Notice: A non well formed numeric value encountered in /in/149LU on line 8 -387696
Output for 7.2.0 - 7.2.24
Notice: A non well formed numeric value encountered in /in/149LU on line 8 -383936
Output for 7.1.25 - 7.1.33
Notice: A non well formed numeric value encountered in /in/149LU on line 8 -347296
Output for 7.1.0, 7.1.7
Notice: A non well formed numeric value encountered in /in/149LU on line 8 -347368
Output for 7.1.5 - 7.1.6
Notice: A non well formed numeric value encountered in /in/149LU on line 8 -347512
Output for 7.0.0 - 7.0.20
-347352
Output for 5.5.0 - 5.5.35, 5.6.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.0.5, 5.1.0 - 5.1.6, 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.3.11, 4.4.0 - 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 />

preferences:
186.11 ms | 401 KiB | 251 Q