import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-file / 005_variation2-win32.php
blob4e46a1b6b6a55eddc50f25395625fa25af730fed
1 <?php
2 /*
3 Prototype: int fileatime ( string $filename );
4 Description: Returns the time the file was last accessed, or FALSE
5 in case of an error. The time is returned as a Unix timestamp.
7 Prototype: int filemtime ( string $filename );
8 Description: Returns the time the file was last modified, or FALSE
9 in case of an error.
11 Prototype: int filectime ( string $filename );
12 Description: Returns the time the file was last changed, or FALSE
13 in case of an error. The time is returned as a Unix timestamp.
15 Prototype: bool touch ( string $filename [, int $time [, int $atime]] );
16 Description: Attempts to set the access and modification times of the file
17 named in the filename parameter to the value given in time.
21 Prototype: void stat_fn(string $filename);
22 Description: Prints access, modification and change times of a file
24 function stat_fn( $filename ) {
25 echo "\n-- File '$filename' --\n";
26 echo "-- File access time is => ";
27 echo fileatime($filename)."\n";
28 clearstatcache();
29 echo "-- File modification time is => ";
30 echo filemtime($filename)."\n";
31 clearstatcache();
32 echo "-- inode change time is => ";
33 echo filectime($filename)."\n";
34 clearstatcache();
39 echo "*** Testing fileattime(), filemtime(), filectime() & touch() : usage variations ***\n";
40 echo "\n*** testing file info ***";
41 stat_fn(NULL);
42 stat_fn(false);
43 stat_fn('');
44 stat_fn(' ');
45 stat_fn('|');
46 echo "\n*** testing touch ***";
47 var_dump(touch(NULL));
48 var_dump(touch(false));
49 var_dump(touch(''));
51 //php generates permission denied, we generate No such file or dir.
52 var_dump(touch(' '));
53 var_dump(touch('|'));
56 echo "Done";