#31929 [Csd->Opn]: Output Buffering Bug
| From: | sniper@php.net | Date: | Sat, 16 Apr 2005 14:02:07 +0000 |
| Subject: | #31929 [Csd->Opn]: Output Buffering Bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-77643@lists.php.net to get a copy of this message | ||
ID: 31929
Updated by: sniper@php.net
Reported By: clover at fromru dot com
-Status: Closed
+Status: Open
-Bug Type: Documentation problem
+Bug Type: Output Control
Operating System: WinXP, SuSe 9.2 (PHP:4.3...)
-PHP Version: 5.0.3
+PHP Version: 5.*
Previous Comments:
------------------------------------------------------------------------
[2005-04-13 11:36:00] derick@php.net
This is not a documentation bug, please revert your patch Jakub - this
also works fine in PHP 4.3 and should work fine in PHP 5.x.
------------------------------------------------------------------------
[2005-04-05 15:00:49] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
You can't even call functions using the output buffering functions like
print_r($expression, true) or highlight_file($filename, true) from a
callback function.
------------------------------------------------------------------------
[2005-02-11 07:56:34] clover at fromru dot com
Description:
------------
i'm using ob_start() with a callback function; internally in it i use
$res=var_export($var, TRUE) function but got an error:
[11-Feb-2005 08:28:15] PHP Fatal error: var_export() [<a
href='ref.outcontrol'>ref.outcontrol</a>]: Cannot use output buffering
in output buffering display handlers in E:\htdocs\index.php on line XXX
Reproduce code:
---------------
<?php
ob_start("my_shutdown_function");
function my_shutdown_function($buffer){
$var=headers_list();
$res=var_export($var, TRUE);
return($res);
}
print("something...");
?>
Expected result:
----------------
the "dump" of all sent headers instead of string "something..."
Actual result:
--------------
"PHP Fatal error..."
Comment: this error actually must be when i call var_dump() or
var_export($var, FALSE) in output buffering handler.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31929&edit=1