php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #18067 function name
Submitted: 2002-06-29 16:56 UTC Modified: 2002-07-01 10:03 UTC
From: henno dot taht at japauto dot ee Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.2.1 OS: Debian Woody
Private report: No CVE-ID: None
 [2002-06-29 16:56 UTC] henno dot taht at japauto dot ee
There should be a function which returns current functions name.

EXAMPLE:

function foo(){
    debug("Entering function ". func_get_name() ."<br>");
    // Function definition here.
}

function debug($msg){
    echo "<span class=debughdr>Debug information: </span>";
    echo "<span class=debugmsg>$msg</span>";
}

I think func_get_name would be an appropriate name. At least that was the name I looked for it.

I don't know any workaround nor how to make user defined function providing this functionality but after asking Experts Exchange I've convinced that I'm not the only one requiring this.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-29 17:07 UTC] henno dot taht at japauto dot ee
Duplicate of 8576
 [2002-06-29 18:50 UTC] sniper@php.net
Yes, use __FUNCTION__ :)

 [2002-07-01 09:58 UTC] henno dot taht at japauto dot ee
Is it available yet?
 [2002-07-01 10:03 UTC] sniper@php.net
It will be available in PHP 4.3.0 and above.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC