<?php/*1. Using interfaces (interface), you can specify which methods a class must implement, but you do not need to define the specifics of these methods. 2. The interface is defined by the interface keyword, just like defining a standard class, but all of the methods defined in it are empty. 3. All methods defined in the interface must be public, which is the attribute of the interface. 4. To implement an interface, use the implements operator. All methods defined in the interface must be implemented in the class, or a fatal error will be reported. A class can implement multiple interfaces, separating the names of multiple interfaces with commas */interface httpprotocal{const $PI = 3.14; } Interface Protocal extends Httpprotocal{public function protocal ();} Class Indexcontoller implements Protocal{public function Protocal () {}} #echo Indexcontoller::P i;? >
php-interface uses