#44818 [Opn->Fbk]: php://memory writeable when opened read only
| From: | jani@php.net | Date: | Thu, 30 Oct 2008 17:06:05 +0000 |
| Subject: | #44818 [Opn->Fbk]: php://memory writeable when opened read only | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-130330@lists.php.net to get a copy of this message | ||
ID: 44818
Updated by: jani@php.net
Reported By: davemastergeneral at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Streams related
Operating System: Linux csl1226 2.6.22-14-generic
PHP Version: 5.2CVS-2008-04-24 (snap)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2008-04-25 08:12:29] davemastergeneral at gmail dot com
Actually, expected result should be
bool(false)
For an error?
------------------------------------------------------------------------
[2008-04-24 12:45:24] davemastergeneral at gmail dot com
Description:
------------
I use php://memory to save resources when unit testing, I found it
possible to write to the stream despite opening it read only. Not sure
if this is the desired behaviour.
Reproduce code:
---------------
<?php
/**
* php://memory bug
*/
$fh = fopen('php://memory', 'r');
var_dump(fwrite($fh, 'dave'));
?>
Expected result:
----------------
int(0)
Actual result:
--------------
int(4)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44818&edit=1