#35507 [Opn]: feof does not report no-char on STDIN

From: Date: Thu, 01 Dec 2005 17:58:30 +0000
Subject: #35507 [Opn]: feof does not report no-char on STDIN
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-89595@lists.php.net to get a copy of this message
ID: 35507 User updated by: dsp at tdcspace dot dk Reported By: dsp at tdcspace dot dk Status: Open Bug Type: Feature/Change Request Operating System: win/nix PHP Version: 5.1.1 New Comment: Better explain that the loop waits for a keyboard input despite there is no input. Previous Comments: ------------------------------------------------------------------------ [2005-12-01 18:47:38] dsp at tdcspace dot dk 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 this bug report at http://bugs.php.net/?id=35507&edit=1

« previous php.bugs (#89595) next »