且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在PHP中的子构造函数之前调用父构造函数

更新时间:2022-06-04 00:37:19

只需在孩子中调用parent :: __ construct。

Just call parent::__construct in the child.

class Form extends Tag
{
    function __construct()
    {
        parent::__construct();
        // Called second.
    }
}