Inspectopedia
 
2024.3

Typed property might be uninitialized

Warning
New
Last modified: 03 December 2024

Reports the attempts to read from an uninitialized typed property. Such attempts will result in TypeError.

Typed properties should be initialized in any of the following ways:

  • by a default value

  • in the constructor

  • by the __get() magic getter

  • in-place, at the moment of usage

See Uninitialized and Unset Properties (php.net) for details.