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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Sun Sep 27 14:01:24 2020 UTC