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

为什么这么写不行呢

WBOY
Release: 2016-06-13 12:16:56
Original
933 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