Req #16079 [Opn->Csd]: Allow '.' (concat) operator on static strings

From: Date: Sun, 12 Oct 2014 14:18:14 +0000
Subject: Req #16079 [Opn->Csd]: Allow '.' (concat) operator on static strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188027@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=16079&edit=1 ID: 16079 Updated by: nikic@php.net Reported by: steve dot venable at lmco dot com Summary: Allow '.' (concat) operator on static strings -Status: Open +Status: Closed Type: Feature/Change Request Package: Scripting Engine problem Operating System: * PHP Version: * -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: Supported in 5.6 Previous Comments: ------------------------------------------------------------------------ [2002-03-14 14:01:32] steve dot venable at lmco dot com I can understand requiring constants for static initialization. But can the parser be modified to support operators on constants for static initializations? This is especially true for long strings which I can't even break at the end of line for readability. (I almost submitted this as a bug :) Examples: $v = 1 + 2; // Okay static $s = 1 + 2; // Fails parse $v = "this long " ."string"; // Okay static $s = "this long " ."string"; // Fails parse Since only constants are involved the parser could collapse the expression without difficulty. This makes the code much more readable (again thinking of very long strings). In my case I'm building an array of error messages and don't want the array build to occur everytime the function is called, hence I made it static. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=16079&edit=1

« previous php.bugs (#188027) next »