diff options
Diffstat (limited to 'ext/standard/tests')
-rw-r--r-- | ext/standard/tests/streams/bug46147.phpt | 14 | ||||
-rw-r--r-- | ext/standard/tests/streams/bug76859.phpt | 22 |
2 files changed, 36 insertions, 0 deletions
diff --git a/ext/standard/tests/streams/bug46147.phpt b/ext/standard/tests/streams/bug46147.phpt new file mode 100644 index 0000000000..bed2ee5472 --- /dev/null +++ b/ext/standard/tests/streams/bug46147.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #46147 (after stream seek, appending stream filter reads incorrect data) +--FILE-- +<?php +$fp = tmpfile(); +fwrite($fp, "this is a lowercase string.\n"); +fseek($fp, 5); +stream_filter_append($fp, "string.toupper"); +while (!feof($fp)) { + echo fread($fp, 5); +} + +--EXPECT-- +IS A LOWERCASE STRING. diff --git a/ext/standard/tests/streams/bug76859.phpt b/ext/standard/tests/streams/bug76859.phpt new file mode 100644 index 0000000000..268b06a01b --- /dev/null +++ b/ext/standard/tests/streams/bug76859.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #76859 (stream_get_line skips data if used with filters) +--FILE-- +<?php + +$data = '123'; + +$fh = fopen('php://memory', 'r+b'); +fwrite($fh, $data); +rewind($fh); +stream_filter_append($fh, 'string.rot13', STREAM_FILTER_READ); + +$out = ''; +while (!feof($fh)) { + $out .= stream_get_line($fh, 1024); +} + +fclose($fh); + +echo strlen($out) . "\n"; +--EXPECT-- +3 |