|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-02 02:41 UTC] jani@php.net
-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] nikic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nikic
[2014-10-12 14:18 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 18:00:01 2025 UTC |
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.