Just stumbled about some funny PHP behaviour: obviously there is already some return-type checking implemented.
class Foo
{
public function __toString()
{
return 313;
}
}
$foo = new Foo();
echo $foo;
Result:
Catchable fatal error: Method Foo::__toString() must return a string value in
E:\php\tests\__toString.php on line 11