Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30113 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75264 invoked by uid 1010); 6 Jun 2007 11:52:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 75249 invoked from network); 6 Jun 2007 11:52:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2007 11:52:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=tularis@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=tularis@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 213.75.38.114 cause and error) X-PHP-List-Original-Sender: tularis@php.net X-Host-Fingerprint: 213.75.38.114 hpsmtp-eml14.kpnxchange.com Windows 2000 SP4, XP SP1 Received: from [213.75.38.114] ([213.75.38.114:33941] helo=hpsmtp-eml14.kpnxchange.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/1C-03203-2FF96664 for ; Wed, 06 Jun 2007 07:52:19 -0400 Received: from hpsmtp-eml07.kpnxchange.com ([213.75.38.107]) by hpsmtp-eml14.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 6 Jun 2007 13:52:15 +0200 Received: from [192.168.2.100] ([62.131.2.67]) by hpsmtp-eml07.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 6 Jun 2007 13:52:14 +0200 Message-ID: <4666A000.70109@php.net> Date: Wed, 06 Jun 2007 13:52:32 +0200 User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: Christian Schneider CC: Daniel Penning , internals@lists.php.net References: <4665D15F.2040501@cyanox.nl> <200706060015.51543.pstradomski@gmail.com> <46666C72.9030402@daniel-penning.de> <46668D58.7080406@cschneid.com> In-Reply-To: <46668D58.7080406@cschneid.com> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 06 Jun 2007 11:52:14.0336 (UTC) FILETIME=[1FC73000:01C7A831] Subject: Re: [PHP-DEV] Recursive classes ... possible bug? From: tularis@php.net ("M. Sokolewicz") 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