<?php
namespace CParent {
class Helper{}
class Test{
/**
* @var Helper
*/
public $helper;
public function __construnct() {
$this->helper = new Helper();
}
}
}
namespace Child {
class Helper{}
class Test extends \CParent\Test {}
}
namespace {
$qwe = new Child\Test();
get_class($qwe->helper);
}
Fatal error: Uncaught TypeError: get_class(): Argument #1 ($object) must be of type object, null given in /in/KmZE4:29
Stack trace:
#0 {main}
thrown in /in/KmZE4 on line 29
Process exited with code 255.