Annotation of embedaddon/php/ext/standard/tests/streams/bug60455_04.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #60455: stream_get_line and 1-line with maxlen size followed by 0-length
3: read with EOL indication
4: --FILE--
5: <?php
6: class TestStream {
7: private $s = 0;
8: function stream_open($path, $mode, $options, &$opened_path) {
9: return true;
10: }
11: function stream_read($count) {
12: if ($this->s++ == 0)
13: return "a\n";
14:
15: return "";
16: }
17: function stream_eof() {
18: return $this->s >= 2;
19: }
20:
21: }
22:
23: stream_wrapper_register("test", "TestStream");
24:
25: $f = fopen("test://", "r");
26: while (!feof($f)) {
27: $line = stream_get_line($f, 2, "\n");
28: var_dump($line);
29: }
30: --EXPECT--
31: string(1) "a"
32: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>