1--TEST-- 2Test opendir() function : error conditions - Non-existent directory 3--SKIPIF-- 4<?php 5if (substr(PHP_OS, 0, 3) == 'WIN') { 6 die('skip.. Not valid for Windows'); 7} 8?> 9--FILE-- 10<?php 11/* 12 * Pass a non-existent directory as $path argument to opendir() to test behaviour 13 */ 14 15echo "*** Testing opendir() : error conditions ***\n"; 16 17echo "\n-- Pass a non-existent absolute path: --\n"; 18$path = __DIR__ . "/idonotexist"; 19var_dump(opendir($path)); 20 21echo "\n-- Pass a non-existent relative path: --\n"; 22chdir(__DIR__); 23var_dump(opendir('idonotexist')); 24?> 25--EXPECTF-- 26*** Testing opendir() : error conditions *** 27 28-- Pass a non-existent absolute path: -- 29 30Warning: opendir(%s/idonotexist): Failed to open directory: %s in %s on line %d 31bool(false) 32 33-- Pass a non-existent relative path: -- 34 35Warning: opendir(idonotexist): Failed to open directory: %s in %s on line %d 36bool(false) 37