3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php Interface wut { public function foo( $yolo ); } class dude implements wut { public function foo ( int $yolo ) { echo $yolo; } } $x = new dude(); $x->foo(2);
based on n5oBo
Output for 7.0.0 - 7.3.0rc3
Fatal error: Declaration of dude::foo(int $yolo) must be compatible with wut::foo($yolo) in /in/vJP18 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/vJP18:7 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Declaration of dude::foo() must be compatible with wut::foo($yolo) in /in/vJP18 on line 7
Process exited with code 255.