title: How to view DOMNodeList object's data in php
body: <p>when I want to test php array I use the following code</p>
  
  <pre><code>    print_r($myarray);
  </code></pre>
  
  <p>but know I want to see the data of an object
  my object is </p>
  
  <pre><code>    $xpath = new DOMXPath($doc);
      $myobject = $xpath-&gt;query('//*[ancestor-or-self::a]');
  </code></pre>
  
  <p>when I use</p>
  
  <pre><code>    print_r($myobject);
  </code></pre>
  
  <p>I get that output</p>
  
  <pre><code>    DOMNodeList Object ( )
  </code></pre>
  
  <p>I want to iterate through the values of this object to test the result of my query?</p>