Re: [PHP-DEV][RFC] Deprecate type juggling to and from bool type within the function type juggling context

2025-07-11 Thread Theodore Brown
On Fri, July 11, 2025 at 05:00 G. P. Banyard wrote: >> On Monday, 30 June 2025 at 10:26, Nicolas Grekas wrote: >> ... >> The latter, cast-from-bool, I think they're all useful improvements. While >> most likely harmless in all the specific >> cases of the PR, doing e.g. an strpos() on false f

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-11 Thread Claude Pache
> Le 11 juil. 2025 à 11:38, Nick a écrit : > > > I am afraid here I do have a strong opinion. Please remember my very first > mail before discussion [1]. > While for Larry the main reason for `readonly` hooks is lazy-initialisation, > for me it is to write less code, to have less noisy class

Re: [PHP-DEV] [RFC] [Discussion] Extend #[\Override] to target properties

2025-07-11 Thread Tim Düsterhus
Hi On 7/7/25 13:50, Jiří Pudil wrote: I'd like to start the discussion for an RFC proposing to extend the target of the #[\Override] attribute to properties. RFC: https://wiki.php.net/rfc/override_properties Implementation: https://github.com/php/php-src/pull/19061 Thank you. As the author o

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-11 Thread Rob Landers
On Fri, Jul 11, 2025, at 13:40, Nick wrote: > >> On 11. Jul 2025, at 01:43, Rob Landers wrote: >> >> On Thu, Jul 10, 2025, at 17:34, Larry Garfield wrote: >>> On Thu, Jul 10, 2025, at 5:43 AM, Tim Düsterhus wrote: >>> > Hi >>> > >>> > Am 2025-07-08 17:32, schrieb Nicolas Grekas: >>> >> I also

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-11 Thread Nick
> On 11. Jul 2025, at 01:43, Rob Landers wrote: > > On Thu, Jul 10, 2025, at 17:34, Larry Garfield wrote: >> On Thu, Jul 10, 2025, at 5:43 AM, Tim Düsterhus wrote: >> > Hi >> > >> > Am 2025-07-08 17:32, schrieb Nicolas Grekas: >> >> I also read Tim's argument that new features could be stricter.

Re: [PHP-DEV][RFC] Deprecate type juggling to and from bool type within the function type juggling context

2025-07-11 Thread Gina P. Banyard
On Monday, 30 June 2025 at 10:26, Nicolas Grekas wrote: > Hi Gina > > Thanks for experimenting with this on > https://github.com/symfony/symfony/pull/60890/files > > It's good to see that fitting this RFC requires a relatively small number of > lines to change even on a codebase like Symfony.

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-11 Thread Nick
> On 11. Jul 2025, at 13:02, Rob Landers wrote: >> >> Please remember that the RFC will allow `readonly` on backed properties >> only, not on virtual hooked properties. >> Nothing from your example would work, and it would result in: >> Fatal error: Hooked virtual properties cannot be declared

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-11 Thread Nick
> On 11. Jul 2025, at 14:25, Claude Pache wrote: > >> Le 11 juil. 2025 à 06:30, Nick a écrit : >> >> 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 prop

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-11 Thread Claude Pache
> Le 11 juil. 2025 à 06:30, Nick a écrit : > > Hey all, > >> On 8. Jun 2025, at 11:16, Larry Garfield 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 h