Configure register_tick_function () on xampp [closed]

-3

I'm trying to use the register_tick_function () function, but it's crashing my development server. But I'm also not able to use this same function on the production server.

Please help me configure the use of the register_tick_function () function and similar functions on my server.

Thank you in advance! Galera if you do not know PHP advanced do not respond and do not vote negative as it is an advanced topic.

    
asked by anonymous 10.01.2016 / 21:22

1 answer

0

I do not know how your code is, but it is likely that you have not declared ticks=1 , the Portuguese documentation does not provide a correct example, as documented in English:

Here is an example usage:

<?php
declare(ticks=1);

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

register_tick_function('tick_handler');

$a = 1;

if ($a > 0) {
    $a += 2;
    print($a);
}

I do not recommend using in production. Another detail is quite unlikely, but if your server is PHP5.2 this will not work if the module is threaded:

  

Warning   register_tick_function () should not be used with threaded web server modules with PHP 5.2 or lower.

Related:

11.01.2016 / 03:54