note 72374 deleted from function.is-object by colder

From: Date: Tue, 16 Jan 2007 22:24:52 +0000
Subject: note 72374 deleted from function.is-object by colder
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-121810@lists.php.net to get a copy of this message
Note Submitter: szrrya at yahoo dot com Reason: wrong ---- I just thought I'd point out that the function is_obj() below is rather unnecessary... get_class() returns FALSE if you pass a non-object, so that takes care of the whole is_object() if in the code. Instead, something simple like: <?php if (get_class($object) == 'cheese') { // ... } ?> Would suffice... you can add your own strtolower() around that if you want, but no need to make a wrapper for that. (Unless you just really want to, in which case the code below works fine.)

« previous php.notes (#121810) next »