Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30112 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36326 invoked by uid 1010); 6 Jun 2007 10:33:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36311 invoked from network); 6 Jun 2007 10:33:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2007 10:33:04 -0000 Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.141.85.117 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.141.85.117 uf1.search.ch Linux 2.6 Received: from [195.141.85.117] ([195.141.85.117:50464] helo=smtp.rim.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/D6-03203-D5D86664 for ; Wed, 06 Jun 2007 06:33:02 -0400 Received: from localhost (localhost [127.0.0.1]) by rolig.search.ch (Postfix) with ESMTP id 9F5A625BEDC; Wed, 6 Jun 2007 12:32:58 +0200 (CEST) Received: from smtp.rim.ch ([127.0.0.1]) by localhost (search.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08810-02; Wed, 6 Jun 2007 12:32:57 +0200 (CEST) Received: from [192.168.1.72] (ultrafilter-i [192.168.85.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rolig.search.ch (Postfix) with ESMTP id 895B3D27AA; Wed, 6 Jun 2007 12:32:57 +0200 (CEST) Message-ID: <46668D58.7080406@cschneid.com> Date: Wed, 06 Jun 2007 12:32:56 +0200 User-Agent: Thunderbird 1.5.0.10 (X11/20060911) MIME-Version: 1.0 To: Daniel Penning CC: internals@lists.php.net References: <4665D15F.2040501@cyanox.nl> <200706060015.51543.pstradomski@gmail.com> <46666C72.9030402@daniel-penning.de> In-Reply-To: <46666C72.9030402@daniel-penning.de> Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at search.ch Subject: Re: [PHP-DEV] Recursive classes ... possible bug? From: cschneid@cschneid.com (Christian Schneider) 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