From:             
Operating system: 
PHP version:      5.3.8
Package:          Output Control
Bug Type:         Bug
Bug description:ob_implicit_flush is brain-damaged or something I dunno

Description:
------------
I'm trying to use output buffering in CLI to log output as it's echoed. But
ob_implicit_flush is a bunch of feral cock. Look at this bullpoop:

Test script:
---------------
ob_start(function ($s) {
        return "[" . strlen($s) . "]";
});
ob_implicit_flush(true);
for (;;) echo '.';

Expected result:
----------------
[1][1][1][1][1][1][1][1]... ad infinitum

Actual result:
--------------
Nothing is ever displayed.

Memory usage goes up and up until the script crashes. PHP would be quite
happy apparently to consume additional universes if it could get more
memory out of it to fill with "."'s.

The documentation says "Implicit flushing will result in a flush operation
after every output call". Well maybe it does do that, I don't know, but
whatever it's doing it doesn't generate the result implied by the
documentation. It's a God-damn lie in spirit. I feel betrayed.

Try to specify 1 as the buffer size to ob_start as a workaround. Just TRY
IT, and watch the sheer audacity of the thing as it calmly prints out
[4096][4096][4096][4096][4096][4096].... Because apparently some herp-derp
let's-just-add-random-quirks-for-laughs moron at PHP bollocksing years ago
decided 1 = 4 kB. That's a nice idea isn't it. That's real fucking neato.

The best I can get apparently is to specify a buffer size of 2 to ob_start,
which will cause [2][2][2][2][2][2][2][2][2][2]....

But that's no fucking good because individual characters won't echo until
another one happens to come along. THIS IS A PROGRAMMING LANGUAGE NOT THE
BUS STOP.

If you can't make ob_implicit_flush do what it blatantly claims it will do
could you at least make -1 to ob_start a synonym for a real 1 so this can
be made to work. Thanks very much. Meanwhile I'll just go and drown myself
in a see of hideous synonym functions ("echo2($boop);",
"var_dump2($blah);"). Don't worry about me, I completely enjoy that.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=60175&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=60175&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=60175&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=60175&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=60175&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=60175&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=60175&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=60175&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=60175&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=60175&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=60175&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=60175&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=60175&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=60175&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=60175&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=60175&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=60175&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=60175&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=60175&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=60175&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=60175&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=60175&r=mysqlcfg

Reply via email to