From: [EMAIL PROTECTED] Operating system: linux PHP version: 4CVS-2003-12-31 (stable) PHP Bug Type: Output Control Bug description: implicit_flush not used in CLI, ob controlled by output_buffering
Description: ------------ In CLI implicit_flush is default to 1, however when using the reproducing code implicit_flush is not used but the value of output_buffering is taken into account. If output_buffering is 0 in php.ini then everything is fine but if in php.ini the value is 4096 (or probably some value that is > 0) the output is buffered no matter it's in CLI mode. Evenmore, flush()-ing also has no effect as can be seen in the actual output. This behaviour exists both in PHP_4_3 and in HEAD. Reproduce code: --------------- php -r 'echo printf("phpversion=%s\noutput_buffering=%s\nimplicit_flush=%s\n", phpversion(),ini_get("output_buffering"), ini_get("implicit_flush"));flush();$a="fubar\n"; echo $a; fubar_func();' Expected result: ---------------- As can be seen on execution 1 and 2 of the actual result PHP dies after a fatal error of calling undefined function and after that the output which is output before the call is feed to the console. Execution 3 and 4 show the behaviour which is expected to be normal but is only valid when output_buffering is 0 (implicit_flush as it can be seen is not taken into account). Actual result: -------------- Exection 1: PHP Fatal error: Call to undefined function fubar_func() in Command line code on line 1 phpversion=5.0.0RC1-dev output_buffering=4096 implicit_flush=1 fubar Execution 2: phpversion=5.0.0RC1-dev output_buffering=0 implicit_flush=1 fubar PHP Fatal error: Call to undefined function fubar_func() in Command line code on line 1 Execution 3: PHP Fatal error: Call to undefined function: fubar_func() in Command line code on line 1 phpversion=4.3.5-dev output_buffering=4096 implicit_flush=1 fubar Execution 4: phpversion=4.3.5-dev output_buffering=0 implicit_flush=1 fubar PHP Fatal error: Call to undefined function: fubar_func() in Command line code on line 1 -- Edit bug report at http://bugs.php.net/?id=26755&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26755&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26755&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26755&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26755&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26755&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=26755&r=needscript Try newer version: http://bugs.php.net/fix.php?id=26755&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26755&r=support Expected behavior: http://bugs.php.net/fix.php?id=26755&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26755&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26755&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26755&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26755&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26755&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26755&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26755&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26755&r=float