#31115 [Opn->Bgs]: fstat() returns array with both associative & numeric indexes
| From: | didou@php.net | Date: | Mon, 20 Dec 2004 02:23:55 +0000 |
| Subject: | #31115 [Opn->Bgs]: fstat() returns array with both associative & numeric indexes | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969365527@lists.php.net to get a copy of this message | ||
ID: 31115
Updated by: didou@php.net
Reported By: tony2001 at phpclub dot net
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: Linux
PHP Version: 5CVS-2004-12-16 (dev)
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
the example have a comment just before the print_r :
// print only the associative part
print_r(array_slice($fstat, 13));
plus the docs clearly tells you to see scan() docs for the output
format, and the numeric indexes are described there.
not enough coffee ? :)
Previous Comments:
------------------------------------------------------------------------
[2004-12-16 11:11:45] tony2001 at phpclub dot net
Description:
------------
fstat() returns result array with both associative & numerics indexes,
but documentation says only about associative ones.
Reproduce code:
---------------
<?php
$fp = fopen(__FILE__,'r');
var_dump(fstat($fp));
?>
Expected result:
----------------
Array
(
[dev] => 771
[ino] => 488704
[mode] => 33188
[nlink] => 1
[uid] => 0
[gid] => 0
[rdev] => 0
[size] => 1114
[atime] => 1061067181
[mtime] => 1056136526
[ctime] => 1056136526
[blksize] => 4096
[blocks] => 8
)
Actual result:
--------------
array(26) {
[0]=>
int(773)
[1]=>
int(115763)
[2]=>
int(33188)
[3]=>
int(1)
[4]=>
int(0)
[5]=>
int(0)
[6]=>
int(0)
[7]=>
int(77)
[8]=>
int(1103191522)
[9]=>
int(1103191522)
[10]=>
int(1103191522)
[11]=>
int(4096)
[12]=>
int(8)
["dev"]=>
int(773)
["ino"]=>
int(115763)
["mode"]=>
int(33188)
["nlink"]=>
int(1)
["uid"]=>
int(0)
["gid"]=>
int(0)
["rdev"]=>
int(0)
["size"]=>
int(77)
["atime"]=>
int(1103191522)
["mtime"]=>
int(1103191522)
["ctime"]=>
int(1103191522)
["blksize"]=>
int(4096)
["blocks"]=>
int(8)
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31115&edit=1