rfc:class-like_primitive_types
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
rfc:class-like_primitive_types [2016/12/19 21:23] – plural ajf | rfc:class-like_primitive_types [2016/12/19 21:52] – ajf | ||
---|---|---|---|
Line 62: | Line 62: | ||
* < | * < | ||
* < | * < | ||
+ | * < | ||
**FIXME:** What do I do about reflection? | **FIXME:** What do I do about reflection? | ||
+ | |||
+ | === Serializable and resources === | ||
+ | |||
+ | The resource type will not implement the < | ||
==== Primitive type class hierarchy ==== | ==== Primitive type class hierarchy ==== | ||
Line 70: | Line 75: | ||
<code php> | <code php> | ||
- | final class null implements Serializable, | + | /* There is no shadow |
- | public function __toString() { /* ... */ } | + | |
- | public function serialize() { /* ... */ } | + | |
- | public function unserialize($serialized) { /* ... */ } | + | |
- | public function jsonSerialize() { /* ... */ } | + | |
- | } | + | |
final class bool implements Serializable, | final class bool implements Serializable, | ||
public function __toString() { /* ... */ } | public function __toString() { /* ... */ } | ||
Line 110: | Line 111: | ||
} | } | ||
} | } | ||
- | final class resource | + | final class resource { |
public function __toString() { /* ... */ } | public function __toString() { /* ... */ } | ||
- | public function serialize() { /* ... */ } | ||
- | public function unserialize($serialized) { /* ... */ } | ||
} | } | ||
</ | </ | ||
Line 132: | Line 131: | ||
==== To Existing Extensions ==== | ==== To Existing Extensions ==== | ||
- | This does not impact existing extensions, their view of the world is unchanged and the other primitive types are still primitives. | + | This does not impact existing extensions: their view of the world is unchanged and the primitive types other than objects |
**FIXME:** Reflection. | **FIXME:** Reflection. | ||
Line 143: | Line 142: | ||
**FIXME:** Reflection, Opcache. | **FIXME:** Reflection, Opcache. | ||
+ | |||
+ | ==== Should null have a shadow class? ==== | ||
+ | |||
+ | Or in other words, should these features be extended to < | ||
+ | |||
+ | < | ||
+ | |||
+ | Would methods like < | ||
+ | |||
+ | In JavaScript, '' | ||
+ | |||
+ | This RFC currently chooses to omit null from support by most of these features. | ||
+ | |||
+ | ==== Should resource have a shadow class? ==== | ||
+ | |||
+ | 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 removal. | ||
===== Unaffected PHP Functionality ===== | ===== Unaffected PHP Functionality ===== |
rfc/class-like_primitive_types.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1