title: PHP Tree and Memory Usage
body: <p>I am building a tree structure in PHP and I could leave it as an array, or turn it into a tree of objects.  I think there will be much better performance if I leave it as an array, but I'm not sure.</p>
  
  <p>In the case of an array, the owning object would have a reference to the root element, and that's it.  The root element would contain sub-arrays which may, in turn, contain their own sub-arrays.</p>
  
  <p>In the case of objects, my mapper would need to instantiate them on load, and for every child object their would be a reference from its parent.  For a 300 node tree, this would mean 299 references, as opposed to 1 when using arrays.</p>
  
  <p>So, it seems to me that the performance would be much better if I use arrays rather than objects.  Is this correct?  It's important because sacrificing the behaviour of objects will be a considerable trade off in this case.</p>