so abstract clases are the same than inheritance+interfaces??
<?php
interface callA{
protected function callA();
}
class callB{
protected $b;
protected function callB(){
return $this->b;
}
}
class caller extends callB implements callA{
protected $a;
public function __construct($a,$b){
$this->a=$a;
$this->b=$b;
}
protected function callA(){
return $this->a;
}
public function callAB(){
return $this->callA().$this->callB();
}
}
$caller=new caller('a','b');
$caller->callAB();
abstract class callAB{
abstract protected function callA();
protected $b;
protected function callB(){
return $this->b;
}
}
class caller extends callAB{
protected $a;
public function __construct($a,$b){
$this->a=$a;
$this->b=$b;
}
protected function callA(){
return $this->a;
}
public function callAB(){
return $this->callA().$this->callB();
}
}
$caller=new caller('a','b');
$caller->callAB();
?>
the only difference i see is that using inheritance+interfaces you can instantiate the parent but using abstract classes you can't