Re: Nesting level too deep - recursive dependency?

From: Date: Tue, 19 Oct 2004 04:51:00 +0000
Subject: Re: Nesting level too deep - recursive dependency?
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-13384@lists.php.net to get a copy of this message
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: > > <?php > > 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

« previous php.internals (#13384) next »