I was looking at some functions in PHP.net, and I came across a function called declare
, and in the example, there is something like this:
declare(ticks=1);
Below is another example:
declare(ticks=1);
// A function called on each tick event
function tick_handler() {
echo "tick_handler() called\n";
}
register_tick_function('tick_handler');
As I understand it, it is a method that is called every time the value of a variable is accessed / changed.
Even reading the documentation, I did not understand exactly what this method does. In what situations could it be useful? What is a tick event
?