Re: [PHP-DEV] Re: Constructor property promotion for final properties

2025-03-24 Thread Daniel Scherzer
On Mon, Mar 24, 2025 at 11:22 AM Larry Garfield wrote: > > To answer the original question: I'm not against this change, but as it is > a syntax change, I think it does warrant an RFC, even if it's a small/easy > one. That's a good way to flesh out the edge cases like that. > > --Larry Garfield

Re: [PHP-DEV] Re: Constructor property promotion for final properties

2025-03-23 Thread Larry Garfield
On Fri, Mar 21, 2025, at 2:29 PM, Daniel Scherzer wrote: >>> Yes, that would result in constructor property promotion. I'll need to >>> retarget the original PR for master, but at >>> https://github.com/php/php-src/pull/17861 you can see in >>> `Zend/tests/property_hooks/final_prop_promoted_2.p

Re: [PHP-DEV] Re: Constructor property promotion for final properties

2025-03-23 Thread Alexandru Pătrănescu
On Fri, Mar 21, 2025 at 9:30 PM Daniel Scherzer wrote: > > On Fri, Mar 21, 2025 at 9:45 AM Alexandru Pătrănescu > wrote: > >> >> On Fri, Mar 21, 2025 at 5:20 PM Daniel Scherzer < >> daniel.e.scher...@gmail.com> wrote: >> >>> On Fri, Mar 21, 2025 at 4:07 AM Tim Düsterhus wrote: >>> Can you

Re: [PHP-DEV] Re: Constructor property promotion for final properties

2025-03-21 Thread Tim Düsterhus
Hi Am 2025-03-20 21:12, schrieb Daniel Scherzer: I recently found out that constructor property promotion cannot be used for final properties. I propose that it become allowed. Thoughts? Would this need an RFC, or is this minor enough to be acceptable with just a mailing list discussion? Gi

Re: [PHP-DEV] Re: Constructor property promotion for final properties

2025-03-21 Thread Daniel Scherzer
On Fri, Mar 21, 2025 at 9:45 AM Alexandru Pătrănescu wrote: > > On Fri, Mar 21, 2025 at 5:20 PM Daniel Scherzer < > daniel.e.scher...@gmail.com> wrote: > >> On Fri, Mar 21, 2025 at 4:07 AM Tim Düsterhus wrote: >> >>> Can you clarify if the following would result in constructor property >>> promo

Re: [PHP-DEV] Re: Constructor property promotion for final properties

2025-03-21 Thread Daniel Scherzer
On Fri, Mar 21, 2025 at 4:07 AM Tim Düsterhus wrote: > Can you clarify if the following would result in constructor property > promotion or not: > > class Foo { > public function __construct( > final string $bar, > ) { } > } > > Best regards > Tim Düsterhu

Re: [PHP-DEV] Re: Constructor property promotion for final properties

2025-03-21 Thread Alexandru Pătrănescu
On Fri, Mar 21, 2025 at 5:20 PM Daniel Scherzer wrote: > On Fri, Mar 21, 2025 at 4:07 AM Tim Düsterhus wrote: > >> Can you clarify if the following would result in constructor property >> promotion or not: >> >> class Foo { >> public function __construct( >> final stri