2 /* Prototype : mixed opendir(string $path[, resource $context])
3 * Description: Open a directory and return a dir_handle
4 * Source code: ext/standard/dir.c
8 * Pass different data types as $path argument to opendir() to test behaviour
9 * Where possible, an existing directory has been entered as a string value
12 echo "*** Testing opendir() : usage variations ***\n";
14 // create directory to be passed as string value where possible
15 $path = dirname(__FILE__
) . "/opendir_variation1";
18 //get an unset variable
26 function __construct($path) {
29 public function __toString() {
39 // get a resource variable
40 $fp = fopen(__FILE__
, "r");
42 // unexpected values to be passed to $path argument
79 /*22*/ new classA($path),
82 /*23*/ @$undefined_var,
91 // loop through each element of $inputs to check the behavior of opendir()
93 foreach($inputs as $input) {
94 echo "\n-- Iteration $iterator --\n";
95 var_dump( $dh = opendir($input) );
105 $path = dirname(__FILE__
) . "/opendir_variation1";