3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php Interface wut { public function foo( string $yolo ); } class dude implements wut { public function foo ( int $yolo = 2) { echo $yolo; } } $x = new dude(); $x->foo();
based on 0rBQ6
Output for 7.0.0 - 7.2.8
Fatal error: Declaration of dude::foo(int $yolo = 2) must be compatible with wut::foo(string $yolo) in /in/u2gIl on line 7
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Declaration of dude::foo() must be compatible with that of wut::foo() in /in/u2gIl:7 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Default value for parameters with a class type hint can only be NULL in /in/u2gIl on line 8
Process exited with code 255.