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

2021-06-30 Thread André Rømcke
> Yes, this is a possible alternative interpretation of the readonly concept. > The current proposal is closer to how Java final variables work, which never > allow reassignment, while your suggestion is closer to C# readonly, which > does allow reassigning in the constructor. > > I went with

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

2021-06-30 Thread Nikita Popov
On Wed, Jun 30, 2021 at 10:36 AM André Rømcke wrote: > > > It's okay to vote against this if cloning is a deal breaker. In that > case > > > I'll probably either work on cloning before re-proposing this, or > pivot to > > > asymmetric visibility -- it's not my first preference, but it may be >

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

2021-06-30 Thread André Rømcke
> > It's okay to vote against this if cloning is a deal breaker. In that case > > I'll probably either work on cloning before re-proposing this, or pivot to > > asymmetric visibility -- it's not my first preference, but it may be the > > more pragmatic choice. Cloning is definitely the weak point

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

2021-06-29 Thread Larry Garfield
On Tue, Jun 29, 2021, at 8:08 AM, Nikita Popov wrote: > > You might not like the boilerplate, but that just works. > > > > Can this be considered Nikita? > > > > Well, it's a nifty hack :) I don't think this is the solution we want to > encourage though. It requires you pass extra information

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

2021-06-29 Thread Pierre
Le 29/06/2021 à 15:08, Nikita Popov a écrit : Well, it's a nifty hack :) I don't think this is the solution we want to encourage though. It requires you pass extra information through a side-channel -- I think I'd rather not use readonly than write that code. Continuing along the same line, one

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

2021-06-29 Thread Nikita Popov
On Tue, Jun 29, 2021 at 9:14 AM Nicolas Grekas wrote: > Le lun. 28 juin 2021 à 18:22, Larry Garfield a >>> écrit : >>> On Mon, Jun 28, 2021, at 11:17 AM, Nicolas Grekas wrote: > > > I'd like to open the discussion on readonly properties: > > >

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

2021-06-29 Thread Nicolas Grekas
> > Le lun. 28 juin 2021 à 18:22, Larry Garfield a >> écrit : >> >>> On Mon, Jun 28, 2021, at 11:17 AM, Nicolas Grekas wrote: >>> > > > I'd like to open the discussion on readonly properties: >>> > > > https://wiki.php.net/rfc/readonly_properties_v2 >>> > > > >>> > > > This proposal is similar to

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

2021-06-28 Thread Larry Garfield
On Mon, Jun 28, 2021, at 1:36 PM, Nicolas Grekas wrote: > >> > Actually, we talked off the list about a way to possibly make this work > >> > with __clone(): > >> > > >> > We could allow __clone to have one argument, the object being cloned. > >> And > >> > when the signature declares this

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

2021-06-28 Thread Nicolas Grekas
Le lun. 28 juin 2021 à 20:30, Nicolas Grekas a écrit : > > > Le lun. 28 juin 2021 à 18:22, Larry Garfield a > écrit : > >> On Mon, Jun 28, 2021, at 11:17 AM, Nicolas Grekas wrote: >> > > > I'd like to open the discussion on readonly properties: >> > > >

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

2021-06-28 Thread Nicolas Grekas
Le lun. 28 juin 2021 à 18:22, Larry Garfield a écrit : > On Mon, Jun 28, 2021, at 11:17 AM, Nicolas Grekas wrote: > > > > I'd like to open the discussion on readonly properties: > > > > https://wiki.php.net/rfc/readonly_properties_v2 > > > > > > > > This proposal is similar to the > > > >

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

2021-06-28 Thread Larry Garfield
On Mon, Jun 28, 2021, at 11:17 AM, Nicolas Grekas wrote: > > > I'd like to open the discussion on readonly properties: > > > https://wiki.php.net/rfc/readonly_properties_v2 > > > > > > This proposal is similar to the > > > https://wiki.php.net/rfc/write_once_properties RFC that has been > >

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

2021-06-28 Thread Nicolas Grekas
> > I'd like to open the discussion on readonly properties: > > https://wiki.php.net/rfc/readonly_properties_v2 > > > > This proposal is similar to the > > https://wiki.php.net/rfc/write_once_properties RFC that has been > declined > > previously. One significant difference is that the new RFC

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

2021-06-28 Thread Nikita Popov
On Fri, Jun 4, 2021 at 5:19 PM Nikita Popov wrote: > Hi internals, > > I'd like to open the discussion on readonly properties: > https://wiki.php.net/rfc/readonly_properties_v2 > > This proposal is similar to the > https://wiki.php.net/rfc/write_once_properties RFC that has been declined >