#49706 [Opn->Fbk]: feof() returns true before reaching end of stream
ID: 49706
Updated by: sjoerd@php.net
Reported By: alex at innovacomputing dot com
-Status: Open
+Status: Feedback
Bug Type: Streams related
Operating System: Debian 5.0.3/amd64
PHP Version: 5.2.11
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2009-09-29 07:21:28] tantaoui at gmail dot com
It works correctly for me in 5.2.10 but not in 5.2.11 under Windows
Server 2003. it seems to be OK in 5.2.12 (snapshot)
------------------------------------------------------------------------
[2009-09-29 06:20:08] alex at innovacomputing dot com
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 this bug report at http://bugs.php.net/?id=49706&edit=1
Thread (5 messages)