高手请指教
php吧
全部回复
仅看楼主
level 1
xcmd5201 楼主
这段代码,老是报第九行错,麻烦指点一下
<?php
class SO{
public $name;
public $height;
public $tizhong;
public $age;
public $sex;
public function__construct($name,$height,$tizhong,$age,$sex){
$this->name=$name;
$this->height=$height;
$this->tizhong=$tizhong;
$this->age=$age;
$this->sex=$sex;
}
public function bFB(){
if($this->height<185 and $this->tizhong<85){
return $this->name."能踢足球";
}else{
return $this->name."不能踢足球";
}}
}
$sport = new SO('小明',186,86,20,'男');
echo $sport->bFB()
?>
2021年08月27日 11点08分 1
level 1
是不是function和__construct之间没有空格
2021年08月27日 11点08分 2
level 14
同上
2021年08月27日 15点08分 3
1