Bug #9423 Updated: Please create a function that returns name of currently executing function

From: Date: Wed, 10 Apr 2002 22:08:09 +0000
Subject: Bug #9423 Updated: Please create a function that returns name of currently executing function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-4565@lists.php.net to get a copy of this message
ID: 9423 Updated by: sniper@php.net Reported By: jide@lgb-inc.com -Status: Duplicate +Status: Closed Bug Type: Feature/Change Request PHP Version: 4.0.4pl1 New Comment: Just added __FUNCTION__ and __CLASS__ constants. These will be available in PHP 4.3.0. --Jani Previous Comments: ------------------------------------------------------------------------ [2001-08-28 04:15:11] sander@php.net Duplicate of 8576. ------------------------------------------------------------------------ [2001-02-23 10:54:26] jide@lgb-inc.com Please consider adding a new feature to the next version of PHP. When creating code that reports errors, it would be very helpful to have a function which returns the name of the currently executing function (or class method). You could perhaps name the function "func_get_name()", which would fit in nicely with the existing PHP functions "func_get_arg()", "func_get_args()", and "func_num_args()". Example usage: function foo() { if ( some error condition ) { ErrorHandler("An error occurrend in function " . func_get_name() ); } } If there is another (existing) way to accomplish this, please let me know. Thank you for your consideration (and thanks for PHP) - Jim Ide jide@lgb-inc.com ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=9423&edit=1

« previous php.bugs (#4565) next »