At 02:07 PM 8/9/2005 -0400, George Schlossnagle wrote:
To duplicate the old semantic now you need to do:

if(class_exists('MyFoo') && $obj instanceof MyFoo) { }

which is definitely uglier than

if(is_a($obj, 'MyFoo')) {}

George

But that's a good point. For the few frameworks that might require such functionality they can use class_exists() or other methods. That doesn't mean we should change instanceof for mainstream usage which is 99.99%. In all languages, frameworks do some trickier stuff. In Java they often mess with the ClassLoader, in C++ they deal with DSOs. This kind of development paradigm is not mainstream and as long as there's a way to achieve it, then that's what's important. Even the people that mentioned it's soooo important. I bet that if I look at their code, there's maybe 1 instance that actually would need this (if at all).

Andi

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

Reply via email to