#38836 [Opn->Bgs]: string concatenation operator does not work across multiple lines in classes

From: Date: Fri, 15 Sep 2006 07:02:06 +0000
Subject: #38836 [Opn->Bgs]: string concatenation operator does not work across multiple lines in classes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-102211@lists.php.net to get a copy of this message
ID: 38836 Updated by: tony2001@php.net Reported By: evoltech at 2inches dot com -Status: Open +Status: Bogus Bug Type: Strings related Operating System: Linux PHP Version: 5CVS-2006-09-15 (snap) New Comment: Expressions are not allowed when declaring class members and constants. Previous Comments: ------------------------------------------------------------------------ [2006-09-15 05:34:31] evoltech at 2inches dot com Description: ------------ PHP is great! I love this language, and I apreciate the work of the developers ... you are all very awesome! The following code works as I expect: <?php $var = "this" . "that" . "other\n"; print $var; ?> thisthatother When I use the concatenation operator in a class however I get a parse error. Reproduce code: --------------- <?php class foo { public static $var = "this" . "that" . "other\n"; } print foo::$var; ?> Expected result: ---------------- thisthatother Actual result: -------------- Parse error: syntax error, unexpected '.', expecting ',' or ';' ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38836&edit=1

« previous php.bugs (#102211) next »