On 04-05-2021 12:33, Nikita Popov wrote: > Hi internals, > > I'd like to present an RFC for property accessors: > https://wiki.php.net/rfc/property_accessors
Wow. Thanks for all the effort you put into this! > While I put a lot of effort into both the proposal and the implementation, > I've grown increasingly uncertain that this is the right direction for us > to take. The proposal turned out to be significantly more complex than I > originally anticipated (despite reducing the scope to only "get" and "set" > accessors), and I'm sure there are some interactions I still haven't > accounted for. I'm not convinced the value justifies the complexity. I think property accessors could be a huge enhancement to the language and may significantly change the look of PHP code in the long run. To fully appreciate what property accessors could do to PHP it may be useful to compare PHP to other languages that already have property accessors. In my case, I use both PHP and Python. By comparing how I use these two languages I can attempt to project how property accessors may change the way I use PHP. When I compare how I design APIs in PHP and Python, I expect to be exposing more public properties and fewer class methods. That will result in less library code. When I compare how I use APIs in PHP versus Python, I expect to be doing more direct property accessing and less method calling. That will make code look less cluttered in general. The complexity may very well be worth it when fully considering the impact it could have on how the language is used. Regards, Dik Takken -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php