Yes, but when using call_user_function, __call(), and RPC servers, you don't always know what function you are calling at the time you write the script.
I'd argue that it makes sense that the function in that case will not use type hints, then, and use instanceof based checking if necessary. Feeding a function with certain restrictions to an API that may feed it anything is a bad programming practice, IMHO. You should only be sending such functions based on the knowledge that the caller will be calling them with a certain convention. E.g., if the caller expects them to belong to a certain interface or class.
Thats where is_callable()/function_exists() are extremely useful.
I think that we may need some sort of a method_implements_interface() callback to make this set of tools complete.
Zeev
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php