rfc:class-like_primitive_types
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:class-like_primitive_types [2016/12/19 22:01] – ajf | rfc:class-like_primitive_types [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 53: | Line 53: | ||
* < | * < | ||
* < | * < | ||
- | * < | + | * < |
==== Features not extended to primitives ==== | ==== Features not extended to primitives ==== | ||
Line 153: | Line 153: | ||
In JavaScript, '' | In JavaScript, '' | ||
- | This RFC currently chooses to omit null from support by most of these features. | + | This RFC currently chooses to omit null from the extension |
==== Should resource be supported? ==== | ==== Should resource be supported? ==== | ||
Resource is a legacy type that could be wholly replaced by objects in future. Extending these features to this type would be further entrenching it and contrary to the goal of its eventual removal. | Resource is a legacy type that could be wholly replaced by objects in future. Extending these features to this type would be further entrenching it and contrary to the goal of its eventual removal. | ||
+ | |||
+ | In particular, < | ||
===== Unaffected PHP Functionality ===== | ===== Unaffected PHP Functionality ===== | ||
Line 167: | Line 169: | ||
The extension of these features to the other primitive types opens up a number of future possibilities. | The extension of these features to the other primitive types opens up a number of future possibilities. | ||
- | One of these would be [[http:// | + | One of these would be [[http:// |
+ | |||
+ | It also means we can easily introduce new superclasses of our other primitive types. For example, a new < | ||
+ | |||
+ | Likewise, we could introduce new interfaces implemented by our other primitive types. One potential use for this is operator overloading. PHP could add an interface for number-like classes, which when implemented, | ||
- | It also means we can easily introduce new superclasses of our other primitive types. For example, a new <php>\Number</ | + | <php>instanceof</ |
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== |
rfc/class-like_primitive_types.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1