摘要: 原文地址:http://small.aiweimeng.top/index.php/archives/51.html 在上篇文章中写到php可以使用```Trait```实现代码的复用, 下面介绍使用接口的多继承特性实现代码的复用; 示例代码: header("Content-type:text/html;charset=utf8"); interface TestOne{ function test_one(); } interface TestTwo{ function test_two($name); } //接口间多继承使用,隔开 interface TestThree extends TestOne,TestTwo{ function test_three($name); } class World implements TestThree { function test_one() { // TODO: Implement test_one() method. echo '使用 阅读全文
posted @ 2019-03-13 13:02 青丝南开 阅读(390) 评论(0) 推荐(0) 编辑