return問(wèn)題
class car{
? public $name;
? public $carage;
? private $brithday;
? public function getname(){
? ? return $this->name;
? }
}
?$car1 = new car;
?$car1->name="jz";
?$car1->getname();?
為什么無(wú)法輸出值,也沒(méi)有報(bào)錯(cuò)
class car{
? public $name;
? public $carage;
? private $brithday;
? public function getname(){
? ? return $this->name;
? }
}
?$car1 = new car;
?$car1->name="jz";
?$car1->getname();?
為什么無(wú)法輸出值,也沒(méi)有報(bào)錯(cuò)
2019-07-12
舉報(bào)
2019-07-12
return只是返回值,但是并沒(méi)有輸出,用echo輸出這個(gè)值即可
2019-07-12
xiexie
2019-07-12
public 是公共的