rfc:typehint_array_desctructuring

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
rfc:typehint_array_desctructuring [2020/04/16 10:38] – Added union type example wol-softrfc: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://wiki.php.net/rfc/scalar_type_hints_v5). This includes a controllability of the behaviour using the strict_types directive:+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://wiki.php.net/rfc/scalar_type_hints_v5). This includes a controllability of the behaviour using the strict_types directive. Type checks will be executed during the assignment of the variables when resolving the array destructuring expression. The variables will **not** keep any information concerning the check (they will not behave like typed variables afterwards, just like type checks in method signatures).
  
 <code php> <code php>
rfc/typehint_array_desctructuring.txt · Last modified: 2020/04/16 13:56 by wol-soft