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 authored and jvoisin committed Jun 6, 2024
1 parent 3b20c32 commit 381aa67
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 381aa67

Please sign in to comment.