<?php
interface Foo {
public function foo(String $foo) : String;
}
class Bar implements Foo {
public function foo(String $foo) {
return new StdClass;
}
}
$b = new Bar;
var_dump($b->foo("test"));
Fatal error: Declaration of Bar::foo(string $foo) must be compatible with Foo::foo(string $foo): string in /in/LN3Fp on line 8
Process exited with code 255.
Fatal error: Declaration of Bar::foo(string $foo) must be compatible with Foo::foo(string $foo): string in /in/LN3Fp on line 7
Process exited with code 255.