3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a{ public $res = 1; public function abc( int $d){ for ($x=1; $x<$d; $x++) $this->res = $this->res * $this->abc( $x); return $this->res; } } $a = new a(); echo $a->abc(10);
based on h89Rp
Output for 7.0.0 - 7.2.0
1
Output for 5.3.20 - 5.6.28
Catchable fatal error: Argument 1 passed to a::abc() must be an instance of int, integer given, called in /in/rsXY7 on line 13 and defined in /in/rsXY7 on line 5
Process exited with code 255.