From: admin at ff dot st Operating system: PHP Website PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: clearstatcache and fstat
Description: ------------ The documentation of fstat (http://www.php.net/manual/en/function.fstat.php) shows a note : "Note: The results of this function are cached. See clearstatcache() for more details.". However clearstatcache's documentation (http://www.php.net/manual/en/function.clearstatcache.php) does not list fstat in the list of affected functions. After a test with PHP 4.3.10 (Win32), it seems that fstat is *not* cached. Reproduce code: --------------- <?php touch('TEST.BIN'); // make sure this file exists $fp=fopen('TEST.BIN','r+b'); ftruncate($fp,0); $stat=fstat($fp); echo $stat['size']."\n"; fwrite($fp,"TEST"); $stat=fstat($fp); echo $stat['size']."\n"; fclose($fp); unlink('TEST.BIN'); Expected result: ---------------- If clearstatcache documentation was correct we should receive : 0 0 Actual result: -------------- Actually the code shows : 0 4 fstat() documentation is not correct : the function is not cached (at least for normal file streams) -- Edit bug report at http://bugs.php.net/?id=31983&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31983&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31983&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31983&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31983&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31983&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31983&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31983&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31983&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31983&r=support Expected behavior: http://bugs.php.net/fix.php?id=31983&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31983&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31983&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31983&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31983&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31983&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31983&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31983&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31983&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31983&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31983&r=mysqlcfg