|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-10-04 12:11 UTC] iliaa@php.net
[2002-10-04 13:53 UTC] iliaa@php.net
[2002-10-04 18:10 UTC] mreddin at nii dot net
[2002-10-04 18:12 UTC] iliaa@php.net
[2002-10-05 06:39 UTC] wez@php.net
[2002-10-05 13:56 UTC] mreddin at nii dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 05:00:02 2025 UTC |
In trying to take user input from Shell in the last two CVS snapshots using the SAPI-CLI, the following program [and many variations thereof] hang on STDIN [basically it takes unlimited input as if its not recognizing EOL]. This is under an Pentium-2, Redhat 7.3 with the latest glibc library off Redhat's update site. <?php function getInput($length) { $fr = fopen("php://stdin", "r"); $input = fgets($fr, $length); $input = rtrim($input); fclose($fr); return $input; } echo "Enter some text (10 char max): "; $text = getInput(10); echo "You entered: $text\n"; ?> This program works fine on an older php CGI style binary but does not work under the current snapshot. Have also tried the manual suggestion of using the new constant STDIN and that causes the same behavior - hence my suspicion this is a bug. Here is the modules compiled in [root@league league]# php -m [PHP Modules] xml tokenizer standard sockets session posix pcre pcntl overload mysql mbstring gd ctype zlib [Zend Modules]