From eab39248d878763ffc661fafb4be22a52c13a3b6 Mon Sep 17 00:00:00 2001 From: filippo.bertilotti <filippobertilotti@gmail.com> Date: Thu, 16 May 2024 11:46:12 +0200 Subject: [PATCH] gestione degli errori personalizzata tramite il codice (parte 102) --- index.php | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/index.php b/index.php index eb7f8a1..a008592 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,18 @@ <?php declare(strict_types= 1); + +set_error_handler(function( + int $errno, + string $errstr, + string $errfile, + int $errline + ): bool + { + throw new ErrorException($errstr,0, $errno, $errfile, $errline); +}); + + set_exception_handler(function (Throwable $exception) { static $show_errors = false; -- Gitblit v1.8.0