Search
81 results · page 1 of 5
-
Nick Sdot ·
Hey everyone, I just opened voting on the "Readonly Property Defaults" RFC. Wiki Page: https://wiki.php.net/rfc/readonly_property_defaults Discussion Thread: https://news-web.php.net/php.internals/131760 The RFC has one primary vote requiring a …
-
Nick Sdot ·
Hey Internals, I would like to present a tiny, five-line-removal RFC allowing default values on readonly properties. Allowing default values on readonly class properties enables creating a strict contract for implementation property values that will not change …
-
Hi Got it. Yes, no specialities. In case you deem it necessary I could add an assertion to an existing test. Something like: class Foo { public function __construct( public readonly string $a = 'bar') {} } var_dump(new ReflectionClass(Foo::class)->getProperty …
-
Nick Sdot ·
… deem it necessary I could add an assertion to an existing test. Something like: class Foo { public function __construct( public readonly string $a = 'bar') {} } var_dump(new ReflectionClass(Foo::class)->getProperty('a')->hasDefaultValue()) // bool(false) To me it feels just …
-
Hi Not exactly sure what you would like me to spell me out. It's indeed different things. I made a tiny addition to the non-goals. Let me know if that's enough or if you had something else …
-
Nick Sdot ·
Hey Tim, Hi There is two options here: The non-hooked unserialization path must also error out when trying to unserialize into a readonly property with a default value. __unserialize() must be able to unserialize into a readonly property with …
-
Hi There is two options here: The non-hooked unserialization path must also error out when trying to unserialize into a readonly property with a default value. __unserialize() must be able to unserialize into a readonly property with a default …
-
Nick Sdot ·
… attempt) Hey Larry, Hey Internals, I would like to present a tiny, five-line-removal RFC allowing default values on readonly properties. Allowing default values on readonly class properties enables creating a strict contract for implementation property values that will …
-
Nick Sdot ·
Hey Larry, Hey Internals, I would like to present a tiny, five-line-removal RFC allowing default values on readonly properties. Allowing default values on readonly class properties enables creating a strict contract for implementation property values that will not …
-
Larry Garfield ·
Hey Internals, I would like to present a tiny, five-line-removal RFC allowing default values on readonly properties. Allowing default values on readonly class properties enables creating a strict contract for implementation property values that will not change …
-
Nick Sdot ·
… situation we do not yet have so far: As far as I can tell there is no way for a readonly property to be preinitialized when unserialization happens. This means that it is not not observable that the non-hooked …
-
… situation we do not yet have so far: As far as I can tell there is no way for a readonly property to be preinitialized when unserialization happens. This means that it is not not observable that the non-hooked …
-
Nick Sdot ·
Hey Tim, thanks for the feedback! Hi I would like to present a tiny, five-line-removal RFC allowing default values on readonly properties. Allowing default values on readonly class properties enables creating a strict contract for implementation property values …
-
Hi I would like to present a tiny, five-line-removal RFC allowing default values on readonly properties. Allowing default values on readonly class properties enables creating a strict contract for implementation property values that will not change at runtime …
-
Nick Sdot ·
Hey Internals, I would like to present a tiny, five-line-removal RFC allowing default values on readonly properties. Allowing default values on readonly class properties enables creating a strict contract for implementation property values that will not change at …
-
Rowan Tommins [IMSoP] ·
final readonly class Dog( string $name, )extends Animal { parent::__construct($name); }=> { // class body } The above: does NOT have a parent constructor shortcut call -> extends Animal DOES allow parent constructor call in primary constructor body behaves exactly (!) as a conventional …
-
Nick Sdot ·
final readonly class Foo(Collection|array $value) implements Bar { $this->items = $value instanceof Collection ? $value : new Collection($value); } => { public Collection $items; // class body private Collection $items } final readonly class Foo implements Bar { public Collection $items; public function __construct(Collection …
-
Larry Garfield ·
final readonly class Foo(Collection|array $value) implements Bar { $this->items = $value instanceof Collection ? $value : new Collection($value); } => { public Collection $items; // class body private Collection $items } final readonly class Foo implements Bar { public Collection $items; public function __construct(Collection …
-
Proposal Struct Data Types
Rowan Collins ·
Readonly properties: Without requiring an entire object to be immutable, we can add support for readonly properties. This may be either a standalone feature, or part of / based on a more general property accessors proposal. This is reasonable, but …
-
Holly Schilling ·
For one, I read only internals and github. I keep seeing "we talked on discord" but there is no reference whatsoever to a php.nethttp://php.net/'s discord anywhere i searched for. so maybe I would suggest to be …