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
Release: 2016-06-23 13:29:39
Original
1035 people have browsed it

新人小白求各位大神指点 
 ( ! ) 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的好方法
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template