News Feed
Jobs Feed
Sections




News Archive
feed this:

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

Brandon Savage's Blog:
Exceptional PHP Nesting Exceptions In PHP
November 12, 2009 @ 12:43:48

Brandon Savage continues his introductory series on exception handling in PHP with this new post to his blog. This time the focus is on methods for nesting exceptions.

In the last two entries we have talked about the concept of layer abstraction: that is, that exceptions should not be allowed to pass out of one layer and into another. So, when an exception is raised in the database layer it should be caught in the controller. But how do we go about making sure that exceptions raised in the database layer are properly recorded and processed, ensuring that we have error logging and don't simply silence our exceptions?

He looks first at general exception nesting then at extending the base Exception class to write more nested code (inside a class). He also touches on the nested exceptions that were included in the latest release of the PHP 5.3 series.

0 comments voice your opinion now!
exception nesting tutorial native


Mark van der Velden's Blog:
PHP Quiz part 2
May 14, 2009 @ 12:05:22

Mark van der Velden has posted another PHP quiz you can used to test your knowledge of the language:

A short quiz this time, but that doesn't make it less fun. Do you know the answer to all of them? Get a cup of coffee and kill 10 minutes with round two... As always, think of the answer before you execute the code or look it up. You can find round one here.

This one has questions on arrays, ArrayAccess, references, operator precedence and nesting structures. There's no answer key, so you'll just have to test it out if you want to see the answer.

0 comments voice your opinion now!
operator nesting reference array quiz


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



Community Events











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


symfony2 composer code hack opinion podcast application security component install hhvm package language release introduction unittest overview example facebook framework

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