What are the differences between php magic variables __METHOD__ and __FUNCTION__
WBOYOriginal
2016-07-25 08:52:301223browse
class Test{
public function doit(){
echo __FUNCTION__;
}
public function doitAgain(){
echo __METHOD__;
}
}
$obj = new Test();
$obj->doit();
echo ' ';
$obj->doitAgain();
?>
Copy the code
Output result:
doit
Test::doitAgain
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