bug44295.phpt 825 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. user defined error handler + set_error_handling(EH_THROW)
  3. --SKIPIF--
  4. <?php
  5. if (substr(PHP_OS, 0, 3) == "WIN") die("skip Not for Windows");
  6. if (is_dir('/this/path/does/not/exist')) die("skip directory /this/path/does/not/exist already exists");
  7. ?>
  8. --FILE--
  9. <?php
  10. $dir = '/this/path/does/not/exist';
  11. set_error_handler('my_error_handler');
  12. function my_error_handler() {$a = func_get_args(); print "in error handler\n"; }
  13. try {
  14. print "before\n";
  15. $iter = new DirectoryIterator($dir);
  16. print get_class($iter) . "\n";
  17. print "after\n";
  18. } catch (Exception $e) {
  19. print "in catch: ".$e->getMessage()."\n";
  20. }
  21. ?>
  22. ==DONE==
  23. <?php exit(0); ?>
  24. --EXPECT--
  25. before
  26. in catch: DirectoryIterator::__construct(/this/path/does/not/exist): Failed to open directory: No such file or directory
  27. ==DONE==