Home >Backend Development >PHP Tutorial >( ! ) Notice: Undefined property: Person::$showInfo in E:wampwwwview2.php on

( ! ) Notice: Undefined property: Person::$showInfo in E:wampwwwview2.php on

WBOY
WBOYOriginal
2016-06-23 13:29:391043browse

新人小白求各位大神指点 
 ( ! ) 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的好方法
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP图像操作类Next article:php验证码图片