From:             isak at hypergene dot com
Operating system: 
PHP version:      5.0.4
PHP Bug Type:     Feature/Change Request
Bug description:  stream_get_line() has ambiguous semantics

Description:
------------
It is impossible to use this function to read exactly one line of
arbitrary length, even if you call it multiple times and concatenates the
results to a buffer.

When the return value is equal to the length argument, you can't know what
this means. It can be either one of these cases:

1. You have read one full line, which is exactly as long as the given
length.
2. You have read part of one line, which is longer than the given length.

In case 1. you will go on and use the line, in case 2. you would want to
make another call and concatenate its result to your line buffer.

IMHO, the length argument really should be optional. It is obviously
possible to include the function stream_get_contents() in the PHP library,
therefore I can see no reason why the library should not be able to read
strings of arbitrary length.


-- 
Edit bug report at http://bugs.php.net/?id=33163&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33163&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33163&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33163&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33163&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33163&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33163&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33163&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33163&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33163&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33163&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33163&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33163&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33163&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33163&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33163&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33163&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33163&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33163&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33163&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33163&r=mysqlcfg

Reply via email to