Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30092 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45401 invoked by uid 1010); 5 Jun 2007 21:46:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 45386 invoked from network); 5 Jun 2007 21:46:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2007 21:46:28 -0000 Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain l-i-e.com from 67.139.134.202 cause and error) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:4543] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A8/0E-33808-2B9D5664 for ; Tue, 05 Jun 2007 17:46:27 -0400 Received: (qmail 10874 invoked by uid 98); 5 Jun 2007 21:46:28 -0000 Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-2.01 (clamdscan: 0.88.7/3360. Clear:RC:1(127.0.0.1):. Processed in 0.071066 secs); 05 Jun 2007 21:46:28 -0000 Received: from localhost (HELO l-i-e.com) (127.0.0.1) by localhost with SMTP; 5 Jun 2007 21:46:28 -0000 Received: from 216.230.84.67 (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Tue, 5 Jun 2007 16:46:28 -0500 (CDT) Message-ID: <43900.216.230.84.67.1181079988.squirrel@www.l-i-e.com> In-Reply-To: <4665D15F.2040501@cyanox.nl> References: <4665D15F.2040501@cyanox.nl> Date: Tue, 5 Jun 2007 16:46:28 -0500 (CDT) To: "mark@cyanox.nl" Cc: internals@lists.php.net Reply-To: ceo@l-i-e.com User-Agent: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] Recursive classes ... possible bug? From: ceo@l-i-e.com ("Richard Lynch") On Tue, June 5, 2007 4:10 pm, mark@cyanox.nl wrote: > Dear internals, > > I stumbled upon the following odd error message from PHP which I was > not > expecting. > > Here is a small example that triggered the error with 5.2.2, 5.2.3 and > a > php5.2-200706052030 snapshot. > > class class1{ > public $c2; > function __construct($c2){ > $this->c2 = $c2; > } > } > > class class2{ > public $c1; > function setC1($c1){ > $this->c1 = $c1; > } > function test(){ > echo $this == $this->c1->c2?'equals':'not equals'; // Somehow this > if statement triggers the error. > } > } > > > $tt = new class2(); > $t = new class1($tt); > $tt->setC1($t); > var_dump($t); > $tt->test(); > ?> > > I get the error: > > Fatal error: Nesting level too deep - recursive dependency? in > /home/cyanox/DEV/test_object_recursion.php on line 15 > > Although it is obvious that there is a recursion I think this simple > example should work without error. I also don't see why it would recurse infinitely... Seems like it should be pretty straight-forward, unless I'm missing something... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?