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_14
Mikael Olsson1
(1)Hammarland, Finland
An interface specifies methods that classes using the interface must implement. They are defined with the interface keyword, followed by a name and a code block . Their naming convention is to start with a small i and then to have each word initially capitalized.
interface iMyInterface {}The code block for an interface can contain signatures for instance methods. These methods cannot have any implementations. Instead, their bodies are replaced by semicolons. Interface methods must always be public.
interface iMyInterface{public function myMethod();}
Additionally, interfaces may define ...
Read now
Unlock full access