Edit report at http://bugs.php.net/bug.php?id=52763&edit=1
ID: 52763
Comment by: amaury dot carrade at free dot fr
Reported by: amaury dot carrade at free dot fr
Summary: There is a problem in concatenation with strings and
functions
Status: Bogus
Type: Bug
Package: Unknown/Other Function
Operating System: Linux Kubuntu 10.04
PHP Version: 5.3.3
Block user comment: N
New Comment:
Sorry for this pseudo-bug.
I have not read very well the documentation...
Previous Comments:
------------------------------------------------------------------------
[2010-09-01 20:22:39] [email protected]
It's not a bug. Anything that outputs directly instead of returning the
result is
going to display out of order when inlined into an expression like that.
------------------------------------------------------------------------
[2010-09-01 20:19:36] amaury dot carrade at free dot fr
NOTE : I found this bug only, for the time being, whith var_dump
function and a personnal function dump() (same processing as var dump
plus '<pre>' and '</pre>')
------------------------------------------------------------------------
[2010-09-01 20:17:34] [email protected]
var_dump() can't be used inline like that. Use print_r() or
var_export() with the
return parameter set.
------------------------------------------------------------------------
[2010-09-01 20:14:24] amaury dot carrade at free dot fr
Description:
------------
There is a problem in concatenation.
When I write :
<?php
echo '<pre>' . var_dump($var) . '</pre>';
?>
PHP show the same result as :
<?php
echo var_dump($var) . '<pre></pre>';
?>
There is a solution (show below), but it is not practical
<?php
echo '<pre>';
echo var_dump($var) . '</pre>';
?>
Test script:
---------------
<?php
echo '<pre>' . var_dump($var) . '</pre>';
?>
Expected result:
----------------
<pre>The result of the function var_dump()</pre>
Actual result:
--------------
The result of the function var_dump()<pre></pre>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52763&edit=1