3v4l.org

run code in 300+ PHP versions simultaneously
<?php $max = 100; $arr = array_fill(0, $max, 1); //$mem = memory_get_usage(true); foreach ($arr as $key=>$val) { $arr[$max+1] = 9999; } echo memory_get_usage();
Output for 7.4.0
395648
Output for 7.3.0 - 7.3.12
395568
Output for 7.2.17 - 7.2.25
391688
Output for 7.2.0
391728
Output for 7.1.26 - 7.1.33
354952
Output for 7.0.0 - 7.0.20, 7.1.0, 7.1.7
355024
Output for 7.1.5 - 7.1.6
355176
Output for 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
228320
Output for 5.4.10 - 5.4.45
228840
Output for 5.4.0 - 5.4.9
228312
Output for 5.3.11 - 5.3.29
631144
Output for 5.3.0 - 5.3.10
630840
Output for 5.2.10 - 5.2.17
88744
Output for 5.2.7 - 5.2.9
99352
Output for 5.2.3 - 5.2.6
99672
Output for 5.2.2
97592
Output for 5.2.1
97064
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/n6OS7 on line 11
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/n6OS7 on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/n6OS7 on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/n6OS7 on line 11

preferences:
172.17 ms | 401 KiB | 206 Q