Bug report
Read-only properties can be initialized in child classes.
The following code works:
https://3v4l.org/PDmd0#v8.4.6
As of PHP 8.4.0, readonly properties are implicitly protected(set), so may be set from child classes. That may be overridden explicitly if desired.
-- https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.properties.readonly-properties
But PHPStan reports property.readOnlyAssignOutOfClass.
Code snippet that reproduces the problem
https://phpstan.org/r/8e4203cd-9044-4f40-b350-d9ad8b40c4de
Expected output
No errors are reported
Did PHPStan help you today? Did it make you happy in any way?
Yes!
Bug report
Read-only properties can be initialized in child classes.
The following code works:
https://3v4l.org/PDmd0#v8.4.6
But PHPStan reports
property.readOnlyAssignOutOfClass.Code snippet that reproduces the problem
https://phpstan.org/r/8e4203cd-9044-4f40-b350-d9ad8b40c4de
Expected output
No errors are reported
Did PHPStan help you today? Did it make you happy in any way?
Yes!