045.phpt 536 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Timeout again inside register_shutdown_function
  3. --SKIPIF--
  4. <?php
  5. if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
  6. ?>
  7. --FILE--
  8. <?php
  9. set_time_limit(1);
  10. register_shutdown_function("plop");
  11. function plop() {
  12. $ts = time();
  13. while(true) {
  14. if ((time()-$ts) > 2) {
  15. echo "Failed!";
  16. break;
  17. }
  18. }
  19. }
  20. plop();
  21. ?>
  22. ===DONE===
  23. --EXPECTF--
  24. Fatal error: Maximum execution time of 1 second exceeded in %s on line %d
  25. Fatal error: Maximum execution time of 1 second exceeded in %s on line %d