1--TEST--
2Bug #60455: stream_get_line and 1-line noeol input
3--FILE--
4<?php
5
6//It's critical the read on the stream returns the input but doesn't set EOF
7//flag the first time. This is why we need to use sockets.
8
9$domain = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' ? STREAM_PF_INET : STREAM_PF_UNIX);
10$sockets = stream_socket_pair($domain, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP)
11        or die("stream_socket_pair");
12fwrite($sockets[0], "a");
13stream_socket_shutdown($sockets[0], STREAM_SHUT_RDWR);
14
15$f = $sockets[1];
16while (!feof($f)) {
17    $line = stream_get_line($f, 99, "\n");
18    var_dump($line);
19}
20?>
21--EXPECT--
22string(1) "a"
23