Home >Backend Development >PHP Tutorial >How to implement multiple interfaces in php, php implementation_PHP tutorial
This article describes the implementation method of multiple interfaces in php. Share it with everyone for your reference. The details are as follows:
<?php interface staff_i1 //接口1 { function setID($id); function getID(); } interface staff_i2 //接口2 { function setName($name); function getName(); } class staff implements staff_i1, staff_i2 //接口的实现 { private $id; private $name; function setID($id) { $this->id = $id; } function getID() { return $this->id; } function setName($name) { $this->name = $name; } function getName() { return $this->name; } function otherFunc() { echo "Test"; } } ?>
I hope this article will be helpful to everyone’s PHP programming design.