return iter->pos;
}
+ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array)
+{
+ HashTable *ht = Z_ARRVAL_P(array);
+ HashTableIterator *iter = EG(ht_iterators) + idx;
+
+ ZEND_ASSERT(idx != (uint32_t)-1);
+ if (iter->pos == HT_INVALID_IDX) {
+ return HT_INVALID_IDX;
+ } else if (UNEXPECTED(iter->ht != ht)) {
+ if (EXPECTED(iter->ht) && EXPECTED(iter->ht != HT_POISONED_PTR)
+ && EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
+ iter->ht->u.v.nIteratorsCount--;
+ }
+ SEPARATE_ARRAY(array);
+ ht = Z_ARRVAL_P(array);
+ if (EXPECTED(ht->u.v.nIteratorsCount != 255)) {
+ ht->u.v.nIteratorsCount++;
+ }
+ iter->ht = ht;
+ iter->pos = ht->nInternalPointer;
+ }
+ return iter->pos;
+}
+
ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx)
{
HashTableIterator *iter = EG(ht_iterators) + idx;
ZEND_API uint32_t ZEND_FASTCALL zend_hash_iterator_add(HashTable *ht, HashPosition pos);
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTable *ht);
+ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array);
ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx);
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterators_lower_pos(HashTable *ht, HashPosition start);
ZEND_API void ZEND_FASTCALL _zend_hash_iterators_update(HashTable *ht, HashPosition from, HashPosition to);
ZVAL_DEREF(array);
if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) {
+ pos = zend_hash_iterator_pos_ex(Z_FE_ITER_P(EX_VAR(opline->op1.var)), array);
fe_ht = Z_ARRVAL_P(array);
- pos = zend_hash_iterator_pos(Z_FE_ITER_P(EX_VAR(opline->op1.var)), fe_ht);
p = fe_ht->arData + pos;
while (1) {
if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
ZVAL_DEREF(array);
if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) {
+ pos = zend_hash_iterator_pos_ex(Z_FE_ITER_P(EX_VAR(opline->op1.var)), array);
fe_ht = Z_ARRVAL_P(array);
- pos = zend_hash_iterator_pos(Z_FE_ITER_P(EX_VAR(opline->op1.var)), fe_ht);
p = fe_ht->arData + pos;
while (1) {
if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {