#28247 [Opn]: CLI sapi option -R does not work as expected

From: Date: Sun, 02 May 2004 08:02:15 +0000
Subject: #28247 [Opn]: CLI sapi option -R does not work as expected
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-59121@lists.php.net to get a copy of this message
ID: 28247 User updated by: aaron at wormus dot com Reported By: aaron at wormus dot com Status: Open Bug Type: CGI related Operating System: Windows 2000 PHP Version: 5.0.0RC2 New Comment: The original test that demonstrates this better is: cat file.txt | php -B "echo ++$num. ' ';" -R "echo ++$num. ' '.fgets(STDIN);" Previous Comments: ------------------------------------------------------------------------ [2004-05-01 23:56:24] aaron at wormus dot com Description: ------------ the following command line script does not work as (I) expected. php -R "echo fgets(STDIN);" Instead of echoing every line, it echos every OTHER line. I am not sure if this is the expected behaviour. I suspect something to be wrong. If it is meant to happen, I would appreciate a short explaination :) I'm writing an article on the CLI SAPI and this one is stumping me! Aaron Reproduce code: --------------- php -R "echo fgets(STDIN);" Expected result: ---------------- I expected it to work like: perl -e "while (<STDIN>){print}" echoing every line as you type it. Actual result: -------------- Echoes every OTHER line ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28247&edit=1

« previous php.bugs (#59121) next »