From:             adam at trachtenberg dot com
Operating system: *
PHP version:      5CVS-2004-03-05 (dev)
PHP Bug Type:     Network related
Bug description:  feof() broken for user-defined streams

Description:
------------
It looks like feof() doesn't work correctly in all cases 

for user-defined streams. It seems like the class 

stream_eof() method is not being called when feof() is 

invoked in PHP.



This works correctly using 4.3.5RC3, but not PHP 5 

current CVS. It also works correctly if I do an 

fpassthru() on the file pointer and let PHP handle the 

feof() check.

Reproduce code:
---------------
See VariableStream class in the manual: 



http://us2.php.net/manual/en/function.stream-wrapper-register.php



In particular the while(!feof()) bit.

Expected result:
----------------
line1

line2

line3

string(18) "line1

line2

line3

"



(This is what I get from PHP 4.3.5RC3)

Actual result:
--------------
string(18) "line1

line2

line3

"

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

Reply via email to