1--TEST-- 2Test opendir() function : usage variations - Different wildcards 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 paths containing wildcards to test if opendir() recognises them 13 */ 14 15echo "*** Testing opendir() : usage variations ***\n"; 16// create the temporary directories 17$file_path = __DIR__; 18$dir_path = $file_path . "/opendir_variation6"; 19$sub_dir_path = $dir_path . "/sub_dir1"; 20 21mkdir($dir_path); 22mkdir($sub_dir_path); 23 24// with different wildcard characters 25 26echo "\n-- Wildcard = '*' --\n"; 27var_dump( opendir($file_path . "/opendir_var*") ); 28var_dump( opendir($file_path . "/*") ); 29 30echo "\n-- Wildcard = '?' --\n"; 31var_dump( opendir($dir_path . "/sub_dir?") ); 32var_dump( opendir($dir_path . "/sub?dir1") ); 33 34?> 35--CLEAN-- 36<?php 37$dir_path = __DIR__ . "/opendir_variation6"; 38$sub_dir_path = $dir_path . "/sub_dir1"; 39 40rmdir($sub_dir_path); 41rmdir($dir_path); 42?> 43--EXPECTF-- 44*** Testing opendir() : usage variations *** 45 46-- Wildcard = '*' -- 47 48Warning: opendir(%s/opendir_var*): Failed to open directory: %s in %s on line %d 49bool(false) 50 51Warning: opendir(%s/*): Failed to open directory: %s in %s on line %d 52bool(false) 53 54-- Wildcard = '?' -- 55 56Warning: opendir(%s/opendir_variation6/sub_dir?): Failed to open directory: %s in %s on line %d 57bool(false) 58 59Warning: opendir(%s/opendir_variation6/sub?dir1): Failed to open directory: %s in %s on line %d 60bool(false) 61