Re: Re: Constructor property promotion for final properties
| From: | Tim Düsterhus | 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 internals+get-126888@lists.php.net to get a copy of this message | ||
Hi
Am 2025-03-20 21:12, schrieb Daniel Scherzer:
Can you clarify if the following would result in constructor property promotion or not: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.
class Foo {
public function __construct(
final string $bar,
) { }
}
Best regards
Tim Düsterhus