3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Mathematic { public static function factorial(int $number): int { if($number < 1) return 1; return $number * factorial($number -1); } } Mathematic::factorial(5);
based on 3tm1S
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function factorial() in /in/lfQ8c:10 Stack trace: #0 /in/lfQ8c(14): Mathematic::factorial(5) #1 {main} thrown in /in/lfQ8c on line 10
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/lfQ8c on line 5
Process exited with code 255.