note 21357 added to function.is-a
| From: | krisher at oswego dot edu | Date: | Thu, 09 May 2002 19:49:22 +0000 |
| Subject: | note 21357 added to function.is-a | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30394@lists.php.net to get a copy of this message | ||
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...
--
http://www.php.net/manual/en/function.is-a.php
http://master.php.net/manage/user-notes.php?action=edit+21357
http://master.php.net/manage/user-notes.php?action=delete+21357
http://master.php.net/manage/user-notes.php?action=reject+21357