ID:               25701
 Updated by:       [EMAIL PROTECTED]
 Reported By:      scottmacvicar at ntlworld dot com
 Status:           Verified
 Bug Type:         Apache2 related
 Operating System: *
 PHP Version:      4CVS
 New Comment:

&& != AND (but it doesn't make any difference in this script,
 just wanted to mention it's wrong :)



Previous Comments:
------------------------------------------------------------------------

[2003-09-30 14:44:20] kier at ap3d dot com

Can you explain *why* using 'AND' instead of '&&' is wrong here?

Both 'AND' and '&&' have left associativity and with no other logical
operators in the expression, precedence should not be an issue...
right?

------------------------------------------------------------------------

[2003-09-30 14:25:16] [EMAIL PROTECTED]

btw. using AND here is wrong, you should use &&:

if (strpos(' ' . $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false
AND !headers_sent())


------------------------------------------------------------------------

[2003-09-30 09:56:26] scottmacvicar at ntlworld dot com

Description:
------------
Calling flush in Apache and Apache 2 produce different results.

Within Apache after calling flush you can still send headers as the
output buffer prevents it from actually being flushed.

Within Apache 2 after calling flush you can no longer send headers even
though headers_sent still returns false.


Reproduce code:
---------------
<?php

ob_start();

echo 'test';
flush();

$newtext = ob_get_clean();

if (strpos(' ' . $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false
AND !headers_sent())
{
        header('Content-Encoding: gzip');
        $newtext = gzencode($newtext, 1);
}

header('Content-Length: ' . strlen($newtext));
echo $newtext;

?>

Expected result:
----------------
test

Actual result:
--------------
binary data


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25701&edit=1

Reply via email to