PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andrey Nikishaev  >  Handling Notice and Warning as Exception  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example of use
Class: Handling Notice and Warning as Exception
Throw exceptions when PHP warnings are triggered
Author: By
Last change:
Date: 4 years ago
Size: 249 bytes
 

Contents

Class file image Download
include_once('nwexceptions.php');
 
$a = array();
try {
    print $a['agon'];
} catch (NoticeException $e) {
    print 'FIRST ERROR: '.$e;
}
 
try {
    include('a.php');
} catch (WarningException $e) {
    print 'SECOND ERROR: '.$e;
}