PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Johan Barbier   Package Exception Error   index.php   Download  
File: index.php
Role: Unit test script
Content type: text/plain
Description: Test file
Class: Package Exception Error
Turn PHP errors into catchable exceptions
Author: By
Last change: Reflected the changes in the class.
Date: 16 years ago
Size: 351 bytes
 

Contents

Class file image Download
<?php
require_once 'class/package.exceptions.errors.php';

$oErr = new exceptionErrorHandler(true);

/**
 * OR direct call (class exceptionErrorHandler is static and can be used out of its context)
 */
//set_error_handler(array ('exceptionErrorHandler', 'errorHandler'));

$aWrong = 'bla';

try {
   
sort($aWrong);
} catch(
Exception $e) {
    echo
$e;
}
?>