Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19886 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78494 invoked by uid 1010); 1 Nov 2005 15:41:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78479 invoked from network); 1 Nov 2005 15:41:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2005 15:41:31 -0000 X-Host-Fingerprint: 194.109.193.120 unknown Linux 2.4/2.6 Received: from ([194.109.193.120:58306] helo=mx1.moulin.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id F9/FC-02082-AAC87634 for ; Tue, 01 Nov 2005 10:41:31 -0500 Received: from localhost (localhost [127.0.0.1]) by mx1.moulin.nl (Postfix) with ESMTP id BC8BE17601D; Tue, 1 Nov 2005 16:41:30 +0100 (CET) Received: from mx1.moulin.nl ([127.0.0.1]) by localhost (moulin [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08104-13; Tue, 1 Nov 2005 16:41:29 +0100 (CET) Received: from [192.168.1.16] (bspr.xs4all.nl [194.109.161.228]) by mx1.moulin.nl (Postfix) with ESMTP id 428D2176016; Tue, 1 Nov 2005 16:41:29 +0100 (CET) Message-ID: <43678CA3.4070407@iamjochem.com> Date: Tue, 01 Nov 2005 16:41:23 +0100 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Wez Furlong Cc: Amin Azez , internals@lists.php.net References: <4e89b4260511010723k5e06e7e1h7d2048a455721ae3@mail.gmail.com> In-Reply-To: <4e89b4260511010723k5e06e7e1h7d2048a455721ae3@mail.gmail.com> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at moulin.nl Subject: Re: [PHP-DEV] === on objects fails with recursion! WTH? From: jochem@iamjochem.com (Jochem Maas) this is a php4-only problem right? (or is the little test below insufficient to test the stated problem?) THIS: ---------------------- php -r ' class A { public $b; function __construct(B $b) { $this->b = $b; $b->setA($this); } } class B { public $a; function setA(A $a) { $this->a = $a; } } $y = new B; $x = new A($y); $z = $x; $clone = clone $x; var_dump(($x === $z), ($x === $clone), ($x == $z), ($x == $clone)); ' RETURNS (php5.0.4): ---------------------- bool(true) bool(false) bool(true) bool(true) Wez Furlong wrote: > I proposed a patch to fix this a while back (at least a year ago). > > --Wez. > > On 11/1/05, Amin Azez wrote: > >>if ($object1===$object2) >> >>does a recursive check! >>"Fatal error: Nesting level too deep - recursive dependency?" >>Whats going on? >> >>I've go lots of object references all highly recursive and I just >>sometimes need to check if two objects are the same object i.e. they >>have the same storage address; I don't need to (and can't afford the >>time) to recursively check every field. >> >>Is there a ==== instead that REALLY does what it seems === is trying to >>fake, presumably to cover up all the object copying that is normally >>going on but that I've managed to avoid? >> >>Sam >> >>-- >>PHP Internals - PHP Runtime Development Mailing List >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> > >