#27224 [Opn->Bgs]: var_dump() cannot be stopped from output
| From: | derick@php.net | Date: | Wed, 11 Feb 2004 20:52:54 +0000 |
| Subject: | #27224 [Opn->Bgs]: var_dump() cannot be stopped from output | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-54781@lists.php.net to get a copy of this message | ||
ID: 27224
Updated by: derick@php.net
Reported By: reklov at unitedklasens dot de
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Win98SE
PHP Version: 4.3.4
New Comment:
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 (http://nl3.php.net/ob_flush):
ob_flush -- Flush (send) the output buffer
see also:
http://nl3.php.net/manual/en/function.ob-get-clean.php
Previous Comments:
------------------------------------------------------------------------
[2004-02-11 15:50:38] reklov at unitedklasens dot de
Description:
------------
On the contrary to the tip in the documentation
(http://www.php.net/manual/en/function.var-dump.php), there's no chance
to stop var_dump() from outputting. Although you can save it with
output buffering into a string, it will be sent to output, anyway...
As you can see in the example, the var_dump()-output is sent to output
twice, first from var_dump(9), second from echo $output.
Reproduce code:
---------------
<pre>
<?php
$a = 'Output';
echo 'Output from var_dump():'."\n";
ob_start();
var_dump($a);
$output = ob_get_flush();
echo 'Same as above: '."\n".$output;
?>
</pre>
Expected result:
----------------
<pre>
Output from var_dump():
Same as above:
string(6) "Output"
</pre>
Actual result:
--------------
<pre>
Output from var_dump():
string(6) "Output"
Same as above:
string(6) "Output"
</pre>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27224&edit=1