Skip to content

Commit 94c256f

Browse files
committed
Properly silence set-but-unused-var warning
1 parent 48aefb5 commit 94c256f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ext/mbstring/mbstring.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5578,19 +5578,16 @@ static bool mb_check_str_encoding(zend_string *str, const mbfl_encoding *encodin
55785578

55795579
static bool php_mb_check_encoding_recursive(HashTable *vars, const mbfl_encoding *encoding)
55805580
{
5581-
zend_long idx;
55825581
zend_string *key;
55835582
zval *entry;
55845583
bool valid = true;
55855584

5586-
(void)(idx); /* Suppress spurious compiler warning that `idx` is not used */
5587-
55885585
if (GC_IS_RECURSIVE(vars)) {
55895586
php_error_docref(NULL, E_WARNING, "Cannot not handle circular references");
55905587
return false;
55915588
}
55925589
GC_TRY_PROTECT_RECURSION(vars);
5593-
ZEND_HASH_FOREACH_KEY_VAL(vars, idx, key, entry) {
5590+
ZEND_HASH_FOREACH_STR_KEY_VAL(vars, key, entry) {
55945591
ZVAL_DEREF(entry);
55955592
if (key) {
55965593
if (!mb_check_str_encoding(key, encoding)) {

0 commit comments

Comments
 (0)