1--TEST-- 2Test opendir() function : usage variations - open a directory twice 3--FILE-- 4<?php 5/* 6 * Call opendir() twice with the same directory as $path argument 7 */ 8 9echo "*** Testing opendir() : usage variation ***\n"; 10 11$path = __DIR__ . "/opendir_variation3"; 12mkdir($path); 13 14echo "\n-- Open directory first time: --\n"; 15var_dump($dh1 = opendir($path)); 16 17echo "\n-- Open directory second time: --\n"; 18var_dump($dh2 = opendir($path)); 19 20if ($dh1 !== $dh2) { 21 echo "\nNew resource created\n"; 22} else { 23 echo "\nNo new resource created\n"; 24} 25 26closedir($dh1); 27closedir($dh2); 28?> 29--CLEAN-- 30<?php 31$path = __DIR__ . "/opendir_variation3"; 32rmdir($path); 33?> 34--EXPECTF-- 35*** Testing opendir() : usage variation *** 36 37-- Open directory first time: -- 38resource(%d) of type (stream) 39 40-- Open directory second time: -- 41resource(%d) of type (stream) 42 43New resource created 44