您的位置:首页 > 编程语言 > PHP开发

php多重接口的实现

2009-03-06 21:47 253 查看
<?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";
      }
   }
?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: