News Feed
Sections




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

Eirik Hoem's Blog:
Dying with grace - PHP's register_shutdown_function
March 17, 2008 @ 12:02:00

Eirik Hoem has posted a new look at a function that can be amazingly helpful when you have a script with issues that needs a little extra help cleaning up after itself - register_shutdown_function.

Scripts tend to die, and that's not usually nice. We do not want to show the user a fatal error nor a blank page (display errors off) . PHP has a function called register_shutdown_function which lets us set up a function which is called at execution shutdown. What this means is that our function will be executed when our script is done executing / dying and PHP execution is about to shut down.

He suggests various things that can be done with the functionality, including checking for successful script execution (via a false variable that can be checked for success).

0 comments voice your opinion now!
registershutdownfunction shutdown function register die success


blog comments powered by Disqus

Similar Posts

Philip Olson's Blog: 20 possible reasons why PHP function names and parameters are weird

PHPBuilder.com: PHP and Regular Expressions 101

Hasin Hayder's Blog: Counting occurrence of a word in a String - Benchmarking of PHP functions

Danne Lundqvist's Blog: Problem sending mail with PHP mail function

Felix Geisendorfer's Blog: Include only the JS you really need


Community Events

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


symfony laravel community interview php7 api introduction application yii2 podcast series part2 project framework list composer language opinion example programming

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