From: alex at innovacomputing dot com Operating system: Debian 5.0.3/amd64 PHP version: 5.2.11 PHP Bug Type: Streams related Bug description: feof() returns true before reaching end of stream
Description: ------------ feof() seems to have broken on socket streams somewhere between version 5.2.9 and 5.2.11. When running the code included in this bug report on PHP 5.2.9, it returns "bool(false)", which is the correct behavior. However, when upgrading to PHP 5.2.11, feof() will incorrectly return "bool(true)". Note that I've only been able to reproduce this on a 64-bit server. PHP 5.2.11 on the 32-bit server that I've also tested with correctly returns "bool(false)". Reproduce code: --------------- <?php list($a, $b) = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP); fwrite($a, 'Test'); var_dump(feof($b)); Expected result: ---------------- bool(false) Actual result: -------------- bool(true) -- Edit bug report at http://bugs.php.net/?id=49706&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49706&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49706&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49706&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49706&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49706&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49706&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49706&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49706&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49706&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49706&r=support Expected behavior: http://bugs.php.net/fix.php?id=49706&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49706&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49706&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49706&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49706&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49706&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49706&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49706&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49706&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49706&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49706&r=mysqlcfg