#43510 [Bgs->Opn]: stream_get_meta_data does not return same mode as used in fopen
| From: | helly@php.net | Date: | Thu, 06 Dec 2007 17:26:52 +0000 |
| Subject: | #43510 [Bgs->Opn]: stream_get_meta_data does not return same mode as used in fopen | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-120430@lists.php.net to get a copy of this message | ||
ID: 43510
Updated by: helly@php.net
Reported By: dz at bitxtender dot com
-Status: Bogus
+Status: Open
Bug Type: Streams related
Operating System: *
PHP Version: *
New Comment:
Reopening after discussions. David, please explain the reasoning
Previous Comments:
------------------------------------------------------------------------
[2007-12-06 13:50:09] helly@php.net
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
Why should the exact mode matter?
------------------------------------------------------------------------
[2007-12-06 03:15:34] dz at bitxtender dot com
Description:
------------
When an fopen() is done on an HTTP URL with mode "r", the
stream_get_meta_data() result returns "r+"
Reproduce code:
---------------
$meta = stream_get_meta_data(fopen('http://www.google.com/', 'r'));
var_dump($meta['mode']);
Expected result:
----------------
string 'r' (length=1)
Actual result:
--------------
string 'r+' (length=2)
------------------------------------------------------------------------
[2007-12-06 02:18:22] dz at bitxtender dot com
Description:
------------
When an fopen() is done on an HTTP URL with mode "r", the
stream_get_meta_data() result returns "r+"
Reproduce code:
---------------
$f = fopen('http://www.google.com/',
'r');
var_dump(stream_get_meta_data($f['mode']));
Expected result:
----------------
string 'r' (length=1)
Actual result:
--------------
string 'r+' (length=2)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43510&edit=1