ainoy31 Posted July 17, 2008 Share Posted July 17, 2008 Hello- I call a web service and this what is returned to me. s calling code: $result = $test->getPhoneNumber($objAccount); tdClass Object ( [out] => stdClass Object ( ) ) My understanding is that it is empty and I need to check to see if it is empty. So, I use the following code to do so but no luck. if(empty($result->out)) { do something.... } else { do something.... } Much appreciation. AM Link to comment https://forums.phpfreaks.com/topic/115319-object-question/ Share on other sites More sharing options...
trq Posted July 17, 2008 Share Posted July 17, 2008 As of PHP 5, objects with no properties are no longer considered empty. Do you know what this call returns when it is successfull? If it is some other object type other than stdClass you could use... if ($result instanceof stdClass) { // do something } else { // do somthing else } Link to comment https://forums.phpfreaks.com/topic/115319-object-question/#findComment-592878 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.