php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45303 Opening php:// wrapper in append mode results in a warning
Submitted: 2008-06-18 18:24 UTC Modified: 2008-11-03 16:59 UTC
Votes:3
Avg. Score:3.3 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: nforbes@php.net Assigned:
Status: Closed Package: Streams related
PHP Version: 5.2CVS-2008-06-18 (CVS) OS: Linux (Debian)
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nforbes@php.net
New email:
PHP Version: OS:

 

 [2008-06-18 18:24 UTC] nforbes@php.net
Description:
------------
When attempting to fopen any php:// wrapper in append mode (which 
should be equivalent to writing), PHP gives the following warning 
before returning the resource:

fopen(): cannot seek on a pipe

The resource returned behaves properly.

Reproduce code:
---------------
<?php
var_dump(fopen("php://stdout", "a"));
var_dump(fopen("php://stdin", "a"));
var_dump(fopen("php://stderr", "a"));
?>

Expected result:
----------------
Warning: fopen(): cannot seek on a pipe in <...> on line 2
resource(5) of type (stream)

Warning: fopen(): cannot seek on a pipe in <...> on line 3
resource(6) of type (stream)

Warning: fopen(): cannot seek on a pipe in <...> on line 4
resource(7) of type (stream)


Actual result:
--------------
resource(5) of type (stream)
resource(6) of type (stream)
resource(7) of type (stream)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-03 16:59 UTC] lbarnaud@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2014-06-13 08:11 UTC] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=333768
Log: Add is_callable() to gettype()'s see also section

--
Patch by anonymous #45303
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 20:01:27 2024 UTC