3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Mathematic { public static function factorial(int $number) { if($number < 1) return 1; return $number * factorial($number -1); } } Mathematic::factorial(5);
based on MposG
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function factorial() in /in/4SZaW:10 Stack trace: #0 /in/4SZaW(14): Mathematic::factorial(5) #1 {main} thrown in /in/4SZaW on line 10
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Catchable fatal error: Argument 1 passed to Mathematic::factorial() must be an instance of int, integer given, called in /in/4SZaW on line 14 and defined in /in/4SZaW on line 5
Process exited with code 255.