Well, I was all ready to replace my getId() function in the interface with PHP 8.4’s new support for properties… except all my value objects are readonly. It’s fine if there’s an $id property, but if the ID is derived and I want to use a virtual property declaration, I get this instead:

"Property hooks are incompatible with readonly properties."

sad_trombone.wav

https://www.php.net/manual/en/language.oop5.property-hooks.php#language.oop5.property-hooks.virtual

Reply to this note

Please Login to reply.

Discussion

No replies yet.