PHP object parent/child recursion

Posted by Damien on Stack Overflow See other posts from Stack Overflow or by Damien
Published on 2011-01-07T15:36:33Z Indexed on 2011/01/07 15:53 UTC
Read the original article Hit count: 285

Filed under:
|
|

I've got a parent-child OO relationship. Parent obejcts has many child objects and every child object knows about it's parent by reference.

The parent can be a child too (basically its a tree).

When i do a var_dump() on the root object it says ["parent"]=>RECURSION many times and the generated description will be really long.

I'm wondering if i do something wrong. If yes, i'm interested in the "best practice".

Thanks for the help!

© Stack Overflow or respective owner

Related posts about php

Related posts about parent-child