本文整理汇总了PHP中test::xyz方法的典型用法代码示例。如果您正苦于以下问题:PHP test::xyz方法的具体用法?PHP test::xyz怎么用?PHP test::xyz使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test
的用法示例。
在下文中一共展示了test::xyz方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: xyz
<?php
//1)Whenever we will implement abc interface in our class then we have to create method with name xyz. If we will not create function xyz then it will throw error.2)we can only define method in interface with public accessibility. If we will use other than public visibility in interface then it will throw error.3)Also while defining method in your interface do not use abstract keyword in your methods.4)You can not implement 2 interfaces if both share function with same name. It will throw error.
interface abc
{
public function xyz($b);
}
class test implements abc
{
public function xyz($b)
{
echo $b . '<br>';
echo 'this is content of xyz in test';
}
}
$test = new test();
$test->xyz('hey');