#19883 [Com]: string concatenation bug
| From: | skaventruc at yahoo dot fr | Date: | Sun, 13 Oct 2002 14:41:44 +0000 |
| Subject: | #19883 [Com]: string concatenation bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-22294@lists.php.net to get a copy of this message | ||
ID: 19883
Comment by: skaventruc@yahoo.fr
Reported By: skaventruc@yahoo.fr
Status: Bogus
Bug Type: Strings related
Operating System: Windows NT
PHP Version: 4.2.0
New Comment:
maybe you do not consider it as a bug but it is quite
annoying when contatenating arguments, I personnaly
think that this is a lack of the parser/compiler to
do not detect that the '.' is not a part of the '2'
but it is an operator :
putting a '.' after the 2 doesn't change it's display.
$e = 2.3.'km'; // the dot after 2 followed by a digit
// indicate a float
'2.3km'
$e = 2..'km'; // is ok the the dot after 2 is useless
'2km'
$e = 2.'km'; // produce a parse error
$e = 2 .'km'; // is ok
'2km'
Previous Comments:
------------------------------------------------------------------------
[2002-10-12 22:50:10] sniper@php.net
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
------------------------------------------------------------------------
[2002-10-12 20:13:42] skaventruc@yahoo.fr
concatenation hazard ... on :
$a = 2;
echo 'c='.$a*2 .' ok';
it produce a good result : "c=4 ok"
but :
$a = 2;
echo 'c='.$a*2.' ok';
produce a parse error :
unexpected T_CONSTANT_ENCAPSED_STRING ...
also the following works :
echo 'c='.$a*2..' ok';
so it should be a bug when trying to see
"2." as a float when it is an integer followed by a concatenation
operator (that's the problem when using
operators that are also separators...)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19883&edit=1