PHP program to print the method name with the associated class name using magic constant __METHOD__
<?php
//PHP program to print the method name with the
//associated class using magic constant __METHOD__.
class Sample
{
public function MyMethod()
{
print(__METHOD__."<br>");
}
}
$S=new Sample();
$S->MyMethod();
?>
Output
Sample::MyMethod
