数据分析师2017-10-01 00:51:30
I defined a class User and declared a method getName() of the class. Why does an error appear when I use $user=new User;$name=$user.getName()? -PHP Chinese website Q&A-I defined a class User and declared a method getName() of the class. Why does it report an error when I use $user=new User;$name=$user.getName()? -PHP Chinese website Q&A
Let’s take a look and learn.
怪我咯2017-03-16 17:25:13
注意php中对类成员的引用方式,上面的引用应该为$name=$user->getName(),即使用->符号,而不是
Java中使用的“.”号。