fork download
  1. <?php
  2.  
  3. $a = 10;
  4. $b = 20;
  5. $c = 30;
  6.  
  7. function tick_handler(){
  8. global $a, $b, $c;
  9. printf("%d, %d, %d\n", $a, $b, $c);
  10. }
  11. register_tick_function('tick_handler');
  12. //registrei a função no tick
  13.  
  14. declare(ticks=1){
  15. $a++;
  16. $b++;
  17. $c++;
  18. }
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
11, 20, 30
11, 21, 30
11, 21, 31
11, 21, 31