Bug #74574 [Com]: readline duplicates the input by twice

From: Date: Sun, 10 Feb 2019 21:17:26 +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-219473@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: petk@php.net 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: This happens due to different library usage. When PHP is compiled with ./configure --with-libedit --without-readline (using Libedit as a replacement for readline) only one foo is output. When PHP is compiled with --configure --with-readline (using GNU readline library), two foo strings are output. Previous Comments: ------------------------------------------------------------------------ [2017-05-11 16:15:01] yoanlin93 at gmail dot com 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 ------------------------------------------------------------------------ [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

« previous php.bugs (#219473) next »