Ask a Question related to PHP Development, Design and Development.
-
duerra at yahoo dot com #1
#24627 [NEW]: feof always returns false
From: duerra at yahoo dot com
Operating system: XP Pro
PHP version: 4.3.3RC1
PHP Bug Type: Filesystem function related
Bug description: feof always returns false
Description:
------------
In PHP 4.3.3RC1, feof (Windows) always returns false in the code provided
below, and goes into an endless loop.
Reproduce code:
---------------
$count = 0;
if ($handle = opendir("./"))
{
while (false !== ($file = readdir($handle)))
{
if(!is_dir($file) AND $file != '.' AND $file !='..' AND $file
!='default' AND (strstr($file, ".php") OR strstr($file, ".htm") OR
strstr($file, ".txt")))
{
if(!$open = fopen($file, "r"))
{
echo "Could Not Open File";
exit;
}
while(!feof($open))
{
$count++;
}
fclose($open);
}
}
}
echo $count;
Expected result:
----------------
123456
(or another number)
Actual result:
--------------
Infinite loop once a file is opened (I cut out the test code that I used
to verify that it's actually a bug in order to stay within the 20 line
limit).
--
Edit bug report at [url]http://bugs.php.net/?id=24627&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=24627&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=24627&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=24627&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=24627&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=24627&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=24627&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=24627&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=24627&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=24627&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=24627&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=24627&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=24627&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=24627&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=24627&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=24627&r=gnused[/url]
duerra at yahoo dot com Guest
-
mail() returns FALSE, no err msg
Sometimes my mail() function returns FALSE, but there is no error message. Error reporting is set to E_ALL. It seems to be a problem of the bcc:... -
#24627 [Bgs]: feof always returns false
ID: 24627 Updated by: sniper@php.net Reported By: duerra at yahoo dot com Status: Bogus Bug Type: ... -
#24627 [Opn->Bgs]: feof always returns false
ID: 24627 Updated by: elmicha@php.net Reported By: duerra at yahoo dot com -Status: Open +Status: ... -
#24627 [Bgs->Opn]: feof always returns false
ID: 24627 User updated by: duerra at yahoo dot com Reported By: duerra at yahoo dot com -Status: Bogus +Status: ... -
#24627 [Com]: feof always returns false
ID: 24627 Comment by: b_ulrich at t-online dot de Reported By: duerra at yahoo dot com Status: Open Bug Type: ...



Reply With Quote

