On 27/02/2024 17:49, Erick de Azevedo Lima wrote:
> It sounds like most people are just really, really pissed off by an implicit variable

I think that it could be good to follow the PHP way to mark the "magic" stuff, which is putting leading underscores on the magic stuff.


I think that might help; I also think that even if the RFC offers a choice to the list, the final implementation should not offer choice to users.

I think part of what put people off with the original wording was that it implied $field was an alias for $this->propertyName, but the alias was "preferred". The reality is that we have a new thing that we need a name/syntax for, and $field or $this->propertyName are possible options.

To avoid another lengthy e-mail, I've put together some alternative RFC wording. The main idea is to switch the framing from "hooks on top of properties, which may be virtual" to "hooked properties which are virtual by default, but may access a special backing field".

As noted in the introduction this is *not* intended as a counter-proposal or critique, just somewhere to collate my thoughts and suggestions: https://wiki.php.net/rfc/property-hooks/imsop-suggestion

Regards,

--
Rowan Tommins
[IMSoP]

Reply via email to