Skip to content
#externals

Search

81 results · page 1 of 5

  1. 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 …

  2. 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 …

  3. [email protected] ·

    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 …

  4. 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 …

  5. [email protected] ·

    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 …

  6. 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 …

  7. [email protected] ·

    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 …

  8. 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 …

  9. 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 …

  10. 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 …

  11. 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 …

  12. [email protected] ·

    … 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 …

  13. 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 …

  14. [email protected] ·

    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 …

  15. 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 …

  16. 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 …

  17. 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 …

  18. 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 …

  19. 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 …

  20. 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 …