From:             [EMAIL PROTECTED]
Operating system: windows XP
PHP version:      5.1.0b3
PHP Bug Type:     Filesystem function related
Bug description:  stream_eof() is opposite behavior from 5.0.4

Description:
------------
in 5.0.4, if stream_eof() returns false, feof() returns true, in 5.1.0b3,
if stream_eof() returns true, feof() returns true.

In addition to the small test below, a slightly larger real-world streams
test is available in cvs at pear/PHP_Archive/tests/eof.phpt

Reproduce code:
---------------
<?php
class Mystream
{
    static $a = false;
    function stream_open()
    {
        return true;
    }

    function stream_eof()
    {
        var_dump(self::$a);
        return self::$a;
    }

    function stream_seek()
    {
        return true;
    }

    function stream_tell()
    {
        return 0;
    }
}
stream_wrapper_register('testing', 'Mystream');
$fp = fopen('testing://blah', 'r');
var_dump(1, feof($fp));
fseek($fp, 100);
Mystream::$a = true;
var_dump(2, feof($fp));
?>

Expected result:
----------------
bool(false)
int(1)
bool(true)
bool(true)
int(2)
bool(false)

Actual result:
--------------
bool(false)
int(1)
bool(false)
bool(true)
int(2)
bool(true)

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

Reply via email to