Bug #74489 [NEW]: readline() immediately returns false in interactive console mode
| From: | webmaster_20170422 at cubiclesoft dot com | Date: | Sat, 22 Apr 2017 15:56:10 +0000 |
| Subject: | Bug #74489 [NEW]: readline() immediately returns false in interactive console mode | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-208715@lists.php.net to get a copy of this message | ||
From: webmaster_20170422 at cubiclesoft dot com
Operating system: Windows
PHP version: 7.1.4
Package: Readline related
Bug Type: Bug
Bug description:readline() immediately returns false in interactive console mode
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 bug report at https://bugs.php.net/bug.php?id=74489&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74489&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74489&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74489&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74489&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74489&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74489&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74489&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74489&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74489&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74489&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74489&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74489&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74489&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74489&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74489&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74489&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74489&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74489&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74489&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74489&r=mysqlcfg