rfc:object_keys_in_arrays

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
rfc:object_keys_in_arrays [2021/01/08 13:13] nikicrfc:object_keys_in_arrays [2021/01/08 15:07] nikic
Line 168: Line 168:
  
 The new macros can be polyfilled for older PHP versions, which is also why this introduces new macros rather than modifying existing ones. The new macros can be polyfilled for older PHP versions, which is also why this introduces new macros rather than modifying existing ones.
 +
 +The ''zend_hash_get_current_key(_ex)'' function is removed. Instead, one of the following two functions can be used (where the former already exists on older PHP versions, while the latter is more efficient):
 +
 +<code c>
 +/* This function populates `key` with a copy of the key, or a null zval if exhausted. */
 +ZEND_API void  ZEND_FASTCALL zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos);
 +
 +/* This function returns the key zval directly, or NULL if exhausted. */
 +ZEND_API zval* ZEND_FASTCALL zend_hash_get_current_zkey(const HashTable *ht, HashPosition *pos); 
 +</code>
 +
 +The ''zend_hash_get_current_key_type(_ex)'' function and the ''HASH_KEY_IS_LONG'', ''HASH_KEY_IS_STRING'' and ''HASH_KEY_NON_EXISTENT'' constants are also removed, and should be replaced by taking the type of the key zval.
  
 ===== Vote ===== ===== Vote =====
rfc/object_keys_in_arrays.txt · Last modified: 2021/01/11 14:22 by nikic