1
I wonder if in PHP there is any way to find out how many times a certain function has been called.
I speak natively as I would also like to do this check for native functions.
Example:
var_dump($_POST);
var_dump($_GET);
get_function_called_number('var_dump'); // int(2)
To satistazer only to the requirements of the question, I will already demonstrate in the question that I know how to do this for functions that I created.
Thus:
function call_me()
{
static $count = 0;
$count++;
var_dump($count);
}
call_me(); // imprime int(1)
call_me(); // imprime int(2)
But I would like a solution to know about the native functions.
I never saw it, but it would be of great use! D
– mauricio caserta
In fact, all you want is a profiler (see Xdebug + kcachegrind): http://xdebug.org/docs/profiler
– felipsmartins