From bbe91c482824726dd537f1190d74c5ae542501fd Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Thu, 11 Feb 2021 23:50:41 +0100 Subject: [PATCH] MDL-70876 php80: 5th param removed from custom error handlers It was deprecated in php72 and now it's gone. Have used this regexp to find all the uses in core: ag set_error_handler | uniq And then checked all them manually, that parameter was not being used in the 3 methods where we are removing it. --- backup/util/settings/tests/settings_test.php | 3 +-- lib/behat/lib.php | 5 ++--- lib/setuplib.php | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/backup/util/settings/tests/settings_test.php b/backup/util/settings/tests/settings_test.php index 63999fe2469..d151fe3a467 100644 --- a/backup/util/settings/tests/settings_test.php +++ b/backup/util/settings/tests/settings_test.php @@ -504,10 +504,9 @@ class mock_course_backup_setting extends course_backup_setting { * @param string $errstr * @param string $errfile * @param int $errline - * @param array $errcontext * @return null */ -function backup_setting_error_handler($errno, $errstr, $errfile, $errline, $errcontext) { +function backup_setting_error_handler($errno, $errstr, $errfile, $errline) { if ($errno !== E_RECOVERABLE_ERROR) { // Currently we only want to deal with type hinting errors return false; diff --git a/lib/behat/lib.php b/lib/behat/lib.php index 03880b0f39e..9c85e79b6b5 100644 --- a/lib/behat/lib.php +++ b/lib/behat/lib.php @@ -124,10 +124,9 @@ function behat_get_error_string($errtype) { * @param string $errstr * @param string $errfile * @param int $errline - * @param array $errcontext * @return bool */ -function behat_error_handler($errno, $errstr, $errfile, $errline, $errcontext) { +function behat_error_handler($errno, $errstr, $errfile, $errline) { // If is preceded by an @ we don't show it. if (!error_reporting()) { @@ -149,7 +148,7 @@ function behat_error_handler($errno, $errstr, $errfile, $errline, $errcontext) { } // Using the default one in case there is a fatal catchable error. - default_error_handler($errno, $errstr, $errfile, $errline, $errcontext); + default_error_handler($errno, $errstr, $errfile, $errline); $errnostr = behat_get_error_string($errno); diff --git a/lib/setuplib.php b/lib/setuplib.php index 9bfb3e36064..9dd220ffa51 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -419,10 +419,9 @@ function default_exception_handler($ex) { * @param string $errstr * @param string $errfile * @param int $errline - * @param array $errcontext * @return bool false means use default error handler */ -function default_error_handler($errno, $errstr, $errfile, $errline, $errcontext) { +function default_error_handler($errno, $errstr, $errfile, $errline) { if ($errno == 4096) { //fatal catchable error throw new coding_exception('PHP catchable fatal error', $errstr);