1--TEST-- 2Test scandir() function : basic functionality 3--SKIPIF-- 4<?php 5if (substr(PHP_OS, 0, 3) != 'WIN') { 6 die("skip Valid only on Windows"); 7} 8?> 9--FILE-- 10<?php 11/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]]) 12 * Description: List files & directories inside the specified path 13 * Source code: ext/standard/dir.c 14 */ 15 16/* 17 * Test basic functionality of scandir() 18 */ 19 20echo "*** Testing scandir() : basic functionality ***\n"; 21 22// include file.inc for create_files function 23include (dirname(__FILE__) . '/../file/file.inc'); 24 25// set up directory 26$directory = dirname(__FILE__) . '/私はガラスを食べられますscandir_basic'; 27mkdir($directory); 28create_files($directory, 3, "numeric", 0755, 1, "w", "私はガラスを食べられますfile"); 29 30echo "\n-- scandir() with mandatory arguments --\n"; 31var_dump(scandir($directory)); 32 33echo "\n-- scandir() with all arguments --\n"; 34$sorting_order = SCANDIR_SORT_DESCENDING; 35$context = stream_context_create(); 36var_dump(scandir($directory, $sorting_order, $context)); 37 38delete_files($directory, 3, "私はガラスを食べられますfile"); 39?> 40===DONE=== 41--CLEAN-- 42<?php 43$directory = dirname(__FILE__) . '/私はガラスを食べられますscandir_basic'; 44rmdir($directory); 45?> 46--EXPECT-- 47*** Testing scandir() : basic functionality *** 48 49-- scandir() with mandatory arguments -- 50array(5) { 51 [0]=> 52 string(1) "." 53 [1]=> 54 string(2) ".." 55 [2]=> 56 string(45) "私はガラスを食べられますfile1.tmp" 57 [3]=> 58 string(45) "私はガラスを食べられますfile2.tmp" 59 [4]=> 60 string(45) "私はガラスを食べられますfile3.tmp" 61} 62 63-- scandir() with all arguments -- 64array(5) { 65 [0]=> 66 string(45) "私はガラスを食べられますfile3.tmp" 67 [1]=> 68 string(45) "私はガラスを食べられますfile2.tmp" 69 [2]=> 70 string(45) "私はガラスを食べられますfile1.tmp" 71 [3]=> 72 string(2) ".." 73 [4]=> 74 string(1) "." 75} 76===DONE=== 77