note 21357 deleted from function.is-a by didou
| From: | didou@php.net | Date: | Thu, 03 Jul 2003 14:18:58 +0000 |
| Subject: | note 21357 deleted from function.is-a by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-51451@lists.php.net to get a copy of this message | ||
Note Submitter: krisher@oswego.edu
----
Any implementation of is_a that relies on empty() to test whether the object parameter is empty will
not work (as I painfully discovered...), since empty returns true for an object with no attributes
(ie. only methods). While it generally may not be useful to have an object with no attributes,
there are some cases where it is necessary (eg. since call_user_func() doesn't work with
classes, only objects...) This last version by php@electricsurfer.com seems to work for me...