Re: [PHP-DEV] is_a() versus instanceof

2009-12-19 Thread Johannes Mueller
Johannes "Schlüter" wrote: On Sat, 2009-12-19 at 01:42 +0100, Johannes Mueller wrote: if($foo instanceof bar){ .. } // runs without any notification instanceof is a language construct expecting a class identifier. It doesn't complain about on-existing classes as it would need to trigger the __

Re: [PHP-DEV] is_a() versus instanceof

2009-12-19 Thread mm w
class rootObject { ... function isMemberOrInstanceOfClass($object) { $className = is_object($object) ? get_class($object) : $object; return ($this instanceof $className); } }; On Sat, Dec 19, 2009 at 2:20 AM, Johannes Mueller wrote: > Johannes "Schl