toxygene/pale

PHP error to exception trap library

1.0.0 2017-09-10 15:50 UTC

This package is not auto-updated.

Last update: 2024-04-27 11:07:56 UTC


README

Pale is a simple PHP >=5.6 library that allows a developer to easily convert errors to exceptions without having to worry about the details of changing and restoring error handlers.

Usage

use function Pale\run;

try {
    run(function() {
        trigger_error("this will become an exception");
    });
} catch(ErrorException $e) {
    var_dump($e);
}