当前位置:首页 > CN2资讯 > 正文内容

php类php 分页类

10小时前CN2资讯


<?php class A { function f1() { if(isset($this)){ echo "is defined,".get_class($this)."\n"; }else{ echo "is not defined\n"; } } } class B { function f2() { A::f1(); } } $a = new A; $b = new B; $a->f1(); A::f1(); $b->f2(); B::f2(); ?>



is defined,A


is not defined


is defined,B


is not defined



<?php class A { function f1() { echo "a1\n"; } function f2() { echo "a2\n"; } } class B extends A { function f1() { echo "b1\n"; } } $a = new A(); $a->f1(); $b = new B(); $b->f1(); $b->f2(); ?>


a1


b1


a2


    你可能想看:

    扫描二维码推送至手机访问。

    版权声明:本文由皇冠云发布,如需转载请注明出处。

    本文链接:https://www.idchg.com/info/26200.html

    分享给朋友:

    “php类php 分页类” 的相关文章