3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 0; $attackCount = 1000000; for($i = 0; $i < $attackCount; $i++) { $a1 = arsort([rand(1,6), rand(1,6), rand(1,6)]); $b1 = arsort([rand(1,6), rand(1,6)]); $a += $a1[0] > $b1[0]; $a += $a1[1] > $b1[1]; } var_dump($a / $attackCount);

preferences:
31.99 ms | 402 KiB | 5 Q