From 381aa67af284e421ce6554e7bf6039dda5e674b9 Mon Sep 17 00:00:00 2001 From: Christian Göttsche Date: Thu, 30 May 2024 20:23:10 +0200 Subject: Silence unused variable warning with php 8.3 src/sp_unserialize.c: In function 'zif_sp_unserialize': src/sp_unserialize.c:131:15: warning: unused variable 'orig_handler' [-Wunused-variable] 131 | zif_handler orig_handler = zend_hash_str_find_ptr(SPG(sp_internal_functions_hook), ZEND_STRL("unserialize")); | ^~~~~~~~~~~~ --- src/sp_unserialize.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sp_unserialize.c b/src/sp_unserialize.c index ab0d9ed..4442997 100644 --- a/src/sp_unserialize.c +++ b/src/sp_unserialize.c @@ -128,7 +128,9 @@ PHP_FUNCTION(sp_unserialize) { } } else { status = 1; } +#if ! (PHP_VERSION_ID >= 80300) zif_handler orig_handler = zend_hash_str_find_ptr(SPG(sp_internal_functions_hook), ZEND_STRL("unserialize")); +#endif if (0 == status) { #if PHP_VERSION_ID >= 80300 // PHP8.3 gives a warning about trailing data in unserialize strings. -- cgit v1.3