class T {<br /> function b($v) {<br /> echo $v;<br /> return $this;<br /> }<br /> function c($v) {<br /> echo $v;<br /> return $this;<br /> }<br />}<br />function a($v) {<br /> echo $v;<br /> return new T;<br />}<br /><br />a('aa')->b('bb')->c('cc');<br />
------解决方案--------------------
a()独立的方法,返回一个实例化类的对象,这个类里有b函数,b函数返回另一个类的对象且包含c函数
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