Inspectopedia
 
2024.3

Backed property with a 'set' hook cannot be accessed by reference

Error
New
Last modified: 03 December 2024

Reports an attempted indirect modification of a hooked property.

In PHP 8.4 and later, returning a backed property by reference via &get is only allowed if there's no set hook defined. For details, see PHP RFC: Property hooks.