3v4l.org

run code in 300+ PHP versions simultaneously
<?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 );
Output for 7.0.0 - 7.0.3
Parse error: syntax error, unexpected '/', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /in/643Di on line 9
Process exited with code 255.
Output for 5.5.24 - 5.5.32, 5.6.8 - 5.6.18
Parse error: syntax error, unexpected '/', expecting '}' in /in/643Di on line 9
Process exited with code 255.

preferences:
176.63 ms | 1395 KiB | 31 Q