Re: Recursive classes ... possible bug?

From: Date: Wed, 06 Jun 2007 11:52:32 +0000
Subject: Re: Recursive classes ... possible bug?
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-30113@lists.php.net to get a copy of this message
Christian Schneider wrote:
Daniel Penning wrote:
Checking if the reference is equal and then doing the member-by-member comparison if they differ would prevent too deep recursion in most cases.
That would solve this particular case (and might be worth doing for performance reasons anyway I'd say) but won't solve the general problem. Imagine comparing o1->o2->o1 (object 1 having a reference to object 2 which in turn has a reference back to object 1) with o3->o4->o3. You'd still get the same result as now (nesting too deep) and there is no easy way around it. - Chris
It might just be me, but I thought there was a student with a google summer of code project who was working on circular references and how to properly free memory for them. Perhaps some of the algorithms devised for that could be used to resolve problems as noted above? - Tul

« previous php.internals (#30113) next »