ID: 28247
Updated by: [EMAIL PROTECTED]
Reported By: aaron at wormus dot com
Status: Open
Bug Type: CGI related
-Operating System: Windows 2000
+Operating System: *
PHP Version: 5.0.0RC2
New Comment:
I don't think this is expected behavior.
As a workaround you can do this for now:
ll CVS|php -R 'echo $argn."\n";'
Previous Comments:
------------------------------------------------------------------------
[2004-05-02 10:02:13] aaron at wormus dot com
The original test that demonstrates this better is:
cat file.txt | php -B "echo ++$num. ' ';" -R "echo ++$num. '
'.fgets(STDIN);"
------------------------------------------------------------------------
[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