3v4l.org

run code in 300+ PHP versions simultaneously
<?php Interface wut { public function foo( string $yolo = 'yolo' ) { } } class dude implements wut { public function foo ( int $yolo = 2) { echo $yolo; } } $x = new dude(); $x->foo();
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
Fatal error: Interface function wut::foo() cannot contain body in /in/5lqT1 on line 4
Process exited with code 255.

preferences:
164.71 ms | 1395 KiB | 36 Q