How to call super in PHP?

前端 未结 2 370
生来不讨喜
生来不讨喜 2020-12-24 04:23

I have a classB which extends classA.

In both classA and classB I define the method fooBar

2条回答
  •  無奈伤痛
    2020-12-24 05:16

    parent::fooBar();
    

    Straight from the manual:

    The ... double colon, is a token that allows access to ... overridden properties or methods of a class.

    ...

    Example #3 Calling a parent's method

    myFunc();
    ?>
    

提交回复
热议问题