Skip to content

Commit

Permalink
Silence unused variable warning with php 8.3
Browse files Browse the repository at this point in the history
    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"));
          |               ^~~~~~~~~~~~
  • Loading branch information
cgzones committed May 30, 2024
1 parent 1732735 commit 820a529
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sp_unserialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 820a529

Please sign in to comment.