3v4l.org

run code in 300+ PHP versions simultaneously
<?php $max = 1000; $arr = array_fill(0, $max, 1); $mem = memory_get_usage(true); $count = 0; foreach ($arr as $key => $val) { $count ++; $arr[$max+1] = 9999; } echo "123:"; echo $count.' : '.memory_get_usage(true)-$mem;

preferences:
32.19 ms | 402 KiB | 5 Q