Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13385 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32905 invoked by uid 1010); 19 Oct 2004 06:31:48 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 32279 invoked from network); 19 Oct 2004 06:31:44 -0000 Received: from unknown (HELO dbmail-mx1.orcon.net.nz) (219.88.242.3) by pb1.pair.com with SMTP; 19 Oct 2004 06:31:44 -0000 Received: from galaxy (port-222-152-50-62.fastadsl.net.nz [222.152.50.62]) (authenticated bits=0) by dbmail-mx1.orcon.net.nz (8.13.1/8.13.1/Debian-14) with ESMTP id i9J6VRXO017247; Tue, 19 Oct 2004 19:31:32 +1300 Message-ID: <00ef01c4b5a5$e21d7870$0a00a8c0@home.jevon.org> To: "Benj Carson" , References: <4173E39D.1000509@gmx.net> <200410182251.00538.benjcarson@digitaljunkies.ca> Date: Tue, 19 Oct 2004 19:35:48 +1300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Received-SPF: pass (dbmail-mx1.orcon.net.nz: authenticated connection) receiver=dbmail-mx1.orcon.net.nz; client-ip=222.152.50.62; helo=galaxy; envelope-from=jevon@jevon.org; x-software=spfmilter 0.93 http://www.acme.com/software/spfmilter/; X-Virus-Scanned: clamd / ClamAV version 0.75-1, clamav-milter version 0.75c on dbmail-mx1 X-Virus-Status: Clean Subject: Re: [PHP-DEV] Nesting level too deep - recursive dependency? From: jevon@jevon.org ("Jevon Wright") I first stumbled upon this problem in one of the RCs for PHP 5, but at the time I thought I was at fault... Consider the documentation at http://www.php.net/manual/en/language.oop5.object-comparison.php : the documentation is a little vague, but it does say "Two object instances are equal if they have the same attributes and values, and are instances of the same class." Thus explaining the recursive loop... Maybe write a big flashing note in the documentation instead about this trap? Jevon ----- Original Message ----- From: "Benj Carson" To: Sent: Tuesday, October 19, 2004 5:51 PM Subject: Re: [PHP-DEV] Nesting level too deep - recursive dependency? > If you use '===' it works as expected. I don't know if the fact that '==' > doesn't work is a bug or not, however. > > > Benj Carson > > > On October 18, 2004 09:39 am, Francisco M. Marzoa Alonso wrote: > > This code: > > > > > > > class TestClass { > > public $myself; > > > > function __construct () { > > $this->myself = $this; > > } > > } > > > > $TestObj = new TestClass (); > > > > if ( $TestObj->myself == $TestObj ) { > > echo "They are same.\n"; > > } > > > > ?> > > > > Gives me a "Fatal error: Nesting level too deep - recursive dependency?" > > on line #13: if ( $TestObj->myself == ...) > > > > Could this be a PHP bug or I'm doing something wrong? > > > > FYI: > > > > PHP Version 5.0.2 > > PHP API 20031224 > > PHP Extension 20040412 > > Zend Extension 220040412 > > Server API Apache 2.0 Handler > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >