3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function d6() { return range(1,6); } $t = $i = 0; foreach(d6() as $a) { foreach(d6() as $b) { foreach(d6() as $c) { $t++; // includes both doubles and triples if($a==$b || $a == $c || $b == $c) { $i++; } } } } echo "$i doubles out of $t results.\n";
Output for 4.3.0 - 7.1.0
96 doubles out of 216 results.