I don't understand what I'm doing wrong...
abstract class Css {
abstract protected function parse($data);
}
abstract class CssElem extends Css {
abstract protected function parse($data);
}
class Modifier extends CssElem {
function __construct($data = null) {
if( $data )
$this->parse ($data);
}
protected function parse($data) {
// Some code...
}
}
It gives me :
[Mon Jul 8 13:21:10 2013] PHP Fatal error: Can't inherit abstract
function Css::parse() (previously declared abstract in CssElem) in
/home/arthur/NetBeansProjects/capa/CssElem.php on line 21 [Mon Jul 8
13:21:10 2013] 127.0.0.1:41207 [500]: / - Can't inherit abstract
function Css::parse() (previously declared abstract in CssElem) in
/home/arthur/NetBeansProjects/capa/CssElem.php on line 21
Line 21 is abstract protected function parse($data);
in CssElem.
I'm more familiar with OOP in Java, but it seems ok according to the doc...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…