Bug #74489 [Opn->Csd]: readline() immediately returns false in interactive console mode
| From: | ab@php.net | Date: | Sat, 22 Apr 2017 16:35:50 +0000 |
| Subject: | Bug #74489 [Opn->Csd]: readline() immediately returns false in interactive console mode | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208717@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74489&edit=1
ID: 74489
Updated by: ab@php.net
Reported by: webmaster_20170422 at cubiclesoft dot com
Summary: readline() immediately returns false in interactive
console mode
-Status: Open
+Status: Closed
Type: Bug
Package: Readline related
Operating System: Windows
PHP Version: 7.1.4
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=000fe3aacce427eba082f12610b3b50f025b5e6a
Log: Fixed bug #74489 readline() immediately returns false in interactive console mode
Previous Comments:
------------------------------------------------------------------------
[2017-04-22 15:56:01] webmaster_20170422 at cubiclesoft dot com
Description:
------------
As of PHP 7.1, the readline extension is compiled into PHP for Windows. Unfortunately, calling
readline() with no parameters immediately returns false. No PHP notices, warnings, or errors are
emitted.
I'm using Windows 10, PHP 7.1.4 (from windows.php.net), and a plain ol' Command Prompt
(not elevated).
'php -i' shows:
readline
Readline Support => enabled
Readline library => WinEditLine
Looking at the source code, it looks like WinEditLine expects a non-null value to be passed into
readline(). Passing an empty string appears to work (readline("")) but the PHP
documentation says the parameter is optional.
Test script:
---------------
<?php
var_dump(readline());
?>
Expected result:
----------------
Wait for user input and dump the string when the user presses Enter.
Actual result:
--------------
readline() with no parameters immediately returns a value of false.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74489&edit=1