Skip to content

Commit c3a5b98

Browse files
authored
Add zend_hash_get_current_pos_ex() (#14770)
1 parent b229f18 commit c3a5b98

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

UPGRADING.INTERNALS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ PHP 8.4 INTERNALS UPGRADE NOTES
9292
* zend_is_true now returns bool rather than int. Note that on PHP 8 this has
9393
always returned 0 or 1, so conversion should be trivial.
9494

95+
* Added zend_hash_get_current_pos_ex() variant of zend_hash_get_current_pos().
96+
9597
========================
9698
2. Build system changes
9799
========================

Zend/zend_hash.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos(const HashTable *h
514514
return _zend_hash_get_current_pos(ht);
515515
}
516516

517+
ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos_ex(const HashTable *ht, HashPosition pos)
518+
{
519+
return _zend_hash_get_valid_pos(ht, pos);
520+
}
521+
517522
static void zend_hash_remove_iterator_copies(uint32_t idx) {
518523
HashTableIterator *iterators = EG(ht_iterators);
519524

Zend/zend_hash.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ static zend_always_inline bool zend_hash_index_exists(const HashTable *ht, zend_
245245
}
246246

247247
/* traversing */
248+
ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos_ex(const HashTable *ht, HashPosition pos);
248249
ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos(const HashTable *ht);
249250

250251
ZEND_API zend_result ZEND_FASTCALL zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);

0 commit comments

Comments
 (0)