Home  >  Article  >  Backend Development  >  使用界定符号的有关问题

使用界定符号的有关问题

WBOY
WBOYOriginal
2016-06-13 13:35:38918browse

使用界定符号的问题。
class Work {

public function setXml(){
$_xml=
eof;
}
}
这是就会显示错误cannot reclare function setxml
但是我在函数中用此界定符就没有问题,是不是界定符不能再类的方法中用了?


------解决方案--------------------
能。这就是全部代码?
------解决方案--------------------
类中可使用界定符
检查你的类是否其他地方有再定义了setXml()
------解决方案--------------------
http://www.php.net/manual/zh/language.types.string.php#language.types.string.syntax.heredoc
------解决方案--------------------
那是因为你的 eof; 后面有一个TAB字符

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