News Feed
Jobs Feed
Sections




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

Travis Swicegood's Blog:
Pushing the boundries of PHP
November 01, 2007 @ 16:48:00

While working with some code of his, Travis Swicegood noticed something odd when he tried to work with Exceptions in a __destruct call:

You must be doing something right when you can send PHP into a tail spin. That or the code you're trying to do is just evil. Turns out __destruct() and __call() don't play well together in 5.2.4 if, and only if, you create an instance of an object without assigning it.

The official (and verified) bug over on the bugs.php.net site gets into more detail on it including a code block that illustrates the point as simply as possible.

In the example I blogged about, __destruct() actually wants to catch any exceptions so it can create meaningful output based on the Exceptions that were generated. In that case, __destruct() would have returned peacefully. [...] At any rate, my take on that would be that would still be that if __destruct() is finished and an exception is still present, then there's an error. Otherwise, how would you handle things such as PDOExceptions thrown during DB clean-up?
0 comments voice your opinion now!
boundries destruct exception call bug boundries destruct exception call bug


blog comments powered by Disqus

Similar Posts

Evert Pot: Composer's bug now fixed

DevShed: Intercepting Customized Exceptions in PHP 5

PHPClasses.org: OpenSSL Serious Security Bug: Does it Affect Your PHP sites?

Pierre-Alain Joye's Blog: Zip 1.4.0, let comment it!

DZone.com: File Path Injection in PHP <= 5.3.6 File Update (CVE 2011-2202)


Community Events











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


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

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