Field accessed via magic method warning but not when within quotes

I'm not understanding this:



Why is the warning only when the var is outside of double-quotes?

Comment actions Permalink



Comment actions Permalink

Sorry, we've somehow missed the post.

In fact, this inspection is called "PHP > Undefined > Undefined field" and there is even a checkbox with an option "Notify of access to a field via magic method". This is just in case if you would like to disable the warning.


As for the warning itself, would it be possible to share a minimal reproducible code example?

Comment actions Permalink

I understand the warning but I don't understand why it appears in one context (no double-quotes) but not another (wrapped in double-quotes).

Can you explain the inconsistency?

The xml comes from:


which is just XML as standard-formatted as you can imagine, there's nothing wrong with the XML itself.

PHPStorm for some reason thinks it's OK to call `$this->xml->name_first` inside of double-quotes but then has a problem without, to explain it again.


Please sign in to leave a comment.