【发布时间】:2015-09-19 16:24:18
【问题描述】:
如何在下面的 Dog 类中添加 speak 方法。 我正在尝试让狗能够吠叫。
<?php
class Dog
{
private $dog_weight = 0;
private $dog_breed = "no breed";
private $dog_color = "no color";
private $dog_name = "no name";
function display_properties()
{
print "Dog weight is $this->dog_weight. Dog breed is $this->dog_breed. Dog color is $this->dog_color.";
}
}
?>
【问题讨论】: