本文整理汇总了PHP中Dog::dance方法的典型用法代码示例。如果您正苦于以下问题:PHP Dog::dance方法的具体用法?PHP Dog::dance怎么用?PHP Dog::dance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dog
的用法示例。
在下文中一共展示了Dog::dance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
public function __get($key)
{
return $this->data[$key];
}
public function __call($name, $arguments)
{
var_dump($name);
var_dump($arguments);
}
public static function __callStatic($name, $arguments)
{
var_dump($name);
var_dump($arguments);
}
public function bark()
{
echo "Bark!";
}
public static function warning()
{
echo "Dog Bite!";
}
}
Dog::run("Pyay", 300);
$dog = new Dog("Aung Net", "Red");
$dog->test = "Testing";
$dog->goo = "Foo";
echo $dog->test;
echo $dog->goo;
$dog->dance("Aung Net", 4);
示例2: run
public function run()
{
// TODO: Implement run() method.
}
public function eat()
{
// TODO: Implement eat() method.
}
public function sleep()
{
// TODO: Implement sleep() method.
}
}
Dog::warning();
// scope resolution operator
Dog::fool("bar");
// late method binding
Dog::bark();
// -------------------
$dog = new Dog();
$dog->color = "Red";
// property binding
// echo $dog->color;
// $dog->warning();
$dog->dance("crazy", "foo", "bar", "moo");
$dog2 = new Dog();
$dog2->bark();
// Singaleton
$cat = new Cat("Shwe War");
$cat->name = "Shwe War";
echo $cat->name;