SignalListener.php 257 B

12345678910111213141516
  1. <?php
  2. // required for signal handling
  3. declare (ticks = 1);
  4. pcntl_signal(SIGUSR1, function () {echo 'Caught SIGUSR1'; exit;});
  5. $n = 0;
  6. // ticks require activity to work - sleep(4); does not work
  7. while ($n < 400) {
  8. usleep(10000);
  9. ++$n;
  10. }
  11. return;