|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-04-27 15:09 UTC] fabiogsilva at fabio0101 dot x-br dot com
Description:
------------
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:
---------------
<script>
var init_date = new Date();
</script>
<?
//Waiting 5 seconds to send the next JavaScript block...
sleep(5);
?>
<script>
var end_date = new Date();
alert("Init Date: " + init_date + "\nEnd Date: " + end_date);
</script>
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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |
To use another example, consider a script that simply prints plain text: <?php header("Content-Type: text/plain"); for($i = 0; $i < 10; $i++) { print "Line $i sent to client.\n"; sleep(1); } ?> No matter what browser we use, the result is the same.