Can you get a method name from within a method in PHP?
Sure, you want the magic constants.
function myFunction() { print __FUNCTION__." in ".__FILE__." at ".__LINE__."\n"; }
Find out more from the php manual
While you can use the magic constant __METHOD__
I would highly recommend checking out PHP's reflection. This is supported in PHP5.
$modelReflector = new ReflectionClass(__CLASS__);$method = $modelReflector->getMethod(__METHOD__);
You can then do kick-ass stuff like inspect the signature, etc.