我在继承方面遇到了一些麻烦。我有类似的东西
文件A.php
namespace Main;
class A{
public function __construct(){ echo 'A->__construct'; }
}
和文件B.php
namespace Main;
class B extends \Main\A{
/* if I write this construct and remove extends from this class - it works - but I need to inherit it */
public function __construct(){ $a = new \Main\A(); }
public function something(){ echo 'B->something';}
}
是否存在类不能被继承或继承另一个类的情况?