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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to