3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function isDivisible_x_3($n) { if (strlen($n) == 3){ list($a,$b,$c) = str_split($n); if ($b == $a + 1 && $c == $b + 1){ $mess = "\n$n is divisible by three\n"; $mess .= "\nProof: \$n//3 == " . $n/3; return $mess; } } } $num = 234; echo isDivisible_x_3( $num );
based on 643Di
Output for 5.3.23 - 7.3.0
234 is divisible by three Proof: $n//3 == 78