Date: 02/23/01
- Next message: André Langhorst: "[PHP-DEV] Re: phpweb / docs.php"
- Previous message: ncosta <email protected>: "[PHP-DEV] PHP 4.0 Bug #9424: Setcookie don't work well"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi
Is there anything that is speaking against a function
or a constant, that contains the name of the current
function?
This might be especially useful for situations like
<?php
function print_error($name) {
echo "An error occured in ".$name;
}
function foo() {
if ($error)
print_error('foo');
}
?>
where you pass the name of the function (in this
case the function, where the error occurs) to
another function. If there would be function or
a constant to return the current name, you could
simply type:
function foo() {
if ($error)
print_error(cur_function[()]);
}
So if you rename the function you do not need
to change the (perhaps multiple) call(s) for
print_error().
Martin
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: André Langhorst: "[PHP-DEV] Re: phpweb / docs.php"
- Previous message: ncosta <email protected>: "[PHP-DEV] PHP 4.0 Bug #9424: Setcookie don't work well"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

