“这里我觉得有点奇怪,不是应该是覆盖A了么,应该只是输出”
貌似每什么奇怪的,echo输出一行,调用A::example()又输出一行,所以两行……
所谓覆盖,指的是$b=new B();后,$b->example()执行的是B::example()而不是A::example()。
子类中调用父类用parent::example();
貌似每什么奇怪的,echo输出一行,调用A::example()又输出一行,所以两行……
所谓覆盖,指的是$b=new B();后,$b->example()执行的是B::example()而不是A::example()。
子类中调用父类用parent::example();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货