Bug #61121 [NEW]: get error result

From: Date: Fri, 17 Feb 2012 11:07:30 +0000
Subject: Bug #61121 [NEW]: get error result
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-167595@lists.php.net to get a copy of this message
From:             
Operating system: ubuntu
PHP version:      Irrelevant
Package:          POSIX related
Bug Type:         Bug
Bug description:get error result

Description:
------------
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:
---------------
<?php 
$file="a.txt";
$fp=fopen($file,"a");
$st=stat($file);
echo "size= ";
echo $st["size"];
echo "\n";



fputs($fp,"test\n");
fclose($fp);


$st=stat($file);
echo "size= ";
echo $st["size"];
echo "\n";
?>

Expected result:
----------------
size=0
size=5

Actual result:
--------------
size=0
size=0

-- 
Edit bug report at https://bugs.php.net/bug.php?id=61121&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=61121&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=61121&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=61121&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=61121&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61121&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=61121&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=61121&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=61121&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=61121&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=61121&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=61121&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=61121&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=61121&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=61121&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=61121&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61121&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=61121&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=61121&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=61121&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=61121&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=61121&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#167595) next »