Andi Gutmans wrote:
I don't agree that instanceof on a class which doesn't exist should work. It doesn't do so in other languages (or at least not in Java/C++(dynamic_cast)) nor does it really seem to make a lot of sense and be useful. Sounds more like an edge case you have hit with some weird code which can probably be written differently.
Those languages are alot less dynamic at runtime compared to PHP. So I dont think this is a valid argument.
A common scenario (which I personally dont like) but what is done: - PEAR.php is loaded on error to generate an instance of PEAR_Error - inside the code you check for an instance of PEAR_Error being returned - obviously when no error ever occured you never loaded PEAR.php and kaboom
There is no way this would be changed for RC1 (or PHP 5.1) because it's a significant change which would affect many places and not only instanceof. I personally think it shouldn't be changed at all. If you're referencing classes/exceptions in your code that don't exist, then something is very bogus with your code. Don't use a NonExistantException if that could happen, use Exception...
Well the easy solution is to simply undeprecate is_a(). regards, Lukas -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php