ID:               42473
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ce at netage dot bg
-Status:           Bogus
+Status:           Verified
 Bug Type:         Output Control
-Operating System: linux
+Operating System: Irrelevant
 PHP Version:      5.2.4RC3
 New Comment:

I'm reproducing the bug on Windows XP, PHP 5.2.3, Apache 2.0.54.



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

[2007-08-30 11:32:59] [EMAIL PROTECTED]

I don't know what your php.ini settings are but I can't even reproduce
it..


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

[2007-08-30 09:54:51] ce at netage dot bg

from the documentation:

php://output allows you to write to the output buffer mechanism in the
same way as print() and echo().

(taken from http://www.php.net/manual/en/wrappers.php.php)

so from the written the following code

<?php

ob_start();

echo 'aaaaaaa';

$content = ob_get_clean();

header('Content-type: text/html');

echo $content;

______________

should be equivalent to the problematic code, but it it not! this code
with echo does not yeld the warning

either fix the documentation, either the bug

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

[2007-08-30 09:13:40] [EMAIL PROTECTED]

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

>From manual: 

"ob_get_clean() essentially executes both ob_get_contents() and
ob_end_clean()."

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

[2007-08-29 17:15:33] ce at netage dot bg

Description:
------------
it is actually a duplicate problem with 40429, but since you have
closed the bug I cannot reopen it, but it is still present with all
versions including the new 5.2.4RC3
when open through a browser, not a cli!


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


ob_start();

$fp = fopen('php://output', 'w');
fwrite($fp, 'aaaaaaa');
fclose($fp);


$content = ob_get_clean();

header('Content-type: text/html');

echo $content;


Expected result:
----------------
aaaaaaa

Actual result:
--------------
Warning: Cannot modify header information - headers already sent in
/var/www/test.php on line 13
aaaaaaa


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


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

Reply via email to