php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #31983 clearstatcache and fstat
Submitted: 2005-02-15 11:44 UTC Modified: 2005-02-15 13:35 UTC
From: admin at ff dot st Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: n/a
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: admin at ff dot st
New email:
PHP Version: OS:

 

 [2005-02-15 11:44 UTC] admin at ff dot st
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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-15 11:45 UTC] admin at ff dot st
Expected result : please read "If fstat() documentation was correct..." instead of clearstatcache.
 [2005-02-15 13:35 UTC] nlopess@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:11 UTC] phpdocbot@php.net
Automatic comment on behalf of nlopess
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=121447cca4a1224959b4537577431ca309bbc0fb
Log: fix #31983: the results of this function arent cached
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC