On 08-05-2023 23:38, Larry Garfield wrote:
Ilija Tovilo and I would like to offer another RFC for your consideration.  
It's been a while in coming, and we've evolved the design quite a bit just in 
the last week so if you saw an earlier draft of it in the past few months, I 
would encourage you to read it over again to make sure we're all on the same 
page.  I'm actually pretty happy with where it ended up, even if it's not the 
original design.  This approach eliminates several hard-to-implement edge cases 
while still providing a lot of functionality in one package.

https://wiki.php.net/rfc/property-hooks


Thanks for all the work that has gone into this. It looks great. The ability to add properties to interfaces is also really nice.

One thing that concerns me is the following: "the use of [] on any property (with or without a key) will result in a runtime error being thrown". While the intent of the RFC is to allow adding hooks without causing BC breaks, this detail does introduce a BC break. And the break may get introduced without realizing it.

I'm not sure which solution would be best here: Just accept the limitations for arrays (same as for list properties in Python) or forbid the use of hooks for array properties? I'm leaning towards accepting the limitations, like Python does. Then it is up to the API designer to decide if a property hook is the right tool for the job or not.

Regards,
Dik

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to