📜  在 trait php 代码示例中定义构造函数

📅  最后修改于: 2022-03-11 14:54:49.343000             🧑  作者: Mango

代码示例1
class MyHelloWorld extends Base {

    use SayWorld {
        SayWorld::__construct as private __swConstruct;
    }

    public function __construct($a, $b, $c = 0)
    {
        $this->__swConstruct($a, $b, $c);
    }
}