rfc:array_unpacking_string_keys
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:array_unpacking_string_keys [2021/01/07 11:31] – nikic | rfc:array_unpacking_string_keys [2021/02/09 09:55] (current) – nikic | ||
---|---|---|---|
Line 2: | Line 2: | ||
* Date: 2021-01-07 | * Date: 2021-01-07 | ||
* Author: Nikita Popov < | * Author: Nikita Popov < | ||
- | * Status: | + | * Status: |
* Proposed Version: PHP 8.1 | * Proposed Version: PHP 8.1 | ||
* Implementation: | * Implementation: | ||
Line 43: | Line 43: | ||
Keys that are neither integers nor strings continue to throw a '' | Keys that are neither integers nor strings continue to throw a '' | ||
+ | |||
+ | Traversables may also generate integral string keys, which are canonicalized to integer keys by arrays. Such keys will be treated the same way as integer keys and renumbered: | ||
+ | |||
+ | <PHP> | ||
+ | function gen() { | ||
+ | yield " | ||
+ | yield " | ||
+ | yield " | ||
+ | } | ||
+ | var_dump([...gen()]); | ||
+ | </ | ||
===== Alternatives ===== | ===== Alternatives ===== | ||
Line 105: | Line 116: | ||
===== Vote ===== | ===== Vote ===== | ||
- | Yes/No. | + | Voting started on 2021-01-25 and ended on 2021-02-08. |
+ | |||
+ | <doodle title=" | ||
+ | | ||
+ | | ||
+ | </ | ||
rfc/array_unpacking_string_keys.1610019112.txt.gz · Last modified: 2021/01/07 11:31 by nikic