2 Bug #60455: stream_get_line and 2 lines, one possibly empty
6 private $lines = array();
9 function stream_open($path, $mode, $options, &$opened_path) {
10 $this->lines[] = "a\n";
11 $this->lines[] = ($path == "test://nonempty2nd" ? "b\n" : "\n");
12 if ($path == "test://eofafter2nd")
16 function stream_read($count) {
17 if (key_exists($this->s++, $this->lines))
18 return $this->lines[$this->s - 1];
22 function stream_eof() {
23 return $this->s >= $this->eofth;
28 stream_wrapper_register("test", "TestStream");
30 $f = fopen("test://nonempty2nd", "r");
32 $line = stream_get_line($f, 99, "\n");
35 $f = fopen("test://", "r");
37 $line = stream_get_line($f, 99, "\n");
40 $f = fopen("test://eofafter2nd", "r");
42 $line = stream_get_line($f, 99, "\n");