rfc:object_keys_in_arrays
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:object_keys_in_arrays [2021/01/08 10:22] – nikic | rfc:object_keys_in_arrays [2021/01/08 14:44] – nikic | ||
---|---|---|---|
Line 54: | Line 54: | ||
While an extension to support custom object hashing and comparison overloads may be possible in the future, it is very much out of scope of this proposal. '' | While an extension to support custom object hashing and comparison overloads may be possible in the future, it is very much out of scope of this proposal. '' | ||
+ | |||
+ | ==== Impact on standard library functions ==== | ||
+ | |||
+ | For most standard library functions the behavior of object keys is straightforward. E.g. '' | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
Line 160: | 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 '' | ||
+ | |||
+ | <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); | ||
+ | </ | ||
===== Vote ===== | ===== Vote ===== |
rfc/object_keys_in_arrays.txt · Last modified: 2021/01/11 14:22 by nikic