|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28182 Output is retained and is not sent immediately to client
Submitted: 2004-04-27 15:09 UTC Modified: 2004-04-27 17:24 UTC
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: fabiogsilva at fabio0101 dot x-br dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: Irrelevant OS: Linux/Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: fabiogsilva at fabio0101 dot x-br dot com
New email:
PHP Version: OS:


 [2004-04-27 15:09 UTC] fabiogsilva at fabio0101 dot x-br dot com
To illustrate the problem, I'll write a script that sends two JavaScript blocks that capture the client's current date.

I have written this code with and without buffer control, and the result is the same.

Reproduce code:
var init_date = new Date();

//Waiting 5 seconds to send the next JavaScript block...

var end_date = new Date();
alert("Init Date: " + init_date + "\nEnd Date: " + end_date);

Expected result:
The two dates should not be the same, because the first block  would be sent immediately, and the 2nd one 5 seconds later.

Actual result:
The two dates are the same. I have not experienced this problem with other languages such as ASP and Perl.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-27 15:43 UTC] luser at uvm dot edu
I can verify this on PHP 4.3.4 running on Solaris with Apache 1.3 and using Mozilla 1.6 (cause wouldn't this be really Javascript/Web browser dependent?).

However, output is sent immediately from the command-line in both PHP 4.3.4 and PHP 5.0.0RC3-dev (built: Apr 26 2004 21:02:28)
 [2004-04-27 17:16 UTC] fabiogsilva at fabio0101 dot x-br dot com
To use another example, consider a script that simply prints plain text:

header("Content-Type: text/plain");

for($i = 0; $i < 10; $i++) {
	print "Line $i sent to client.\n";

No matter what browser we use, the result is the same.
 [2004-04-27 17:24 UTC]
This is a feature, not a bug. Look at the 
output_buffering configuration directive in your php.ini 
file. To disable output buffering, set this value to 0.

Also, remember that some browsers (clients) will buffer 
input until it recieves a certain amount of data. There 
is nothing PHP can do about this.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Mar 22 23:04:45 2023 UTC