On Sat, 2009-12-19 at 01:42 +0100, Johannes Mueller wrote:
> if($foo instanceof bar){
> ..
> }
> // runs without any notification
instanceof is a language construct expecting a class identifier.
It doesn't complain about on-existing classes as it would need to
trigger the __autoloader which might be way too much.
> and
>
> if(is_a($foo, bar)){
> ..
> }
> // runs with an undefined constant bar notification
is_a() is a function expecting a string. And this warning is unrelated
to the fact that the class "bar" doesn't exist, but due to the way PHP
treats undefined constants.
Behavior is expected,
johannes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php