Cannot indirectly modify readonly¶
The same error message ‘Cannot indirectly modify readonly property X::$property’ is used when trying to sneak a reference on a readonly property, and updated it later.
Strangely, this is also the same error message when the readonly property is initially assigned a reference, for later sneaky update.
The error is the same, indeed, yet may be these messages may be distinct.
See Also¶
Sneaky readonly [Try me]