<?php
class dog {
public function do_drool() {
echo "Sluuuuurp\n";
}
}
class cat { }
function drool(dog $some_dog) {
$some_dog->do_drool();
}
$poppy = new cat();
drool($poppy);
?>
Fatal error: Uncaught TypeError: drool(): Argument #1 ($some_dog) must be of type dog, cat given, called in /in/F45bM on line 15 and defined in /in/F45bM:10
Stack trace:
#0 /in/F45bM(15): drool(Object(cat))
#1 {main}
thrown in /in/F45bM on line 10
Process exited with code 255.
Fatal error: Uncaught TypeError: Argument 1 passed to drool() must be an instance of dog, instance of cat given, called in /in/F45bM on line 15 and defined in /in/F45bM:10
Stack trace:
#0 /in/F45bM(15): drool(Object(cat))
#1 {main}
thrown in /in/F45bM on line 10
Process exited with code 255.
Catchable fatal error: Argument 1 passed to drool() must be an instance of dog, instance of cat given, called in /in/F45bM on line 15 and defined in /in/F45bM on line 10
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Argument 1 passed to drool() must be an instance of dog, called in /in/F45bM on line 15 and defined in /in/F45bM on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Argument 1 must be an instance of dog in /in/F45bM on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/F45bM on line 3
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/F45bM on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/F45bM on line 3
Process exited with code 255.