|  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
Avg. Score:3.3 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: Assigned:
Status: Closed Package: Streams related
PHP Version: 5.2CVS-2008-06-18 (CVS) OS: Linux (Debian)
Private report: No CVE-ID:
 [2008-06-18 18:24 UTC]
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:
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)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-03 16:59 UTC]
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
Thank you for the report, and for helping us make PHP better.

 [2014-06-13 08:11 UTC]
Automatic comment from SVN on behalf of salathe
Log: Add is_callable() to gettype()'s see also section

Patch by anonymous #45303
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 04:01:42 2015 UTC