php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #64460 ob_start implicit flush content
Submitted: 2013-03-20 00:48 UTC Modified: 2013-08-06 10:34 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: valentiny510 at yahoo dot es Assigned: mike (profile)
Status: Not a bug Package: Output Control
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: valentiny510 at yahoo dot es
New email:
PHP Version: OS:

 

 [2013-03-20 00:48 UTC] valentiny510 at yahoo dot es
Description:
------------
I write this like a Request but I think is more a bug. According to documentation of ob_start:
"While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer." but is not true.
implicit_flush = Off or ob_implicit_flush( false ) are also useless.
Or change the documentation or change the function behaviour to act according to the documentation. When somebody active the buffering it expect to see the blank page until explicit call some flush functions right ? At least this said the docs.


Test script:
---------------
<?php
ob_start( );
echo 'Blah';


Expected result:
----------------
empty page

Actual result:
--------------
Blah <<< This should never shown


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-20 01:09 UTC] valentiny510 at yahoo dot es
P.S. I found something related Request #23877 "ob_implicit_flush does not work".

Damn, a 10 years bug/request again... Rasmus I think is time to upgrade the team not the documentation :D. Just joking..

But seriously guys, you cannot allow to happend thinks like this, I perfectly understand is a lot of work sometimes but 10 years... is something.. too much

I remember times when some of my clients calls me at midnight to fix their sites... what a happy days..
 [2013-07-30 19:16 UTC] mike@php.net
-Status: Open +Status: Not a bug -Operating System: Windows +Operating System: -Assigned To: +Assigned To: mike
 [2013-07-30 19:16 UTC] mike@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Quote:
"While output buffering is active..."

Output buffering will be disabled at request shutdown of course.
 [2013-08-06 07:03 UTC] valentiny510 at yahoo dot es
wait.. mike.. what .. ??
 [2013-08-06 10:33 UTC] yohgaki@php.net
-Type: Feature/Change Request +Type: Documentation Problem
 [2013-08-06 10:33 UTC] yohgaki@php.net
Unless you discard outputs, all buffered data is sent when execution is 
finished.
The documentation is a bit misleading. At least a user is confused by 
documentation.

http://www.php.net/manual/en/function.ob-start.php

> This function will turn output buffering on. While output buffering is active 
no output is sent from the script (other than headers), instead the output is 
stored in an internal buffer.

Adding "All buffered contents are sent when script execution is finished."?


Example #1
<?php

function callback($buffer)
{
  // replace all the apples with oranges
  return (str_replace("apples", "oranges", $buffer));
}

ob_start("callback");

?>
<html>
<body>
<p>It's like comparing apples to oranges.</p>
</body>
</html>
<?php

ob_end_flush();

?>

I think ob_end_flush() is not needed here. Or add buffered contents after 
ob_end_flush()?
 [2013-08-06 10:34 UTC] yohgaki@php.net
"Or add buffered contents after ob_end_flush()?"

should be

"Or add unbuffered contents after ob_end_flush()?"
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 07:01:30 2024 UTC