1--TEST-- 2Test lstat() and stat() functions: usage variations - hardlink 3--FILE-- 4<?php 5/* test the effects of is_link() on stats of hard link */ 6 7$file_path = __DIR__; 8require "$file_path/file.inc"; 9 10 11/* create temp file & link */ 12$filename = "$file_path/lstat_stat_variation14.tmp"; 13$fp = fopen($filename, "w"); // temp file 14fclose($fp); 15 16echo "*** Checking lstat() and stat() on hard link ***\n"; 17$linkname = "$file_path/lstat_stat_variation14_hard.tmp"; 18//ensure that link doesn't exists 19@unlink($linkname); 20 21// create the link 22var_dump( link($filename, $linkname) ); 23$file_stat = stat($filename); 24$link_stat = lstat($linkname); 25// compare self stats 26var_dump( compare_self_stat($file_stat) ); 27var_dump( compare_self_stat($link_stat) ); 28// compare the stat 29var_dump( compare_stats($file_stat, $link_stat, $all_stat_keys) ); 30// clear the stat 31clearstatcache(); 32 33echo "\n--- Done ---"; 34?> 35--CLEAN-- 36<?php 37$file_path = __DIR__; 38unlink("$file_path/lstat_stat_variation14_hard.tmp"); 39unlink("$file_path/lstat_stat_variation14.tmp"); 40?> 41--EXPECT-- 42*** Checking lstat() and stat() on hard link *** 43bool(true) 44bool(true) 45bool(true) 46bool(true) 47 48--- Done --- 49