ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> phpdoc
phpdoc
[PHP-DOC] #36563 [Opn]: print_r, var_export, debug_print_backtrace use output buffering
by vrana other posts by this author
Mar 6 2006 5:14PM messages near this date
[PHP-DOC] #36563 [Opn->Csd]: print_r, var_export, debug_print_backtrace use output buffering | [PHP-DOC] cvs: phpdoc /en/reference/oci8/functions ocinewdescriptor.xml
ID:               36563
 Updated by:       vrana@[...].net
 Reported By:      jasper at album dot co dot nz
 Status:           Open
 Bug Type:         Documentation problem
 Operating System: Linux
 PHP Version:      Irrelevant
 New Comment:

"This function internally uses the output buffering with this parameter
so it can not be used inside ob_start() callback function." by
highlight_file(), highlight_string(), print_r() and var_export(). I see
nothing wrong with debug_print_backtrace().


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

[2006-02-28 19:57:04] jasper at album dot co dot nz

Description:
------------
It needs to be documented that print_r and var_export, with the second
parameter TRUE, internally use output buffering to return their result
rather than output it.

This causes them to fail when used within an output buffering callback
handler.

Alternatively, this could be changed to a feature request and the code
could be changed to not use output buffering.

Reproduce code:
---------------
<?php
function ob_handler( $in ) {
	return var_export( $in, true );
}

ob_start( 'ob_handler' );
echo "Hello";
?> 

Expected result:
----------------
'Hello'

Actual result:
--------------
Fatal error: var_export(): Cannot use output buffering in output
buffering display handlers in Command line code on line 2


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


-- 
Edit this bug report at http://bugs.php.net/?id=36563&edit=1
Thread:
Jasper At Album Dot Co Dot Nz
vrana
vrana

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved