PhpStorm 2019.2 Help

Code Inspection: Undefined field

Reports the references to class fields that are not declared.

The inspection skips the objects of the stdClass or derived types.

In the following example, the $var declaration references the field field of ExampleClass, which is not defined in the class.

class ExampleClass { } $example = new ExampleClass(); $var = $example->field;
Last modified: 23 August 2019