1--TEST-- 2Test lstat() and stat() functions: usage variations - effects of is_dir() 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/* Prototype: array lstat ( string $filename ); 13 Description: Gives information about a file or symbolic link 14 15 Prototype: array stat ( string $filename ); 16 Description: Gives information about a file 17*/ 18 19/* test the effects of is_dir() on stats of a dir */ 20 21$file_path = dirname(__FILE__); 22require "$file_path/file.inc"; 23 24 25/* create temp file, link and directory */ 26$dirname = "$file_path/lstat_stat_variation10"; 27mkdir($dirname); // temp dir 28 29// is_dir() on a directory 30echo "*** Testing stat() on directory after using is_dir() on it ***\n"; 31$old_stat = stat($dirname); 32// clear the cache 33clearstatcache(); 34sleep(2); 35var_dump( is_dir($dirname) ); 36$new_stat = stat($dirname); 37 38// compare self stats 39var_dump( compare_self_stat($old_stat) ); 40var_dump( compare_self_stat($new_stat) ); 41// compare the stat 42var_dump( compare_stats($old_stat, $new_stat, $all_stat_keys) ); 43 44echo "\n--- Done ---"; 45?> 46--CLEAN-- 47<?php 48$file_path = dirname(__FILE__); 49rmdir("$file_path/lstat_stat_variation10"); 50?> 51--EXPECTF-- 52*** Testing stat() on directory after using is_dir() on it *** 53bool(true) 54bool(true) 55bool(true) 56bool(true) 57 58--- Done --- 59