How to avoid 'Trying to get property of non-object in' notice
<p>I am trying to download multi-line orders from eBay in a loop. If it is not a multi line order, which is most orders, I get:</p>

<blockquote>
  <p>PHP Notice:  Trying to get property of non-object in....line 605</p>
</blockquote>

<p>Here is my code:</p>

<pre><code>for ( $counter = 0; $counter &lt;= $n_ord; $counter += 1) {
    $multi=0;
    if (!is_object($retxml-&gt;OrderArray[0]-&gt;Order[$counter]-&gt;TransactionArray-&gt;Transaction[$multi]-&gt;OrderLineItemID)) {    
        $OrderLinetest = '';
    } else {
        $OrderLinetest = $retxml-&gt;OrderArray[0]-&gt;Order[$counter]-&gt;TransactionArray-&gt;Transaction[$multi]-&gt;OrderLineItemID;
    }
    while ($OrderLinetest&lt;&gt;''){
        //:
        //Process the order
        //:
        $multi++;               //line 604:
        if (!is_object($retxml-&gt;OrderArray[0]-&gt;Order[$counter]-&gt;TransactionArray-&gt;Transaction[$multi]-&gt;OrderLineItemID)) {    
            $OrderLinetest = '';    //line 605:  
        } else {
            $OrderLinetest = $retxml-&gt;OrderArray[0]-&gt;Order[$counter]-&gt;TransactionArray-&gt;Transaction[$multi]-&gt;OrderLineItemID;
        }
    } // end multi item while loop 
} // end for loop of items
</code></pre>

<p>What is the best way to test if it is an object?</p>

<p>Should I use <code>isset</code>?</p>