timeout_variation_6.phpt 540 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Timeout within function trowing exception before timeout reached
  3. --SKIPIF--
  4. <?php
  5. if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
  6. ?>
  7. --FILE--
  8. <?php
  9. include dirname(__FILE__) . DIRECTORY_SEPARATOR . "timeout_config.inc";
  10. set_time_limit($t);
  11. function f($t) {
  12. echo "call";
  13. busy_wait($t-1);
  14. throw new Exception("exception before timeout");
  15. }
  16. f($t);
  17. ?>
  18. never reached here
  19. --EXPECTF--
  20. call
  21. Fatal error: Uncaught Exception: exception before timeout in %s:%d
  22. Stack trace:
  23. #0 %s(%d): f(%d)
  24. #1 {main}
  25. thrown in %s on line %d