How to declare abstract method in non-abstract class in PHP?

后端 未结 7 502
不知归路
不知归路 2020-12-14 14:51
class absclass {
    abstract public function fuc();
}

reports:

PHP Fatal error: Class absclass contains 1 abstract metho

相关标签:
7条回答
  • 2020-12-14 15:11

    It means that the proper of an abstract class is having at least one abstract method. So your class has either to implement the method (non abstract), or to be declared abstract.

    0 讨论(0)
提交回复
热议问题