Bug #74574 [Com]: readline duplicates the input by twice
| From: | yoanlin93 at gmail dot com | Date: | Thu, 11 May 2017 16:15:02 +0000 |
| Subject: | Bug #74574 [Com]: readline duplicates the input by twice | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209072@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74574&edit=1
ID: 74574
Comment by: yoanlin93 at gmail dot com
Reported by: cornelius dot howl at gmail dot com
Summary: readline duplicates the input by twice
Status: Open
Type: Bug
Package: Readline related
Operating System: OSX
PHP Version: 7.1.4
Block user comment: N
Private report: N
New Comment:
After further investigation, I found the first "foo" was output by php, and the other one
was returned from readline().
This behavior is different from php 5.4~5.6
Previous Comments:
------------------------------------------------------------------------
[2017-05-11 16:11:44] cornelius dot howl at gmail dot com
Description:
------------
when piping string to the php executable, readline returns the duplicate input by twice.
Test script:
---------------
here is the simple script to reproduce this issue:
readline.php:
<?php echo readline(''); ?>
execute:
# echo foo | php readline.php
Expected result:
----------------
foo
Actual result:
--------------
foo
foo
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74574&edit=1