3v4l.org

run code in 500+ PHP versions simultaneously
<?php gc_enable(); $arr = new SplFixedArray(5000); getMemory(); for ($i = 0; $i < 5000; $i++) { $d = str_repeat("Hello, world!", 400); $arr[$i][] = $d; } unset($arr); gc_collect_cycles(); getMemory(); function getMemory() { echo date("Y-m-d H:i:s") . ' :: ' . round( (memory_get_usage(true) / 1000000), 2 ) . PHP_EOL; }

preferences:
22.36 ms | 481 KiB | 4 Q