|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61121 get error result
Submitted: 2012-02-17 11:07 UTC Modified: 2012-02-17 17:14 UTC
From: gaoqiangscut at gmail dot com Assigned:
Status: Not a bug Package: POSIX related
PHP Version: Irrelevant OS: ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: gaoqiangscut at gmail dot com
New email:
PHP Version: OS:


 [2012-02-17 11:07 UTC] gaoqiangscut at gmail dot com
This is a bug in "stat" function, and I'm not quite sure which class this function belongs to.  Detailed message for the OS  and php version following:

OS message:
gao->:~$uname -a
Linux gaoqiang-VirtualBox 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux

php version:
gao->:~$php -v
PHP 5.3.5-1ubuntu7.4 with Suhosin-Patch (cli) (built: Dec 13 2011 18:25:14) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Test script:
echo "size= ";
echo $st["size"];
echo "\n";


echo "size= ";
echo $st["size"];
echo "\n";

Expected result:

Actual result:


a.txt (last revision 2012-02-17 11:10 UTC by gaoqiangscut at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-17 17:14 UTC]
PHP has a stat cache for performance reasons. Add this line before your second 
stat() call and you will get your expected output:


If you read you will see it says:

"Note: The results of this function are cached. See clearstatcache() for more 
 [2012-02-17 17:14 UTC]
-Status: Open +Status: Not a bug
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 15:01:28 2024 UTC