当前位置:Gxlcms > PHP教程 > (!)Notice:Undefinedproperty:Person::$showInfoinE:wampwwwview2.phpon

(!)Notice:Undefinedproperty:Person::$showInfoinE:wampwwwview2.phpon

时间:2021-07-01 10:21:17 帮助过:18人阅读

新人小白求各位大神指点
( ! ) Notice: Undefined property: Person::$showInfo in E:\wamp\www\view2.php on line 17
class Person{
public $name;
private $salary;
protected $age;
function __construct($name,$age,$salary){
$this->name=$name;
$this->age=$age;
$this->salary=$salary;
}
public function showInfo(){
echo $this->name;
}
}
$p1=new Person("二货",30,1000);
$p1->showInfo;
?>


回复讨论(解决方案)

各位大神帮帮忙

$p1->showInfo ();

$p1->showInfo ();



解决了 这么简单。。。。
大神你有没有什么学习php的好方法

人气教程排行