<?php
abstract class a{
abstract protected function test();
function threeDots(){
return '...';
}
}
class b extends a{
protected function test(){
echo $this->threeDots();
}
}
$obj = new a();
$obj->test();
?>
Above code giving error…But dont able to understand Why?
Error on this line:
$obj = new a();Because you can’t create instances of abstract classes.
Perhaps, you wanted to write:
$obj = new b();?