Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30084 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26569 invoked by uid 1010); 5 Jun 2007 21:11:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 26540 invoked from network); 5 Jun 2007 21:11:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2007 21:11:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=mark@cyanox.nl; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mark@cyanox.nl; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cyanox.nl from 77.248.52.200 cause and error) X-PHP-List-Original-Sender: mark@cyanox.nl X-Host-Fingerprint: 77.248.52.200 unknown Received: from [77.248.52.200] ([77.248.52.200:53567] helo=a191140.upc-a.chello.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/2B-33808-A61D5664 for ; Tue, 05 Jun 2007 17:11:08 -0400 Received: from [192.168.0.105] ([::ffff:192.168.0.105]) (AUTH: LOGIN mark, SSL: TLSv1/SSLv3,256bits,AES256-SHA) by a191140.upc-a.chello.nl with esmtp; Tue, 05 Jun 2007 23:11:35 +0200 id 00000000016E4001.000000004665D187.000021B8 Message-ID: <4665D15F.2040501@cyanox.nl> Date: Tue, 05 Jun 2007 23:10:55 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061115 Thunderbird/1.5.0.8 Mnenhy/0.7.4.666 MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Recursive classes ... possible bug? From: mark@cyanox.nl ("mark@cyanox.nl") 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. 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. Greetings, Mark Sanders.