Re: Re: Constructor property promotion for final properties

From: Date: Fri, 21 Mar 2025 11:07:09 +0000
Subject: Re: Re: Constructor property promotion for final properties
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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?
Given the lack of engagement, I want to make it clear: unless somebody objects, maintainers have agreed to merge a PR implementing the feature in 2 weeks. If you object, please speak up.
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

Thread (9 messages)

« previous php.internals (#126888) next »