6
I was looking at some functions in PHP.net, and I came across a function called declare
, and in the example, there’s something like:
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');
From what I understand, 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
?
Related: http://answall.com/questions/52192/para-que-serve-a-palavra-chave-declare-no-php
– Wallace Maxters