Bug #52763 [Opn->Bgs]: There is a problem in concatenation with strings and functions
| From: | rasmus@php.net | Date: | Wed, 01 Sep 2010 18:22:39 +0000 |
| Subject: | Bug #52763 [Opn->Bgs]: There is a problem in concatenation with strings and functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-154031@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52763&edit=1
ID: 52763
Updated by: rasmus@php.net
Reported by: amaury dot carrade at free dot fr
Summary: There is a problem in concatenation with strings and
functions
-Status: Open
+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:
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.
Previous Comments:
------------------------------------------------------------------------
[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] rasmus@php.net
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