Bug #38098 [Com]: String concatenation
| From: | nicolas dot hureau at kwift dot com | Date: | Fri, 23 Jul 2010 09:34:19 +0000 |
| Subject: | Bug #38098 [Com]: String concatenation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-152657@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=38098&edit=1
ID: 38098
Comment by: nicolas dot hureau at kwift dot com
Reported by: wiart at yahoo dot com
Summary: String concatenation
Status: Bogus
Type: Bug
Package: Unknown/Other Function
Operating System: Linux (Fedora core 4) - AMD64
PHP Version: 5.1.4
New Comment:
Actually, operations are not permitted while declaring properties or
class
constants, and that is quite annoying.
For example:
public $two = 1 + 1;
or
const two = 1 + 1;
or
public static $two = 1 + 1;
won't compile.
Previous Comments:
------------------------------------------------------------------------
[2006-07-13 15:15:19] tony2001@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
------------------------------------------------------------------------
[2006-07-13 15:12:52] wiart at yahoo dot com
Description:
------------
reproduced with PHP 5.1.2 (sorry, no time to test with 5.1.4).
Impossible to concatenate strings in a class member declaration, it
generates a PHP "Parse error".
Very annoying when, for example, one want to create a member string
which is a concatenation of a text and a constant
Reproduce code:
---------------
<?php
class MyClass {
public $myString = 'test1'.'test2';
}
$myClass = new MyClass();
echo "Result is: ".$myClass->myString;
?>
Expected result:
----------------
Result is: test1test2
Actual result:
--------------
Parse error: parse error, unexpected '.', expecting ')' in
/home/wiart/genomequest/apache/web/GQ/lib/comparisonNew/HTMLlaunchform.php
on line 5
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=38098&edit=1