首页  >  文章  >  php教程  >  php接口的使用实例函数

php接口的使用实例函数

WBOY
WBOY原创
2016-06-13 11:16:571470浏览

php接口的使用实例函数  

接口Ren1
{const XINGMING="张三";
 function shuohua1();
 function shuohua2();}
接口 Ren2 扩展了 Ren1
{function shuohua3();
 function shuohua4();}
接口 Ren3
{function shuohua5();}
接口 Ren4
{function shuohua6();}
Ren5 类
{函数 shuohua7()
 {回声“7777
“;}}
Ren 类扩展 Ren5 实现 Ren2,Ren3,Ren4
{函数 shuohua1()
{回声“1111
“;}
 函数 shuohua2()
{回声“2222
“;}
 函数 shuohua3()
{回声“3333
“;}
 函数 shuohua4()
{回声“4444
“;}
 函数 shuohua5()
{回声“5555
“;}
 函数 shuohua6()
{回声“6666
“;}}
$r=new Ren();
echo Ren::XINGMING."
”;
$r->shuohua1();
$r->shuohua2();
$r->shuohua3();
$r->shuohua4();
$r->shuohua5();
$r->shuohua6();
$r->shuohua7();
输出示例:
张三
1111
2222
3333
4444
5555
6666
7777


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn