php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14537 fgetc fails to return single charachter immediatly
Submitted: 2001-12-15 15:38 UTC Modified: 2002-08-23 21:53 UTC
From: junk-php at aontic dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.1.0 OS: Linux 2.4.7-10smp i686
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: junk-php at aontic dot com
New email:
PHP Version: OS:

 

 [2001-12-15 15:38 UTC] junk-php at aontic dot com
fgetc should have at least the option of returning a single charachter immediatly upon its entry, or another function should be defined (such as getchar()) that achieves similar functionality to fgetc(stdin) which return a single charachter immediatly. 

The following script allows the user to type more than a single charachter and only returns when the user hits enter. fgetc should simply block until a single charachter is entered and then return. 

This is missing functionality that can not be worked around easily as far as I can tell. 

Script:

$fp = fopen("php://stdin", "r");
$char = fgetc($fp);
echo $char;


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-15 22:23 UTC] yohgaki@php.net
Please search bug database before report.
This has been reported ;)
 [2001-12-16 05:46 UTC] yohgaki@php.net
Duplicate of Bug id #14003

 [2002-08-23 21:53 UTC] sniper@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 14:01:29 2024 UTC