3v4l.org

run code in 300+ PHP versions simultaneously
<?php function d6() { return range(1,6); } $t = $i = 0; foreach(d6() as $a) { foreach(d6() as $b) { foreach(d6() as $c) { $t++; if($a==$b || $a == $c || $b == $c) { $i++; } } } } echo "$i doubles out of $t results.\n";

preferences:
44.95 ms | 402 KiB | 5 Q