PHP Fatal error: Can't inherit abstract function

后端 未结 4 1797
一生所求
一生所求 2020-12-18 22:10

I don\'t understand what I\'m doing wrong...

abstract class Css {
    abstract protected function parse($data);
}

abstract class CssElem extends Css {
    a         


        
4条回答
  •  醉酒成梦
    2020-12-18 22:29

    I recently encountered this Problem as well. For me it helped upgrading from PHP 5.3.8 to PHP 5.3.28.

    I don't know exactly when the change happened but in 5.3.28 it is possible to redeclare interface methods in abstract classes and still inherit from them.

提交回复
热议问题