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