1--TEST--
2Test lstat() and stat() functions: usage variations - effect of is_file()
3--SKIPIF--
4<?php
5if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
6?>
7--FILE--
8<?php
9/* Prototype: array lstat ( string $filename );
10   Description: Gives information about a file or symbolic link
11
12   Prototype: array stat ( string $filename );
13   Description: Gives information about a file
14*/
15
16$file_path = __DIR__;
17require "$file_path/file.inc";
18
19/* test the effects of is_file() on stats of a file */
20
21/* create temp file */
22$filename = "$file_path/lstat_stat_variation11.tmp";
23$fp = fopen($filename, "w");  // temp file
24fclose($fp);
25
26// is_file() on a file
27echo "*** Testing stat() on a file after using is_file() on it ***\n";
28$old_stat = stat($filename);
29// clear the stat
30clearstatcache();
31sleep(2);
32var_dump( is_file($filename) );
33$new_stat = stat($filename);
34// compare self stats
35var_dump( compare_self_stat($old_stat) );
36var_dump( compare_self_stat($new_stat) );
37// compare the stat
38var_dump( compare_stats($old_stat, $new_stat, $all_stat_keys) );
39// clear the stat
40clearstatcache();
41
42echo "\n--- Done ---";
43?>
44--CLEAN--
45<?php
46$file_path = __DIR__;
47unlink("$file_path/lstat_stat_variation11.tmp");
48?>
49--EXPECT--
50*** Testing stat() on a file after using is_file() on it ***
51bool(true)
52bool(true)
53bool(true)
54bool(true)
55
56--- Done ---
57