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