🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Reinitialization of a readonly property in __clone #11495

Description

@priyadi

Bug report

Since PHP 8.3, it is allowed to reinitialize a readonly property in __clone. Currently PHPStan gives the error "Readonly property HelloWorld::$foo is assigned outside of the constructor"

Reference: https://wiki.php.net/rfc/readonly_amendments

Code snippet that reproduces the problem

https://phpstan.org/r/c465fe8e-828a-41d0-977d-d20c6b51afb4

Expected output

no phpstan warning produced as the code is valid in 8.3

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions