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

这么写为啥不对

WBOY
WBOYOriginal
2016-06-13 12:21:341111browse

这样写为啥不对
下图是我写的一个类中的方法,试图在同类中,在方法indexOp中调用同类的另一个方法reverse
但结果提示错误:Fatal error: Call to undefined function reverse() in D:\WWW\shop\control\index.php on line 12

当然这句话的提示说是发现reverse函数没有定义,
可我明明定义了哈,难道哪里不有不符合规范的地方吗

------解决思路----------------------
你在reverse方法里面还有一个方法reverse(substr($str,1)); 是这个方法报错了,改成self::reverse(substr($str,1)); 或者$this->reverse(substr($str,1)); 就可以了 应该

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