3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('memory_limit', 2048); register_shutdown_function(function () { $y = []; for ($i = 0; $i < 1000000000; $i++) { $y[] = $i; } var_dump([ 'total count is' => count($y) ]); }); $x = []; for ($i = 0; $i < 1000000000; $i++) { $x[] = $i; }

preferences:
12.93 ms | 406 KiB | 5 Q