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 lfQ8c
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function factorial() in /in/pGTvS:10 Stack trace: #0 /in/pGTvS(14): Mathematic::factorial(5) #1 {main} thrown in /in/pGTvS 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/pGTvS on line 5
Process exited with code 255.