代码运行没有错误,但名字不显示是为什么?
<p><?php
class Human
{
public $name;
public $height;
public $weight;
public function eat($food){
echo $this ->name."'s eating ".$food."\n";
}
}
class Player extends Human
{
}
$jor=new Human("jor","198cm","75kg");
echo $jor ->name."\n";
$jor ->eat("orange");
?>