美文网首页
static延迟静态绑定

static延迟静态绑定

作者: 一梦三四年lyp | 来源:发表于2019-07-23 11:48 被阅读0次
 abstract class brand{
    public static function create()
    {
        return new static(); #指的是被调用的类而不是包含类
    }
    }


    class apple extends brand{

    }


    class vivo extends brand{

    }

    var_dump(apple::getGroup());die; #object(apple)#1 (0) { }
    }

相关文章

网友评论

      本文标题:static延迟静态绑定

      本文链接:https://www.haomeiwen.com/subject/spfolctx.html