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

为啥这么写不行呢

WBOY
WBOYOriginal
2016-06-23 13:37:42885browse

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 方法啦

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