Home > Backend Development > PHP Tutorial > 为啥这么写不行呢

为啥这么写不行呢

WBOY
Release: 2016-06-23 13:37:42
Original
884 people have browsed it

php不是允许连写吗,为啥下面这种方法不行呢,提示错误: Fatal error: Call to a member function eat() on a non-object in D:\WWW\tp\1.php on line 15


回复讨论(解决方案)

这不是是否允许连写的问题
$li->name 返回的是字符串,当然就没有 eat 方法啦

Related labels:
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