Constructor property promotion for final properties

From: Date: Fri, 21 Feb 2025 20:09:46 +0000
Subject: Constructor property promotion for final properties
Groups: php.internals 
Request: Send a blank email to internals+get-126475@lists.php.net to get a copy of this message
Hi internals, 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? Background: In the process of trying to help support PHP 8.4 syntax in PHPCS[1], I discovered that constructor property promotion cannot be used with final properties. I thought that this was a bug, and filed GH-17860 with the report[2]. But, in the discussion on the patch that I sent to fix the bug[3], I was told that this was intentionally omitted. So, now the bug is a feature request. -Daniel [1] https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/734 [2] https://github.com/php/php-src/issues/17860 [3] https://github.com/php/php-src/issues/17861

« previous php.internals (#126475) next »