Bug #16081 Updated: doesn't seem to honor fopen stdin position in code

From: Date: Mon, 15 Apr 2002 04:00:05 +0000
Subject: Bug #16081 Updated: doesn't seem to honor fopen stdin position in code
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-4998@lists.php.net to get a copy of this message
ID: 16081 Updated by: php-bugs@lists.php.net Reported By: mlnog@mlong.org -Status: Feedback +Status: No Feedback Bug Type: Output Control Operating System: tru64 5.0a PHP Version: 4.1.2 New Comment: No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". Previous Comments: ------------------------------------------------------------------------ [2002-03-18 12:47:47] derek@web-solve.net I had the same problem running PHP 4.1.2 under RH 7.2, I downgraded to PHP 4.0.6 and everything was working correctly. The problem seems to be in 4.1.x ------------------------------------------------------------------------ [2002-03-14 14:56:22] mfischer@php.net Maybe it's your terminal buffering? Have you tried with 'flush();' after your print statements? ------------------------------------------------------------------------ [2002-03-14 14:51:20] mlnog@mlong.org It appears that if I have a fopen to stdin anywhere in my code that PHP will prompt for stdin at the beginning of its execution instead of where I put it in the code. The following example shows it: #!/usr/local/bin/php <? print "BEFORE\n"; $cd=fopen("php://stdin","r"); $cd2=fread($cd,1); print "AFTER\n"; ?> Now as soon as I execute it, it sits and waits for me to enter stdin, then prints BEFORE AFTER It should be showing BEFORE and then prompt for STDIN, unless there is something major I am missing here. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16081&edit=1

« previous php.bugs (#4998) next »