Re: Re: Constructor property promotion for final properties
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)