Re: Re: RC1, instanceof?

From: Date: Tue, 09 Aug 2005 19:44:59 +0000
Subject: Re: Re: RC1, instanceof?
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-17731@lists.php.net to get a copy of this message
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

Thread (37 messages)

« previous php.internals (#17731) next »