@@ -10,6 +10,8 @@ UPGRADE NOTES - PHP X.Y
1010 e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
1111 f. empty strings are interned
1212 g. Additional str_* APIs
13+ h. Addition of zend_hash_reindex
14+ i. Addition of zend_hash_splice
1315
14162. Build system changes
1517 a. Unix build system changes
@@ -137,6 +139,48 @@ UPGRADE NOTES - PHP X.Y
137139 str_hash(str, len) - INTERNED_HASH(str) if interned,
138140 zend_hash_func(str, len+1) otherwise
139141
142+ h. Addition of zend_hash_reindex
143+
144+ A zend_hash_reindex() function with the following prototype has been added:
145+
146+ void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
147+
148+ If only_integer_keys==0, this function will change all keys to be continuous,
149+ zero-based integers in hash order. If only_integer_keys==1 the same will be
150+ done only for keys that were already integers previously, while leaving
151+ string keys alone.
152+
153+ i. Addition of zend_hash_splice
154+
155+ A zend_hash_splice() macro with the following prototype has been added:
156+
157+ void zend_hash_splice(
158+ HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor,
159+ uint offset, uint length,
160+ void **list, uint list_count, HashTable *removed
161+ );
162+
163+ This function performs an in-place splice operation on a hashtable:
164+
165+ The elements between offset and offset+length are removed and the elements in
166+ list[list_count] are inserted in their place. The removed elements can be
167+ optionally collected into a hashtable.
168+
169+ This operation reindexes the hashtable, i.e. integer keys will be zero-based
170+ and sequential, while string keys stay intact. The same applies to the
171+ elements inserted into the removed HT.
172+
173+ As a side-effect of this addition the signature of the php_splice() function
174+ changed:
175+
176+ void php_splice(
177+ HashTable *ht, zend_uint offset, zend_uint length,
178+ zval ***list, zend_uint list_count, HashTable *removed TSRMLS_DC
179+ )
180+
181+ This function now directly forwards to zend_hash_splice(), resets the
182+ IAP of ht (for compatibility with the previous implementation) and resets
183+ CVs if the passed hashtable is the global symbol table.
140184
141185========================
1421862. Build system changes
0 commit comments