Hey all, > On 8. Jun 2025, at 11:16, Larry Garfield <la...@garfieldtech.com> wrote: > > As Nick has graciously provided an implementation, we would like to open > discussion on this very small RFC to allow `readonly` on backed properties > even if they have a hook defined. > > https://wiki.php.net/rfc/readonly_hooks > > -- > Larry Garfield > la...@garfieldtech.com
To not get this buried in individual answers to others: I came up with two alternative implementations which cache the computed `get` hook value. One leverages separate cache properties, the other writes directly to the backing store. Links to the alternative branches can be found in the description of the original PR. https://github.com/php/php-src/pull/18757 I believe that these are fair solutions to address the concerns that came up in the discussion, and I hope people will agree. Cheers, Nick