import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-file / glob_error.php
blobcdebf4299d4c3bc85de0097396af6dfee9db5d29
1 <?php
2 /* Prototype: array glob ( string $pattern [, int $flags] );
3 Description: Find pathnames matching a pattern
4 */
6 $file_path = dirname(__FILE__);
8 // temp dir created
9 mkdir("$file_path/glob_error");
10 // temp file created
11 $fp = fopen("$file_path/glob_error/wonder12345", "w");
12 fclose($fp);
14 echo "*** Testing glob() : error conditions ***\n";
16 echo "-- Testing glob() with unexpected no. of arguments --\n";
17 var_dump( glob() ); // args < expected
18 var_dump( glob(dirname(__FILE__)."/glob_error/wonder12345", GLOB_ERR, 3) ); // args > expected
20 echo "\n-- Testing glob() with invalid arguments --\n";
21 var_dump( glob(dirname(__FILE__)."/glob_error/wonder12345", '') );
22 var_dump( glob(dirname(__FILE__)."/glob_error/wonder12345", "string") );
24 echo "Done\n";
25 ?><?php
26 // temp file deleted
27 unlink(dirname(__FILE__)."/glob_error/wonder12345");
28 // temp dir deleted
29 rmdir(dirname(__FILE__)."/glob_error");