note 48255 modified in function.gettype by danbrown

From: Date: Mon, 29 Nov 2010 15:57:17 +0000
Subject: note 48255 modified in function.gettype by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-174441@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. <?php 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 --was-- 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 http://php.net/manual/en/function.gettype.php

« previous php.notes (#174441) next »