I'm trying to get a list of functions that have already run in the context of an operation. And that's where the need arised.
Is there a way to get something like this work?
function funcX()
{
echo this.nameOrSomethingHere; //outputs funcX
}
As this example demonstrates, it is possible to achieve this functionality in Javascript.
I can always go for an alternative solution for taking care of my original need like with an alternative way around as follows;
function funcX()
{
$this_function_name = "funcX";
Add_this_to_the_already_executed_functions_list($this_function_name);
}
And here, the Add_this_to_the_already_executed_functions_list functions job is to take the passed string and add it to a globally defined array so at the end of the shutdown process you can get a view of all the functions that have been run in the last page.
The above method would work, but, obviously, it's not elegant cause it's not dynamic.
It would have been nice to be able to do something like this
function funcX()
{
Add_this_to_the_already_executed_functions_list(this.????);
}
The question is if there is a way to do this in PHP?