1--TEST-- 2Test lstat() and stat() functions: usage variations - effects changing permissions of file 3--SKIPIF-- 4<?php 5if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); 6if (substr(PHP_OS, 0, 3) == 'WIN') { 7 die('skip.. Not valid for Windows'); 8} 9?> 10--FILE-- 11<?php 12/* test the effects on stats with changing permissions of file */ 13 14$file_path = __DIR__; 15require "$file_path/file.inc"; 16 17$filename = "$file_path/lstat_stat_variation16.tmp"; 18$fp = fopen($filename, "w"); // temp file 19fclose($fp); 20 21// checking stat() on file after changing its permission 22echo "*** Testing lstat() on a file after changing its access permission ***\n"; 23$old_stat = stat($filename); 24sleep(1); 25var_dump( chmod($filename, 0777) ); 26// clear the stat 27clearstatcache(); 28$new_stat = stat($filename); 29// compare self stats 30var_dump( compare_self_stat($old_stat) ); 31var_dump( compare_self_stat($new_stat) ); 32// compare the stat 33$affected_members = array(10, 'ctime'); 34var_dump( compare_stats($old_stat, $new_stat, $affected_members, "!=") ); 35 36echo "\n--- Done ---"; 37?> 38--CLEAN-- 39<?php 40$file_path = __DIR__; 41unlink("$file_path/lstat_stat_variation16.tmp"); 42?> 43--EXPECT-- 44*** Testing lstat() on a file after changing its access permission *** 45bool(true) 46bool(true) 47bool(true) 48bool(true) 49 50--- Done --- 51