rfc:typehint_array_desctructuring
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:typehint_array_desctructuring [2020/04/16 10:00] – wol-soft | rfc:typehint_array_desctructuring [2020/04/16 11:43] – wol-soft | ||
---|---|---|---|
Line 19: | Line 19: | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | This proposal adds a new syntax to add type hints to array destructuring expressions. The type hints behave identically to the type hints processed for function calls (compare https:// | + | This proposal adds a new syntax to add type hints to array destructuring expressions. The type hints behave identically to the type hints processed for function calls (compare https:// |
<code php> | <code php> | ||
Line 69: | Line 69: | ||
// ... | // ... | ||
} | } | ||
+ | </ | ||
+ | |||
+ | The for PHP 8.0 accepted union types (https:// | ||
+ | |||
+ | <code php> | ||
+ | [int|float $number, string $description] = [1.5, "One point five"] | ||
</ | </ | ||
rfc/typehint_array_desctructuring.txt · Last modified: 2020/04/16 13:56 by wol-soft