async_signals_2.phpt 475 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Async signals in zend_call_function
  3. --EXTENSIONS--
  4. pcntl
  5. --SKIPIF--
  6. <?php
  7. if (getenv("SKIP_SLOW_TESTS")) print "skip slow test";
  8. ?>
  9. --FILE--
  10. <?php
  11. pcntl_async_signals(1);
  12. pcntl_signal(SIGALRM, function($signo) {
  13. throw new Exception("Alarm!");
  14. });
  15. pcntl_alarm(1);
  16. try {
  17. array_map(
  18. 'time_nanosleep',
  19. array_fill(0, 360, 1),
  20. array_fill(0, 360, 0)
  21. );
  22. } catch (Exception $e) {
  23. echo $e->getMessage(), "\n";
  24. }
  25. ?>
  26. --EXPECT--
  27. Alarm!