3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n = 10000000; $t = -microtime(true); $j = 0; $k = 0; for ($i = 0; $i < $n; $i++) { $j++; $k += 1; } printf("%.2f\n", $t + microtime(true)); $t = -microtime(true); $a = []; $j = 0; $k = 0; for ($i = 0; $i < $n; $i++) { $j++; $k += ($a[$i] ?? 1); } printf("%.2f\n", $t + microtime(true));

Abusive script

This script was stopped while abusing our resources


preferences:
27.16 ms | 405 KiB | 5 Q