Undefined field of derived stdClass shows warning

class TestClass extends stdClass
   public function __construct() {

function test() {
    $x = new stdClass();
    $y = new TestClass();
    print $x->test . $y->test;
$x->test shows no warning.

$y->test shows a warning

Message shows:

Referenced field is not      found in subject class.
Note: Check is not performed on objects of type      "stdClass" or derived.

Could someone explain?

this is in phpstorm 3.0


Comment actions Permalink

Hi Marc,

Most likely it is a bug (as far as I can see it) -- as it should work just fine because TestClass is a child of stdClass.

Comment actions Permalink

Should I submit a bug report?


Please sign in to leave a comment.