What is the difference between __FUNCTION__ and __METHOD__ in PHP

1 Answer

0 votes
class test
{
    public function abc()
    {
        echo __FUNCTION__ . "<br />";
    }

    public function xyz()
    {
        echo __METHOD__ . "<br />";
    }
}

$obj = new test();
$obj->abc(); 
$obj->xyz(); 

  
/*
run:
   
abc
test::xyz
   
*/

 



answered Oct 8, 2017 by avibootz

Related questions

...