note 48255 added to function.gettype
| From: | mattatappstate at osu1 dot php dot net | Date: | Thu, 16 Dec 2004 19:10:32 +0000 |
| Subject: | note 48255 added to function.gettype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81872@lists.php.net to get a copy of this message | ||
Here is something that had me stumped with regards to gettype and is_object.
Gettype will report an incomplete object as such, whereas is_object will return FALSE.
if (!is_object($incomplete_obj)) {
echo 'This variable is not an object, it is a/an ' . gettype($incomplete_obj);
}
Will print:
This variable is not an object, it is a/an object
----
Manual Page -- http://www.php.net/manual/en/function.gettype.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48255
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48255&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48255&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48255&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48255&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48255&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48255&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48255&report=yes
Search -- http://master.php.net/manage/user-notes.php