Login   Register  
PHP Classes

Handling Notice and Warning as Exception: Throw exceptions when PHP warnings are triggered

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author Author  
Picture of Andrey Nikishaev
Name: Andrey Nikishaev is available for providing paid consulting. Contact Andrey Nikishaev .
Classes: 13 packages by
Country: Ukraine Ukraine
Age: 28
All time rank: 2456 in Ukraine Ukraine
Week rank: 659 Down12 in Ukraine Ukraine Down
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

  Detailed description   Download Download .zip .tar.gz  
This package can throw exceptions when PHP warnings are triggered.

It registers a PHP error handler that throws special exception classes when a PHP warning or notice is triggered.

The exception messages display the file name and line of the PHP code where the warnings or notices were triggered.

  Classes of Andrey Nikishaev  >  Handling Notice and Warning as Exception  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Handling Notice and Warning as Exception
Base name: nwexceptions
Description: Throw exceptions when PHP warnings are triggered
Version: 0.1
PHP version: 5.0
License: GNU Lesser General Public License (LGPL)
All time users: 890 users
All time rank: 3676
Week users: 0 users
Week rank: 1445 Equal
  Groups   Rate classes User ratings   Applications   Related pages   Files Files  

Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Debug Debug data dumping, bug detection and reporting View top rated classes
Group folder image Language Constructs to assist in the language control View top rated classes

  Innovation Award  
PHP Programming Innovation award nominee
June 2011
Number 2
In PHP, when a non-fatal error occurs, PHP issues a notice or a warning but continues to execute the code regularly as if nothing happened, so certain problems may occur due to unhandled errors.

This class implements a solution that allows you to prevent that those problems happen by throwing an exception when a notice or a warning is issued.

Manuel Lemos

  User ratings  
Not enough user ratings

  Applications that use this package  
No pages of applications that use this class were specified.
Add link image If you know an application of this package, send a message to the author to add a link here.

  Related pages  
Article in blog
Article about this code at my blog

  Files folder image Files  
File Role Description
Plain text file nwexceptions.php Class main file
Accessible without login Plain text file example.php Example Example of use

Download Download all files: nwexceptions.tar.gz nwexceptions.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.