News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
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



Similar Posts

Stefan Mischook's Blog: OOP in PHP: New PHP Article in Web Designer Magazine (Nov 2006)

David Coallier's Blog: Zend PHP 5 Certification Self-test

DevShed: Using Subclasses and Accessors with Member Visibility to Protect PHP 5 Class Data

Elizabeth Smith's Blog: How to Compile PHP5.2 and PHP-GTK2 on Windows using Visual C++ Express

Lukas Smith's Blog: PHP 5.3.0alpha2 is released


Community Events











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


security PHP5 conference release ajax mysql framework job PEAR cakephp developer zendframework package code releases zend book database application example

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