本文整理匯總了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');