本文整理汇总了PHP中People::sayName方法的典型用法代码示例。如果您正苦于以下问题:PHP People::sayName方法的具体用法?PHP People::sayName怎么用?PHP People::sayName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类People
的用法示例。
在下文中一共展示了People::sayName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
return isset($this->data[$name]);
}
function __unset($name)
{
unset($this->data[$name]);
echo "unset<br>";
}
function __call($methodName, $args)
{
echo "You try to call {$methodName} <br>";
print_r($args);
echo $args[5]->sayName();
}
}
$first = new People('putin');
$first->sayName();
$obj = new Girl('Алина');
$obj->sayName();
$obj->putin(1, 2, 3, 5, 5, new People("hello"));
//echo ($obj);
//echo obj();
//unset($obj);
//echo "<br>hello<br>";
//
//$obj->age = 33;
//$obj->weight = 90;
//echo '<pre>';
//var_dump($obj);
//echo'<br>';
//
//if (isset($obj->age)){
示例2: foo
function foo(People $obj)
{
$obj->sayName();
$obj->eat();
}
示例3: sayName
echo "<br>{$words}";
} else {
echo "<br>Путин хамло";
}
}
function sayName()
{
if ($this->name == "Владимир") {
echo "<br> Хамло";
} else {
echo "<br>" . $this->name;
}
}
static function noice()
{
echo "<br>la-la-la";
}
}
$obj = new People();
$obj->name = "Владимир";
$obj->lname = "Путин";
/*echo "Имя обьекта = " . $obj ->name."<br>Фамилия обьекта = " . $obj ->lname;
$obj ->say('Привет хамло');
$obj ->say();*/
$obj->sayName();
People::noice();
$dima = new people();
$dima->name = "Дмитрий";
$dima->lname = "Медведев";
$dima->sayName();
People::noice();