mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
PHP readonly properties and inheritance cause error on hydration #7042
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chapterjason on GitHub (Sep 21, 2022).
Bug Report
Summary
Using php readonly properties and inheritance (changing scope) causes an error while trying to set the property in the hydration process.
Current behavior
Error from the doctrine reproducer
How to reproduce
Simplified reproducer https://onlinephp.io/c/57532:
I also created a reproducer with doctrine https://github.com/chapterjason/doctrine-readonly-reproducer but if you want I can make a reproducer with a pull request.
Expected behavior
The readonly property will be hydrated as expected.