From dd98c67943f6a8e13f49e76379e0fe42fc746ce7 Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Fri, 17 Jan 2025 14:46:00 +0100 Subject: [PATCH 1/2] PHP 8.4: E_STRICT constant deprecated From PHP 8.4 the E_STRICT constant has been deprecated and will emit deprecation notices. PHP core and core extensions since PHP 8.0 and later do not emit E_STRICT notices at all. On PHP 7 series before PHP 7.4, some functions conditionally emit E_STRICT notices. For details see: https://php.watch/versions/8.4/E_STRICT-deprecated Signed-off-by: Daniel Ziegenberg --- src/Server.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Server.php b/src/Server.php index 338e360..ca4282a 100644 --- a/src/Server.php +++ b/src/Server.php @@ -1417,8 +1417,13 @@ public static function _xmlrpcs_errorHandler($errCode, $errString, $filename = n } //if ($errCode != E_NOTICE && $errCode != E_WARNING && $errCode != E_USER_NOTICE && $errCode != E_USER_WARNING) - if ($errCode != E_STRICT) { + // From PHP 8.4 the E_STRICT constant has been deprecated and will emit deprecation notices. + // PHP core and core extensions since PHP 8.0 and later do not emit E_STRICT notices at all. + // On PHP 7 series before PHP 7.4, some functions conditionally emit E_STRICT notices. + if (PHP_VERSION_ID >= 70400) { static::error_occurred($errString); + } elseif ($errCode != E_STRICT) { + static::error_occurred($errString); } // Try to avoid as much as possible disruption to the previous error handling mechanism in place From ba1220f451292ff7a6bd3c3716dfd0b60241ff70 Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Fri, 17 Jan 2025 16:46:27 +0100 Subject: [PATCH 2/2] remove unused conditional in error handler Signed-off-by: Daniel Ziegenberg --- src/Server.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Server.php b/src/Server.php index ca4282a..f19dc9a 100644 --- a/src/Server.php +++ b/src/Server.php @@ -1416,7 +1416,6 @@ public static function _xmlrpcs_errorHandler($errCode, $errString, $filename = n return; } - //if ($errCode != E_NOTICE && $errCode != E_WARNING && $errCode != E_USER_NOTICE && $errCode != E_USER_WARNING) // From PHP 8.4 the E_STRICT constant has been deprecated and will emit deprecation notices. // PHP core and core extensions since PHP 8.0 and later do not emit E_STRICT notices at all. // On PHP 7 series before PHP 7.4, some functions conditionally emit E_STRICT notices.