|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #16079 Allow '.' (concat) operator on static strings
Submitted: 2002-03-14 14:01 UTC Modified: 2014-10-12 14:18 UTC
Avg. Score:4.4 ± 1.0
Reproduced:12 of 12 (100.0%)
Same Version:7 (58.3%)
Same OS:9 (75.0%)
From: steve dot venable at lmco dot com Assigned: nikic (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: * OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: steve dot venable at lmco dot com
New email:
PHP Version: OS:


 [2002-03-14 14:01 UTC] 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 :)

            $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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-02 02:41 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem -Operating System: All +Operating System: * -PHP Version: 4.1.1 +PHP Version: *
 [2014-10-12 14:18 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2014-10-12 14:18 UTC]
Supported in 5.6
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Dec 08 20:05:51 2022 UTC