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