PHP Classes

File: Error_handler.php

Recommend this page to a friend!
  Classes of Edwin F. Sturt   JavaScript in PHP   Error_handler.php   Download  
File: Error_handler.php
Role: Auxiliary script
Content type: text/plain
Description: Error handler
Class: JavaScript in PHP
Generate JavaScript for validation of HTML forms
Author: By
Last change:
Date: 12 years ago
Size: 609 bytes
 

Contents

Class file image Download
<?php

error_reporting
(E_ALL);
ini_set('display_errors', 0);

function
shutdown()
{
       
$isError = false;
        if (
$error = error_get_last()){
            switch(
$error['type']){
                case
E_ERROR:
                case
E_CORE_ERROR:
                case
E_COMPILE_ERROR:
                case
E_USER_ERROR:
                   
$isError = true;
                    break;
            }
        }

        if (
$isError){
            echo
"PHP ERROR: ({$error['message']})";
        } else {
            echo
"";
        }
}
register_shutdown_function('shutdown');

?>