Thursday, November 8, 2018

OOP : interface

Summary: in this tutorial, you will learn how to use PHP interface that is one of the most important building blocks in PHP object-oriented programming.

Introduction to PHP interface

An interface allows you to specify a list of methods that a class must implement. To define an interface, you use the interface keyword as follows:
An interface consists of methods that contain no implementation. In other words, all methods of the interface are abstract methods. An interface can have its own constants. See the following syntax:
All the methods in the interface must have public visibility level.

No comments:

Post a Comment