+++ title = "Abstract Classes" description = "Inheriting an interface" tags = ["php", "abstract"] slug = "abstract" previous = "interfaces.html" next = "exceptions.html" +++ Abstract classes are similar to interfaces in that they define methods that a sub-class must implement. However, an abstract class can also have normal methods. To create an abstract class, use the `abstract` keyword followed by `class` and the name of the class. ```php turnOn(); $iPhone->unlock(); $android = new Android(); $android->turnOn(); $android->unlock(); ``` You cannot create an instance of an abstract class. PHP would not know how to use the abstract methods so when you try to create an abstract instance you will get an error. ```php $cellPhone = new CellPhone(); // causes an error ```