1--TEST--
2Test lstat() and stat() functions: usage variations - file opened using w and r mode
3--SKIPIF--
4<?php
5if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
6?>
7--FILE--
8<?php
9/* use stat on file created using "w" and "r" mode of fopen */
10
11$file_path = __DIR__;
12require "$file_path/file.inc";
13
14
15$filename = "$file_path/lstat_stat_variation13.tmp";
16
17echo "*** Checking stat() on a file opened using read/write mode ***\n";
18$file_handle = fopen($filename, "w");  // create file
19fclose($file_handle);
20$old_stat = stat($filename);
21// clear the stat
22clearstatcache();
23sleep(1);
24// opening file again in read mode
25$file_handle = fopen($filename, "r");  // read file
26fclose($file_handle);
27$new_stat = stat($filename);
28// compare self stats
29var_dump( compare_self_stat($old_stat) );
30var_dump( compare_self_stat($new_stat) );
31// compare the stat
32var_dump( compare_stats($old_stat, $new_stat, $all_stat_keys) );
33
34echo "\n--- Done ---";
35?>
36--CLEAN--
37<?php
38$file_path = __DIR__;
39unlink("$file_path/lstat_stat_variation13.tmp");
40?>
41--EXPECT--
42*** Checking stat() on a file opened using read/write mode ***
43bool(true)
44bool(true)
45bool(true)
46
47--- Done ---
48