News Feed
Sections




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

Stubbles Blog:
Exception is an Inheritance Nazi
August 07, 2007 @ 09:21:00

Frank Kleine has voiced his disapproval with what he calls the "Inheritance Nazi" exception handling PHP has natively.

The built-in Exception class in PHP is total crap. It is an inheritance nazi preventing you from doing useful stuff in your own exception classes. Whoever made its get*() methods final and the trace property private did not thought any second about how exceptions may be used or that people need to implement their own stack trace handling.

The reason for the rant is due to a project he's currently working at where he cannot overload the stack trace of an exception instance then throw the exception. This forces him to create his own exception handling, pointless when the PHP one should be able to handle what he wants.

Suggestions/thoughts in the comments sympathize with him and suggest an alternate exception method - an interface that would allow for more customization.

For more information on the exception handling PHP has, check out the manual page for it.

0 comments voice your opinion now!
stubbles exception handling class custom throw inheritance stubbles exception handling class custom throw inheritance


blog comments powered by Disqus

Similar Posts

Felix Geisendorfer's Blog: Assert the yummyness of your cake

DevShed: Using Introspective Methods with the DirectoryIterator Class in PHP 5

JetBrains.com: Just-In-Time debugging and PHP Exception Breakpoints with PhpStorm and Xdebug

Jacob Santos' Blog: Object Oriented Programming Isn't Easy

DevShed: Intercepting Customized Exceptions in PHP 5


Community Events





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


framework release version update language podcast tool install series opinion interview voicesoftheelephpant package library composer security laravel symfony introduction community

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