May 2016
Intermediate to advanced
155 pages
2h 15m
English
© Mikael Olsson 2016
Mikael Olsson, PHP 7 Quick Scripting Reference, 10.1007/978-1-4842-1922-5_15
Mikael Olsson1
(1)Hammarland, Finland
An abstract class provides a partial implementation that other classes can build upon. When a class is declared as abstract, it means that the class can contain incomplete methods that must be implemented in child classes, in addition to normal class members.
In an abstract class, any method can be declared abstract. These methods are then left unimplemented and only their signatures are specified, while their code blocks are replaced by semicolons.
abstract class Shape{abstract public function myAbstract();}
To give an example, the following class has two properties and ...
Read now
Unlock full access