note 118627 added to function.stream-filter-append
| From: | DanJ | Date: | Mon, 11 Jan 2016 19:23:09 +0000 |
| Subject: | note 118627 added to function.stream-filter-append | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204642@lists.php.net to get a copy of this message | ||
Note that stream filters applied to STDOUT are not called when outputting via echo or print.
This is easily demonstrated with the standard ROT13 filter:
<?php
stream_filter_append( STDOUT, "string.rot13" );
print "Hello PHP\n";
// Prints "Hello PHP"
fprintf( STDOUT, "Hello PHP\n" );
// Prints "Uryyb CUC"
?>
If you want to filter STDOUT, you may have better luck with an output buffering callback added via
ob_start:
http://php.net/manual/en/function.ob-start.php
At the time of this writing, there is an open PHP feature request to support echo and print for
stream filters:
https://bugs.php.net/bug.php?id=30583
----
Server IP: 72.52.91.14
Probable Submitter: 208.181.56.5
----
Manual Page -- http://php.net/manual/en/function.stream-filter-append.php
Edit -- https://master.php.net/note/edit/118627
Del: integrated -- https://master.php.net/note/delete/118627/integrated
Del: useless -- https://master.php.net/note/delete/118627/useless
Del: bad code -- https://master.php.net/note/delete/118627/bad+code
Del: spam -- https://master.php.net/note/delete/118627/spam
Del: non-english -- https://master.php.net/note/delete/118627/non-english
Del: in docs -- https://master.php.net/note/delete/118627/in+docs
Del: other reasons-- https://master.php.net/note/delete/118627
Reject -- https://master.php.net/note/reject/118627
Search -- https://master.php.net/manage/user-notes.php