Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30114 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83844 invoked by uid 1010); 6 Jun 2007 12:04:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 83821 invoked from network); 6 Jun 2007 12:04:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2007 12:04:00 -0000 Authentication-Results: pb1.pair.com header.from=antony@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=antony@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: antony@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:1415] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/1D-03203-AA2A6664 for ; Wed, 06 Jun 2007 08:03:58 -0400 Received: (qmail 29091 invoked from network); 6 Jun 2007 12:03:50 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 6 Jun 2007 12:03:50 -0000 Message-ID: <4666A2A4.2070305@zend.com> Date: Wed, 06 Jun 2007 16:03:48 +0400 User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: "mark@cyanox.nl" CC: php-dev References: <4665D15F.2040501@cyanox.nl> <4665D357.5070509@zend.com> <4665E1BF.5090107@cyanox.nl> <46664FBC.5070102@zend.com> <46665D62.7090009@cyanox.nl> In-Reply-To: <46665D62.7090009@cyanox.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Recursive classes ... possible bug? From: antony@zend.com (Antony Dovgal) On 06.06.2007 11:08, mark@cyanox.nl wrote: >> Why? >> The behavior is quite clear - if the objects are instances of the same >> class, we have no other way to compare them but to compare their >> properties, this also applies to properties' properties and >> properties' properties' properties etc. > Well yes but in this case they are the same instance. Comparing the > properties is then useless since they will always be the same. > > Well there could be made a check to see if the objects are the same > instance (like with ===) before actually checking the properties. Hm.. I was actually a bit surprised to see that we don't do "===" before doing "==" on objects. That would of course prevent the recursion in case of comparing an object to itself. I committed a patch minute ago, but it obviously won't change the case when the objects are different and contain circular references. Anyway, thanks a lot for pointing this out. -- Wbr, Antony Dovgal