private function readToEndOfLine($length)
    {
        $str = $this->stream->read($length);
        if ($str === false || $str === '') {
            return $str;
        }
        while (substr($str, -1) !== "\n") {
            $chr = $this->stream->read(1);
            if ($chr === false || $chr === '') {
                break;
            }
            $str .= $chr;
        }
        return $str;
    }
private function readToEndOfLine($length)
    {
        $str = $this->stream->read($length);
        if ($str === false || $str === '') {
            return $str;
        }
        while (substr($str, -1) !== "\n") {
            $chr = $this->stream->read(1);
            if ($chr === false || $chr === '') {
                break;
            }
            $str .= $chr;
        }
        return $str;
    }
private function readToEndOfLine ( $ length ) { $ str = $ this -> stream -> read ( $ length ) ; if ( $ str === false || $ str === '' ) { return $ str ; } while ( substr ( $ str , - 1 ) !== "\n" ) { $ chr = $ this -> stream -> read ( 1 ) ; if ( $ chr === false || $ chr === '' ) { break ; } $ str .= $ chr ; } return $ str ; }
Finds the next end-of-line character to ensure a line isn't broken up
while buffering.

@return string
Finds the next end - of - line character to ensure a line isn t broken up while buffering .