php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #41798 stat() gives -1 for value of [blocks] on windows for a valid input file.
Submitted: 2007-06-25 11:15 UTC Modified: 2007-08-16 13:32 UTC
From: nikhil dot gupta at in dot ibm dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5CVS-2007-06-25 (snap) OS: Windows
Private report: No CVE-ID: None
 [2007-06-25 11:15 UTC] nikhil dot gupta at in dot ibm dot com
Description:
------------
Using stat() function on a valid file on Windows operating system , gives -1 for [blocks] member of the  array returned by stat() function. On linux it outputs proper value.

In the documentation, it is mentioned that [rdev] and [blksize] members of the array returned by stat() function will output -1 on Windows operating function. I doubt, whether same will be applicable for [blocks] also?

If yes, then documentation might need the change.

Reproduce code:
---------------
<?php
$stat_array =  stat(__FILE__);
var_dump( $stat_array[12] );
var_dump( $stat_array['blocks'] );
?>

Expected result:
----------------
int(%d)
int(%d)

Actual result:
--------------
int(-1)
int(-1)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-25 17:45 UTC] tony2001@php.net
Reclassified as docu issue.
 [2007-08-16 13:32 UTC] vrana@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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Aug 14 07:00:03 2025 UTC