|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-04-22 16:35 UTC] ab@php.net
[2017-04-22 16:35 UTC] ab@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 21:00:01 2025 UTC |
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.