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

m

3 comments
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.

0
Comment actions Permalink

Should I submit a bug report?

0

Please sign in to leave a comment.