Home  >  Article  >  Backend Development  >  为什么这么写不行呢

为什么这么写不行呢

WBOY
WBOYOriginal
2016-06-13 12:16:56898browse

为啥这么写不行呢
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