Return to bug44295.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / general_functions |
1.1 misho 1: --TEST-- 2: user defined error handler + set_error_handling(EH_THROW) 3: --SKIPIF-- 1.1.1.2 ! misho 4: <?php ! 5: if(substr(PHP_OS, 0, 3) == "WIN") die("skip Not for Windows"); ! 6: if (!extension_loaded("spl") || is_dir('/this/path/does/not/exist')) die("skip"); ! 7: ?> 1.1 misho 8: --FILE-- 9: <?php 10: $dir = '/this/path/does/not/exist'; 11: 12: set_error_handler('my_error_handler'); 13: function my_error_handler() {$a = func_get_args(); print "in error handler\n"; } 14: 15: try { 16: print "before\n"; 17: $iter = new DirectoryIterator($dir); 18: print get_class($iter) . "\n"; 19: print "after\n"; 20: } catch (Exception $e) { 21: print "in catch: ".$e->getMessage()."\n"; 22: } 23: ?> 24: ==DONE== 25: <?php exit(0); ?> 26: --EXPECT-- 27: before 28: in catch: DirectoryIterator::__construct(/this/path/does/not/exist): failed to open dir: No such file or directory 29: ==DONE==