php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70927 stream_filter_append() doesn't work for handles opened in 'x' mode
Submitted: 2015-11-17 09:30 UTC Modified: 2020-04-09 17:04 UTC
From: jon at tjs dot co dot uk Assigned: cmb (profile)
Status: Closed Package: Streams related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jon at tjs dot co dot uk
New email:
PHP Version: OS:

 

 [2015-11-17 09:30 UTC] jon at tjs dot co dot uk
Description:
------------
stream_filter_append() doesn't work for handles opened in 'x' mode, it would be helpful if the documentation was explicit about this (and any other modes it doesn't work with). 

---
From manual page: http://www.php.net/function.stream-filter-append
---



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-28 14:08 UTC] cmb@php.net
-Package: Documentation problem +Package: Streams related
 [2020-04-09 17:04 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-04-09 17:04 UTC] cmb@php.net
But it is possible to append stream filters to streams opened in
'x' mode, e.g.

<?php
$filename = __DIR__ . '/70927.txt';
$stream = fopen($filename, 'x');
stream_filter_append($stream, 'string.rot13', STREAM_FILTER_WRITE);
fwrite($stream, 'hello world');
fclose($stream);
echo file_get_contents($filename);
?>

outputs:

ryyb jbeyq
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC