#35507 [NEW]: feof does not report no-char on STDIN
| From: | dsp at tdcspace dot dk | Date: | Thu, 01 Dec 2005 17:47:42 +0000 |
| Subject: | #35507 [NEW]: feof does not report no-char on STDIN | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-89594@lists.php.net to get a copy of this message | ||
From: dsp at tdcspace dot dk
Operating system: win/nix
PHP version: 5.1.1
PHP Bug Type: Feature/Change Request
Bug description: feof does not report no-char on STDIN
Description:
------------
In a continous loop for processing data with options for
entering a process char (like 'q' for quit, etc.) - the
feof() does not report no input (EOF) from STDIN (keyboard).
note: This is about the CLI version
example: the loop should output ....<keypress char>....etc
do {
if ( !feof(STDIN) ) { $x = fgetc(STDIN); echo $x; }
echo '.';
}
while(true);
THE PHP MANUAL SAYS -------------------------
feof (PHP 3, PHP 4, PHP 5)
feof -- Tests for end-of-file on a file pointer
Description
bool feof ( resource handle )
Returns TRUE if the file pointer is at EOF or an error occurs (including
socket timeout); otherwise returns FALSE.
-----------------------------------------------
Apparantly "Tests for end-of-file on a file pointer" does
not TEST for anything !!
--
Edit bug report at http://bugs.php.net/?id=35507&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35507&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35507&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35507&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35507&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35507&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35507&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35507&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35507&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35507&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35507&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35507&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35507&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35507&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35507&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35507&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35507&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35507&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35507&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35507&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35507&r=mysqlcfg