Re: Re: Constructor property promotion for final properties

From: Date: Fri, 21 Mar 2025 15:17:05 +0000
Subject: Re: Re: Constructor property promotion for final properties
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Fri, Mar 21, 2025 at 4:07 AM Tim Düsterhus <[email protected]> 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üsterhus
>

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.phpt a very similar test
case.

--Daniel


Thread (9 messages)

« previous php.internals (#126897) next »