--TEST-- Trying to create an object from dereferencing uninitialized variable --FILE-- x; } static public function b() { return self::$y; } } $foo = new foo; $h = $foo->a()[0]->a; var_dump($h); $h = foo::b()[1]->b; var_dump($h); ?> --EXPECTF-- Warning: Trying to access array offset on value of type null in %s on line %d Warning: Attempt to read property "a" on null in %s on line %d NULL Warning: Trying to access array offset on value of type null in %s on line %d Warning: Attempt to read property "b" on null in %s on line %d NULL