News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Richard Lord's Blog:
PHP 5.2 - Nesting level too deep - recursive dependency?
November 13, 2006 @ 10:02:00

So, you've just upgraded to PHP 5.2 and all is going well until you come across a page in your application that gives the message "Nesting level too deep - recursive dependency?". With such a vague error message, you might have trouble locating the source of the problem. Thankfully, someone's already been there and figured out the issue - Richard Lord.

I installed PHP 5.2 on one of my testing servers today and a couple of bits of code that previously worked fine in version 5.1.6 threw fatal errors in the new version. The error message was "Nesting level too deep - recursive dependency?" and it took a little time to track down the root of the problem. Here's what I'd done wrong.

Basically, his problem was using the "non-strict" evaluation for checking if two objects were equal to each other (== instead of ===). This compares everything about them, down to the properties - even if they're references to other properties inside of the same class (which is where the problem lies).

So, the fix is simple - === instead of == when comparing those objects. You'll be happier for the change.

0 comments voice your opinion now!
php5 nesting level deep recursive dependency compare object php5 nesting level deep recursive dependency compare object


blog comments powered by Disqus

Similar Posts

php|architect: Exam Schedule at php/db|works now available

Ibuildings techPortal: DPCRadio: Real World Dependency Injection

Ivo Jansch's Blog: Mixins in PHP

Alison Holloway's Blog: PHP 5.2.2 Setup on Windows

CloudSpring.com: Using the Rackspace PHP SDK


Community Events





Don't see your event here?
Let us know!


laravel testing series interview unittest code community podcast configure threedevsandamaybe developer wordpress api application release list introduction library language install

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework