1--TEST-- 2Test closedir() function : usage variations - close directory handle twice 3--FILE-- 4<?php 5/* Prototype : void closedir([resource $dir_handle]) 6 * Description: Close directory connection identified by the dir_handle 7 * Source code: ext/standard/dir.c 8 * Alias to functions: close 9 */ 10 11/* 12 * close the directory handle twice using closedir() to test behaviour 13 */ 14 15echo "*** Testing closedir() : usage variations ***\n"; 16 17//create temporary directory for test, removed in CLEAN section 18$directory = dirname(__FILE__) . "/closedir_variation2"; 19mkdir($directory); 20 21$dh = opendir($directory); 22 23echo "\n-- Close directory handle first time: --\n"; 24var_dump(closedir($dh)); 25echo "Directory Handle: "; 26var_dump($dh); 27 28echo "\n-- Close directory handle second time: --\n"; 29var_dump(closedir($dh)); 30echo "Directory Handle: "; 31var_dump($dh); 32?> 33===DONE=== 34--CLEAN-- 35<?php 36$directory = dirname(__FILE__) . "/closedir_variation2"; 37rmdir($directory); 38?> 39--EXPECTF-- 40*** Testing closedir() : usage variations *** 41 42-- Close directory handle first time: -- 43NULL 44Directory Handle: resource(%d) of type (Unknown) 45 46-- Close directory handle second time: -- 47 48Warning: closedir(): supplied resource is not a valid Directory resource in %s on line %d 49bool(false) 50Directory Handle: resource(%d) of type (Unknown) 51===DONE=== 52