note 117235 deleted from function.set-error-handler by cmb

From: Date: Sun, 13 Oct 2019 07:44:11 +0000
Subject: note 117235 deleted from function.set-error-handler by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-212603@lists.php.net to get a copy of this message
Note Submitter: felix dot b at outlook dot com ---- I saw many checking for all the error constants manually in a switch statement. If you just want to add the type of the error (E_WARNING, E_NOTICE, etc) to your ErrorException, use array_search() with get_defined_constants(): new ErrorException("[" . array_search($errno, get_defined_constants(), true) . "] " . $errstr, 0, $errno, $errfile, $errline);

« previous php.notes (#212603) next »