xref: /php-src/ext/standard/tests/file/bug27619.phpt (revision f8d79582)
1--TEST--
2Bug #27619 (filters not applied to pre-buffered data)
3--FILE--
4<?php
5    $fp = tmpfile();
6    fwrite($fp, "this is a lowercase string.\n");
7    rewind($fp);
8
9    /* Echo out the first four bytes 'this' without applying filter
10       Remainder will get sucked into the read buffer though. */
11    echo fread($fp, 4);
12
13    stream_filter_append($fp, "string.toupper");
14
15    fpassthru($fp);
16?>
17--EXPECT--
18this IS A LOWERCASE STRING.
19