The class declared with an abstract keyword is called an abstract class.
An abstract class has some special properties.
- It can not be initiated, the object of this class can not be created.
- it will always be inherent in other classes.
- It can contain abstract methods. (Methods declared with abstract keyword and do not have a body)
- Abstract is always implemented in the derived class.
Example
abstract class Database{
public $server="127.0.0.1";
}
class User extends Database{
}
$user= new User();
echo $user->server;
$user->server="100";
echo $user->server;