Page 1 of 1

tick question

Posted: Sat Jul 28, 2012 11:37 pm
by global_erp_solution
I was playing with the sample code:

Code: Select all

declare(ticks=1);

// A function called on each tick event
function tick_handler()
{
    echo "tick \n";
}

register_tick_function('tick_handler');

$a = 1;

if ($a > 0) {
    $a += 2;
    print($a);
}
in the explanation, I expect the output to be tick tick 3 tick tick, but I got 3 ticks 3 and 3 ticks and no newline. Can anybody explain this behavior? where does the extra tick come from and where's the newline?