File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 9
9
- Core:
10
10
. Fixed bug #79778 (Assertion failure if dumping closure with unresolved
11
11
static variable). (Nikita)
12
+ . Fixed bug #79792 (HT iterators not removed if empty array is destroyed).
13
+ (Nikita)
12
14
13
15
- COM:
14
16
. Fixed bug #63208 (BSTR to PHP string conversion not binary safe). (cmb)
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #79792: HT iterators not removed if empty array is destroyed
3
+ --FILE--
4
+ <?php
5
+ $ a = [42 ];
6
+ foreach ($ a as &$ c ) {
7
+ // Make the array empty.
8
+ unset($ a [0 ]);
9
+ // Destroy the array.
10
+ $ a = null ;
11
+ }
12
+ ?>
13
+ ===DONE===
14
+ --EXPECTF--
15
+ Warning: Invalid argument supplied for foreach() in %s on line %d
16
+ ===DONE===
Original file line number Diff line number Diff line change @@ -1504,11 +1504,11 @@ ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht)
1504
1504
}
1505
1505
} while (++ p != end );
1506
1506
}
1507
- zend_hash_iterators_remove (ht );
1508
- SET_INCONSISTENT (HT_DESTROYED );
1509
1507
} else if (EXPECTED (!(HT_FLAGS (ht ) & HASH_FLAG_INITIALIZED ))) {
1510
1508
goto free_ht ;
1511
1509
}
1510
+ zend_hash_iterators_remove (ht );
1511
+ SET_INCONSISTENT (HT_DESTROYED );
1512
1512
efree (HT_GET_DATA_ADDR (ht ));
1513
1513
free_ht :
1514
1514
FREE_HASHTABLE (ht );
You can’t perform that action at this time.
0 commit comments