com php-langspec: Property specify constant expressions: spec/10-expressions.md spec/19-grammar.md
[email protected] (Nikita Popov) Fri, 11 Nov 2016 20:42:03 +0000
| Newsgroups | php.standards.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: 84221d7a313f709c732d307f82932397f9a61f5d=0AAuthor: Nikita Pop= ov <[email protected]> Fri, 11 Nov 2016 21:42:03 +0100=0AParents: d6e= 4f5116578f267d7bb79c2bc73a27987289140=0ABranches: master=0A=0ALink: = http://git.php.net/?p=3Dphp-langspec.git;a=3Dcommitdiff;h=3D84221d7a313f709= c732d307f82932397f9a61f5d=0A=0ALog:=0AProperty specify constant expressions= =0A=0AChanged paths:=0A M spec/10-expressions.md=0A M spec/19-grammar.m= d=0A=0A=0ADiff:=0Adiff --git a/spec/10-expressions.md b/spec/10-expressions= .md=0Aindex 9705a18..5bff620 100644=0A--- a/spec/10-expressions.md=0A+++ b/= spec/10-expressions.md=0A@@ -3573,25 +3573,27 @@ and relative path) still a= re considered the same file.=0A =0A <pre>=0A <i>constant-expression:</i>= =0A- <i>array-creation-expression</i>=0A <i>expression</i>=0A </pre>= =0A =0A **Defined elsewhere**=0A =0A-* [*array-creation-expression*](#array= -creation-operator)=0A * [*expression*](#general-6)=0A =0A **Constraints**= =0A =0A-All of the *element-key* and *element-value* elements in=0A-[*array= -creation-expression*](#array-creation-operator) must be literals.=0A+The *= expression* may only use the following syntactic elements:=0A =0A-*expressi= on* must have a scalar type, and be a literal or the name of a [c-constant]= (06-constants.md#general).=0A+* [Literals](#literals). String literals must= not use interpolation.=0A+* [Array creation expressions](#array-creation-o= perator).=0A+* Unary operators `+`, `-`, `~`, `!`.=0A+* Binary operators `+= `, `-`, `*`, `/`, `%`, `.`, `**`, `^`, `|`, `&`,=0A+ `<`, `>`, `<=3D`, `>= =3D`, `<=3D>`, `=3D=3D`, `!=3D`, `=3D=3D=3D`, `!=3D=3D`, `&&`, `||`, `??`.= =0A+* [Conditional expressions](#conditional-operator).=0A+* [Subscript exp= ressions](#subscript-operator).=0A+* [Constant access expressions](#constan= t-access-expression).=0A+* [Class constant access expressions](#scope-resol= ution-operator).=0A =0A **Semantics**=0A =0A-A *constant-expression* is the= value of a c-constant. A *constant-expression*=0A-is required in several c= ontexts, such as in initializer values in a=0A-[*const-declaration*](14-cla= sses.md#constants) and default initial values in a [function=0A-definition]= (13-functions.md#function-definitions).=0A+A *constant-expression* evaluate= s to the value of the constituent *expression*.=0Adiff --git a/spec/19-gram= mar.md b/spec/19-grammar.md=0Aindex b28137e..f7c10ec 100644=0A--- a/spec/19= -grammar.md=0A+++ b/spec/19-grammar.md=0A@@ -844,7 +844,6 @@ The grammar no= tation is described in [Grammars section](09-lexical-structure.md#=0A =0A <= pre>=0A <i>constant-expression:</i>=0A- <i>array-creation-expression</= i>=0A <i>expression</i>=0A </pre>=0A