There's no need declaring an abstract function in an abstract class that's already declared in the interface it implements - you'll get an error (in PHP 5.2, looks like PHP 5.3 treats it a bit differently):
Can't inherit abstract function IBlah::Fun() (previously declared abstract in Blah)
Solution: just drop this declaration from an abstract class altogether - this...
interface IBlah {
public function Fun();
}
abstract class Blah implements IBlah {
public function FunCommon() {}
}
class Koko extends Blah {
public function Fun() {}
}
... is a valid code both in PHP 5.2 and PHP 5.3, and Koko
objects will be treated as IBlah
ones. That's easy to check:
function t(IBlah $blah) {
var_dump($blah);
}
t(new Koko()); // object(Koko)#1 (0) {}