import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-file / lstat_stat_variation7.php
blob42e6cf5f6fc3efe73cb20f5ee8b8d4f1de8be299
1 <?php
2 /* Prototype: array lstat ( string $filename );
3 Description: Gives information about a file or symbolic link
5 Prototype: array stat ( string $filename );
6 Description: Gives information about a file
7 */
9 $file_path = dirname(__FILE__);
10 require "$file_path/file.inc";
12 /* test the effects on stats with writing data into a file */
14 $file_name = "$file_path/lstat_stat_variation7.tmp";
15 $fp = fopen($file_name, "w"); // temp file
16 fclose($fp);
18 // writing to an empty file
19 echo "*** Testing stat() on file after data is written in it ***\n";
20 $fh = fopen($file_name,"w");
21 $old_stat = stat($file_name);
22 clearstatcache();
23 fwrite($fh, str_repeat((binary)"Hello World", $old_stat['blksize']));
24 $new_stat = stat($file_name);
26 // compare self stats
27 var_dump( compare_self_stat($old_stat) );
28 var_dump( compare_self_stat($new_stat) );
29 // compare the stats
30 $comp_arr = array(7, 12, 'size', 'blocks');
31 var_dump(compare_stats($old_stat, $new_stat, $comp_arr, "<"));
32 clearstatcache();
34 echo "\n--- Done ---";
36 <?php
37 $file_path = dirname(__FILE__);
38 unlink("$file_path/lstat_stat_variation7.tmp");