I don\'t understand what I\'m doing wrong...
abstract class Css {
abstract protected function parse($data);
}
abstract class CssElem extends Css {
a
Try changing your intermediate class to:
abstract class CssElem extends Css {
// abstract protected function parse($data); // <-- take this away
}
See also this comment in the docs.
Quoting from the comment:
An abstract class that extends an abstract class can pass the buck to its child classes when it comes to implementing the abstract methods of its parent abstract class.
It seems however that this will be allowed in the next PHP version 7.2:
It is now allowed to override an abstract method with another abstract method in a child class. (https://wiki.php.net/rfc/allow-abstract-function-override)