Skip to content

Add zend_hash_get_current_pos_ex() #14770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ PHP 8.4 INTERNALS UPGRADE NOTES
* zend_is_true now returns bool rather than int. Note that on PHP 8 this has
always returned 0 or 1, so conversion should be trivial.

* Added zend_hash_get_current_pos_ex() variant of zend_hash_get_current_pos().

========================
2. Build system changes
========================
Expand Down
5 changes: 5 additions & 0 deletions Zend/zend_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,11 @@ ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos(const HashTable *h
return _zend_hash_get_current_pos(ht);
}

ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos_ex(const HashTable *ht, HashPosition pos)
{
return _zend_hash_get_valid_pos(ht, pos);
}

static void zend_hash_remove_iterator_copies(uint32_t idx) {
HashTableIterator *iterators = EG(ht_iterators);

Expand Down
1 change: 1 addition & 0 deletions Zend/zend_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ static zend_always_inline bool zend_hash_index_exists(const HashTable *ht, zend_
}

/* traversing */
ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos_ex(const HashTable *ht, HashPosition pos);
ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos(const HashTable *ht);

ZEND_API zend_result ZEND_FASTCALL zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
Expand Down
Loading