Re: is_a() versus instanceof

From: Date: Sat, 19 Dec 2009 00:59:58 +0000
Subject: Re: is_a() versus instanceof
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-46472@lists.php.net to get a copy of this message
Johannes Mueller wrote:
if(is_a($foo, bar)){ .. } // runs with an undefined constant bar notification I think the instanceof solution can cause problems, because you can not trigger the problem. What do you think?
I think you meant: if(is_a($foo, "bar")){ since is_a() takes a string as the second parameter. Does this correction then reset your expectation about instanceof? Chris -- Blog: http://blogs.oracle.com/opal Twitter: http://twitter.com/ghrd

« previous php.internals (#46472) next »