Question:
PHP 4 Specific
From a single class; how do I count the number of times a method is called?
Summary:
I develop a class such as the following:
class Customer()
{
function addItem($item, $quantity)
{
//process the crap out of the order...
}
}
Then when I create my object, I want to call the method [FONT=courier new]addItem[/FONT] more than once; either statically or even within a loop condition.
For example:
$cust = new Customer();
$cust->addItem('Item A', 4);
$cust->addItem('Item B', 9);
From within the class, I would like to know how many times the method [FONT=courier new]addItem[/FONT] has been called.
Thank you for reading this post.