From:             [EMAIL PROTECTED]
Operating system: Linux RH 8.0
PHP version:      4CVS-2003-08-28 (stable)
PHP Bug Type:     Output Control
Bug description:  CLI does not implicit flush output

Description:
------------
>From http://de.php.net/manual/en/features.commandline.php:

"It is desired that any output coming from print(), echo() and friends is
immediately written to the output and not cached in any buffer. You still
can use output buffering  if you want to defer or manipulate standard
output."

Right, that's exactly what you expect, when using CLI, but this only works
as long, as you don't have a php.ini, where output_buffering is enabled.
The unfortunate thing is only, you can't change it in your script, because
it's not PHP_INI_USER. The only way out, is either creating a php.ini for
CLI only, which hardly every installation has, by declaring -n in your
commandline, which isn't desirable either, when you rely on certain
settings in php.ini or by passing a -d output_buffering=0 on the
commandline, but I wasn't able to achieve this in a #!/usr/local/bin/php
line at the top of the script.

So, what we have here in my opinion is a contradictory situation, because
implicit_flush = 1 is overruled by outbut_buffering = 4096.


Reproduce code:
---------------
<?php
var_dump(ini_get("implicit_flush"));
sleep(2);
?>


Expected result:
----------------
string(1) "1"
<2 seconds of waiting>

Actual result:
--------------
<2 seconds of waiting>
string(1) "1"


-- 
Edit bug report at http://bugs.php.net/?id=25304&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25304&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25304&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25304&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25304&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25304&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25304&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25304&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25304&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25304&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25304&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25304&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25304&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25304&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25304&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25304&r=gnused

Reply via email to