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: [email protected] Assigned:
Status: Closed Package: Streams related
PHP Version: 5.2CVS-2008-06-18 (CVS) OS: Linux (Debian)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: [email protected]
New email:
PHP Version: OS:

 

 [2008-06-18 18:24 UTC] [email protected]
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] [email protected]
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] [email protected]
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-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 28 06:00:02 2025 UTC