rfc:php8

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
rfc:php8 [2018/04/29 18:07] – Add link to covariance/contravariance WIP RFC levimrfc:php8 [2018/08/12 00:16] (current) – Embrace functions and method in #75958 carusogabriel
Line 5: Line 5:
  
 ===== Ideas and Proposals ===== ===== Ideas and Proposals =====
 +
 +Here are some ideas that have backwards compatibility implications:
 +
   * Unify behavior of userland and internal functions.   * Unify behavior of userland and internal functions.
     * In particular when internal functions fail to parse argument types correctly they fail by returning null. Userland functions throw a TypeError.     * In particular when internal functions fail to parse argument types correctly they fail by returning null. Userland functions throw a TypeError.
Line 10: Line 13:
     * **[[rfc:php8:merge_member_symbol_tables|Merge Class Member Symbol Tables]]**     * **[[rfc:php8:merge_member_symbol_tables|Merge Class Member Symbol Tables]]**
     * **[[rfc:php8:merge_symbol_tables|Merge Constant, Function, and Class Symbol Tables]]**     * **[[rfc:php8:merge_symbol_tables|Merge Constant, Function, and Class Symbol Tables]]**
-  * [[rfc:covariant-returns-and-contravariant-parameters]] Add parameter contravariance and return type covariance. This will probably change when autoloads are triggered. Additionally we probably want to reserve new types related to variance such as ''mixed''. New types in the global namespace are technically reserved already but in practice it would have a small BC impact. 
   * Extend ''instanceof'' to work with non-classes and add new functions for checking type and subtype relationships  e.g. ''($int instanceof int)'' ''is_type_of(1, 'int')'' ''is_subtype_of('array', 'iterable')''.   * Extend ''instanceof'' to work with non-classes and add new functions for checking type and subtype relationships  e.g. ''($int instanceof int)'' ''is_type_of(1, 'int')'' ''is_subtype_of('array', 'iterable')''.
   * Unify class and abstract type error behaviors when method incompatibilities exists; see https://3v4l.org/hamQi   * Unify class and abstract type error behaviors when method incompatibilities exists; see https://3v4l.org/hamQi
 +  * Remove always ''true'' return when isn't helpful for some functions and methods; see [[https://bugs.php.net/bug.php?id=75958|#75958]].
 +
 +Here are some feature ideas:
 +
 +  * [[rfc:covariant-returns-and-contravariant-parameters]] Add parameter contravariance and return type covariance. This will probably change when autoloads are triggered. Additionally we probably want to reserve new types related to variance such as ''mixed''. New types in the global namespace are technically reserved already but in practice it would have a small BC impact.
 +  * JIT (link?)
 +  * FFI (link?)
rfc/php8.1525025221.txt.gz · Last modified: 2018/04/29 18:07 by levim