title: Recursivity for a property
body: <p>I have a object - let's call it <code>$node</code>.</p>
  
  <p>This object has a property called <code>$node-&gt;children</code>, which essentially returns a array of child objects (nodes), in the form of <code>node_id =&gt; NodeObject</code>:</p>
  
  <pre><code>Array
    [1]  =&gt; Node object
    [2]  =&gt; Node object
    [3]  =&gt; Node object
    ...
  </code></pre>
  
  <p>These child objects are of the same type, so they too have the same property...</p>
  
  <p>How can I gather all the child and grand-child node IDs for a given node?</p>
  
  <p>I need to somehow walk trough the all child nodes, but I don't know how. Right now I'm stuck with <code>array_keys($children)</code>, but it only gets me the 1st level children.</p>
  
  <p>Not sure if it matters but this property comes from a magic __get method, I can't see its contents with print_r ...</p>