bug44295-win.phpt 765 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 Windows only");
  6. if (is_dir('c:\\not\\exists\\here')) die("skip directory c:\\not\\exists\\here already exists");
  7. ?>
  8. --FILE--
  9. <?php
  10. $dir = 'c:\\not\\exists\\here';
  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. --EXPECTF--
  25. before
  26. in catch: DirectoryIterator::__construct(c:\not\exists\here): %s (code: 3)
  27. ==DONE==