Re: Detecting object types
| From: | Andi Gutmans | Date: | Sun, 05 May 2002 17:16:19 +0000 |
| Subject: | Re: Detecting object types | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-83726@lists.php.net to get a copy of this message | ||
If you can get a zend_class_entry * to the class you want to check again then ce->refcount will be unique-per-class. In Engine 2 ce itself will be unique.
Andi
At 10:03 05/05/2002 -0700, brad lafountain wrote:
Im looking for the exact type.. not if is an object or not. I want to know that is a class of type "myClass" i just found zend_check_class/* * C'est une UGLY HACK. */ if (ce->refcount == expected_ce->refcount) { return 1; }It uses that for the test... can someone explain why that works - Brad --- Markus Fischer <mfischer@guru.josefine.at> wrote:Hi,how doesif (Z_TYPE_P(val) == IS_OBJECT) { ...work for you?- MarkusOn Sun, May 05, 2002 at 09:55:24AM -0700, brad lafountain wrote :Is there a cleaner way to find out if a parameter that was passed into a function is a certin type. Currently i use. strcmp(Z_OBJCE_P(val)->name, "class") - Brad __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php-- Please always Cc to me when replying to me on the lists. GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc "I'm not stupid, you know? :)" - Jani Taskinen -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php