Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-05 Thread Nikita Popov
On Mon, Jul 5, 2021 at 1:56 PM Patrick ALLAERT wrote: > Le jeu. 1 juil. 2021 à 12:23, Nikita Popov a > écrit : > >> Hi internals, >> >> I have opened voting on https://wiki.php.net/rfc/readonly_properties_v2. >> The vote closes 2021-07-15. >> >> See https://externals.io/message/114729 for the

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-05 Thread Patrick ALLAERT
Le jeu. 1 juil. 2021 à 12:23, Nikita Popov a écrit : > Hi internals, > > I have opened voting on https://wiki.php.net/rfc/readonly_properties_v2. > The vote closes 2021-07-15. > > See https://externals.io/message/114729 for the discussion thread on this > proposal. I think a decent tl;dr is that

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-05 Thread Patrick ALLAERT
Le jeu. 1 juil. 2021 à 12:23, Nikita Popov a écrit : > Hi internals, > > I have opened voting on https://wiki.php.net/rfc/readonly_properties_v2. > The vote closes 2021-07-15. > > See https://externals.io/message/114729 for the discussion thread on this > proposal. I think a decent tl;dr is that

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-03 Thread Ilija Tovilo
Hi > Thanks for the RFC. A quick question, is it allowed to assign to a readonly > property multiple times within the construction method? Sorry for it if > someone has asked this before, because actually I didn't go through the whole > thread, only did a quick search on it. Thanks. No,

RE: [PHP-DEV] [VOTE] Readonly properties

2021-07-02 Thread CHU Zhaowei
Hi Nikita, Thanks for the RFC. A quick question, is it allowed to assign to a readonly property multiple times within the construction method? Sorry for it if someone has asked this before, because actually I didn't go through the whole thread, only did a quick search on it. Thanks. Regards,

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Marco Pivetta
On Thu, Jul 1, 2021 at 6:06 PM Deleu wrote: > I honestly don't understand not wanting this just because of lack of > cloning. > Agreed: improvements on cloning ergonomics can come later. Also, the problem goes away the smaller your state becomes: this may encourage some design towards more

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Pierre
Le 01/07/2021 à 17:25, Larry Garfield a écrit : The most famous use case right now for with-er objects is PSR-7, which is where the naming convention comes from. I cannot say how widely used it is outside of FIG-inspired value objects, but I am pretty sure it is used. As long as you implement

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Deleu
On Thu, Jul 1, 2021 at 5:25 PM Larry Garfield wrote: > On Thu, Jul 1, 2021, at 9:49 AM, Pierre wrote: > > Le 01/07/2021 à 16:38, Nicolas Grekas a écrit : > > > Hi NIkita, > > > > > > I voted against the proposal because it doesn't work with cloning at > all. > > > > > > Cloning is a critical

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Larry Garfield
On Thu, Jul 1, 2021, at 9:49 AM, Pierre wrote: > Le 01/07/2021 à 16:38, Nicolas Grekas a écrit : > > Hi NIkita, > > > > I voted against the proposal because it doesn't work with cloning at all. > > > > Cloning is a critical feature of stateful objects, and we should solve it > > the same version

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Pierre
Le 01/07/2021 à 16:38, Nicolas Grekas a écrit : Hi NIkita, I voted against the proposal because it doesn't work with cloning at all. Cloning is a critical feature of stateful objects, and we should solve it the same version that introduces readonly IMHO. If we figure out that we can't agree

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Nicolas Grekas
Le jeu. 1 juil. 2021 à 12:23, Nikita Popov a écrit : > Hi internals, > > I have opened voting on https://wiki.php.net/rfc/readonly_properties_v2. > The vote closes 2021-07-15. > > See https://externals.io/message/114729 for the discussion thread on this > proposal. I think a decent tl;dr is that

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Hamza Ahmad
Hi Nikita, It is going to be the second contribution from you regarding OOP. However, this proposal, as you have mentioned, has some issues with cloning. What if you would have opened voting after fixing this? Or, your mood is to get it passed and then fix it before final release of 8.1? Thank

[PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Nikita Popov
Hi internals, I have opened voting on https://wiki.php.net/rfc/readonly_properties_v2. The vote closes 2021-07-15. See https://externals.io/message/114729 for the discussion thread on this proposal. I think a decent tl;dr is that readonly properties as proposed do not play well with clone-based