Is there a way to debugin PHP to trap errors on property of non-object?
<p>I'm using the Google Map API V3 sending it the Lat/Lng and it returns the full address. I'm parsing the address that's returned by using the Object. It works for many addresses but for some of them it is generating the PHP error of about the property being a non-object:</p>

<pre><code>PHP Notice:  Trying to get property of non-object in get5.php on line 47
PHP Notice:  Trying to get property of non-object in get5.php on line 48
PHP Notice:  Trying to get property of non-object in get5.php on line 49
</code></pre>

<p>Here are the lines of code for 47-49:</p>

<pre><code>$city_google_api = $country-&gt;AdministrativeArea-&gt;Locality-&gt;LocalityName;
$state_google_api = $country-&gt;AdministrativeArea-&gt;AdministrativeAreaName;
$zip_code_google_api = $country-&gt;AdministrativeArea-&gt;Locality-&gt;PostalCode-&gt;PostalCodeNumber;
</code></pre>

<p>I would like to debug this further, but I don't know which record this is causing these messages regarding the property of non-object. Is there a way to trap on the error or check for "property of non-object" so that I can dump the variables? I don't want to dump this for each record because that's too much output. In general, I would like to know if there is a way to trap errors to dump variables? Thanks!</p>
