3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php Interface wut { public function foo( string $yolo = 'yolo' ) { echo $yolo; } } class dude implements wut { public function foo ( int $yolo = 2) { echo $yolo; } } $x = new dude(); $x->foo();
Output for 7.0.0 - 7.1.7
Fatal error: Interface function wut::foo() cannot contain body in /in/Yig1F on line 4
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Interface method wut::foo() cannot contain body in /in/Yig1F:4 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/Yig1F on line 4
Process exited with code 255.