From:             jasper at album dot co dot nz
Operating system: Linux
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  print_r, var_export, debug_print_backtrace use output 
buffering

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 bug report at http://bugs.php.net/?id=36563&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36563&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36563&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36563&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36563&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36563&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36563&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36563&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36563&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36563&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36563&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36563&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36563&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36563&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36563&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36563&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36563&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36563&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36563&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36563&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36563&r=mysqlcfg

Reply via email to