#27224 [NEW]: var_dump() cannot be stopped from output
| From: | reklov at unitedklasens dot de | Date: | Wed, 11 Feb 2004 20:50:38 +0000 |
| Subject: | #27224 [NEW]: var_dump() cannot be stopped from output | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-54780@lists.php.net to get a copy of this message | ||
From: reklov at unitedklasens dot de
Operating system: Win98SE
PHP version: 4.3.4
PHP Bug Type: Unknown/Other Function
Bug description: var_dump() cannot be stopped from output
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 bug report at http://bugs.php.net/?id=27224&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27224&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27224&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27224&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27224&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27224&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27224&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27224&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27224&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27224&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27224&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27224&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27224&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27224&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27224&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27224&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27224&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27224&r=float