<?php
interface Foo {
public function foo(String $foo);
}
class Bar implements Foo {
public function foo(String $foo) {
return new StdClass;
}
}
$b = new Bar;
var_dump($b->foo("test"));
Catchable fatal error: Argument 1 passed to Bar::foo() must be an instance of String, string given, called in /in/rLXY3 on line 15 and defined in /in/rLXY3 on line 8
Process exited with code 255.
Output for 5.2.0 - 5.2.2
<br />
<b>Catchable fatal error</b>: Argument 1 passed to Bar::foo() must be an instance of String, string given, called in /in/rLXY3 on line 15 and defined in <b>/in/rLXY3</b> on line <b>8</b><br />
Process exited with code 255.
Output for 5.1.0 - 5.1.6
<br />
<b>Fatal error</b>: Argument 1 passed to Bar::foo() must be an object of class String, called in /in/rLXY3 on line 15 and defined in <b>/in/rLXY3</b> on line <b>8</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.0.5
<br />
<b>Fatal error</b>: Argument 1 must be an object of class String in <b>/in/rLXY3</b> on line <b>8</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br />
<b>Parse error</b>: syntax error, unexpected T_STRING in <b>/in/rLXY3</b> on line <b>3</b><br />
Process exited with code 255.