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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
23 + 43 = ?
Subscribe to this entry?

 
 [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: Wed Apr 24 03:01:29 2024 UTC