import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-file / fileinode_variation3.php
blob9f3431280f3c4903b3cc94559a7e82831931a9f3
1 <?php
2 /*
3 Prototype: int fileinode ( string $filename );
4 Description: Returns the inode number of the file, or FALSE in case of an error.
5 */
7 /* Passing file names with different notations, using slashes, wild-card chars */
9 $file_path = dirname(__FILE__);
11 echo "*** Testing fileinode() with different notations of file names ***\n";
12 $dir_name = $file_path."/fileinode_variation3";
13 mkdir($dir_name);
14 $file_handle = fopen($dir_name."/fileinode_variation3.tmp", "w");
15 fclose($file_handle);
17 $files_arr = array(
18 "/fileinode_variation3/fileinode_variation3.tmp",
20 /* Testing a file trailing slash */
21 "/fileinode_variation3/fileinode_variation3.tmp/",
23 /* Testing file with double slashes */
24 "/fileinode_variation3//fileinode_variation3.tmp",
25 "//fileinode_variation3//fileinode_variation3.tmp",
26 "/fileinode_variation3/*.tmp",
27 "fileinode_variation3/fileinode*.tmp",
29 /* Testing Binary safe */
30 "/fileinode_variation3/fileinode_variation3.tmp".chr(0),
31 "/fileinode_variation3/fileinode_variation3.tmp\0"
34 $count = 1;
35 /* loop through to test each element in the above array */
36 foreach($files_arr as $file) {
37 echo "- Iteration $count -\n";
38 var_dump( fileinode( $file_path."/".$file ) );
39 clearstatcache();
40 $count++;
43 echo "\n*** Done ***";
44 ?><?php
45 $file_path = dirname(__FILE__);
46 $dir_name = $file_path."/fileinode_variation3";
47 unlink($dir_name."/fileinode_variation3.tmp");
48 rmdir($dir_name);