|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-05-02 10:02 UTC] aaron at wormus dot com
[2004-05-02 10:42 UTC] helly@php.net
[2004-05-02 11:16 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 03:00:01 2025 UTC |
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