I would like to get rid of "Trying to get property of non-object" warnings, but couldn't figure out the correct syntax for checking the existance of properties in my case.
$this->nonce = $syncbod->Status->Chal->Meta->NextNonce;
Trying to call
property_exists($syncbod, "Status->Chal")
returns always false. What would be the correct way to check if Chal
exists?
You should look at isset
See this question, although the question applies to arrays, the same principal applies to the SimpleXml properties. The question was more of a reference to the nested part then the array part
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With