0

Intelepense in VScode tells me that — Undefined variable '$name'.intelephense(1008). Same with $age. And in the inherited class, there is an error with the parent:: construct - Cannot use 'parent' in a class with no parent.intelephense(1035). I checked in PhpStorm, everything worked as it should.

enter image description here

  • 1
    Please also post the relevant code as _text_, not just a picture - see [ask]. Thanks. – ADyson May 22 '22 at 19:46
  • This is definitely a bug. My base class exists, I can hit F12 while the cursor is in the base class name and it opens the file. But for some reason, the `__construct()` method can't find its parent. – Mageician Nov 03 '22 at 13:11
  • FYI - Got this via a colleague encountering this. He didn't have a namespace resolver. In VS Code we installed Mehedi Hassan's "PHP Namespace Resolver" extension and it can now traverse between classes & thus Inteliphense also doesn't show this error anymore. – Ken Verhaegen Mar 28 '23 at 10:02

0 Answers0