I like the new $obj instanceof ClassName way of checking class / interface types, .... but this method does have one major drawback compared to the old is_a() approach:

   The class must be loaded in order to perform an instanceof check!

Apparently is_a() has also been deprecated, so that an E_STRICT error is thrown. This means that to check types of classes and remain E_STRICT compliant I have to load & parse every class. It's not hard to imagine situations (and experience has shown this to be the case) where this limitation can lead to a lot of extra file i/o and parsing -- and also E_WARNING if the file couldn't be included, etc.

Is is possible to have instanceof not require the class to be loaded? or perhaps just have is_a() not trigger an E_STRICT error?

Thanks,
Hans

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to