#45585 [NEW]: fread() return value for EOF inconsistent between PHP 5 and 6

From: Date: Mon, 21 Jul 2008 16:33:34 +0000
Subject: #45585 [NEW]: fread() return value for EOF inconsistent between PHP 5 and 6
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127075@lists.php.net to get a copy of this message
From: jani@php.net Operating system: * PHP version: 6CVS-2008-07-21 (CVS) PHP Bug Type: Filesystem function related Bug description: fread() return value for EOF inconsistent between PHP 5 and 6 Description: ------------ # echo "1" > /tmp/test.txt # php_5_2/sapi/cli/php -n -r '$fp=fopen("/tmp/test.txt", "r"); while(1) {$a=fread($fp, 8192); if (!$a) {var_dump($a); exit;}}' string(0) "" # php_5_3/sapi/cli/php -n -r '$fp=fopen("/tmp/test.txt", "r"); while(1) {$a=fread($fp, 8192); if (!$a) {var_dump($a); exit;}}' string(0) "" # php_6/sapi/cli/php -n -r '$fp=fopen("/tmp/test.txt", "r"); while(1) {$a=fread($fp, 8192); if (!$a) {var_dump($a); exit;}}' bool(false) -- Edit bug report at http://bugs.php.net/?id=45585&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45585&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45585&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45585&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45585&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45585&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45585&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45585&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45585&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45585&r=support Expected behavior: http://bugs.php.net/fix.php?id=45585&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45585&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45585&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45585&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45585&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45585&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45585&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45585&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45585&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45585&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45585&r=mysqlcfg

« previous php.bugs (#127075) next »