diff --git a/README.md b/README.md index 5c35b654..5875ef0e 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,13 @@ This repo contains the WIP PHP Language Specifications. To join the conversation, send a blank email to: -> [standards-subscribe@lists.php.net](mailto:standards-subscribe@lists.php.net) +> [standards+subscribe@lists.php.net](mailto:standards+subscribe@lists.php.net) Bug reports can be filed at: > [https://github.com/php/php-langspec/issues](https://github.com/php/php-langspec/issues) -The upstream url of this repo is: - - git@git.php.net:/php-langspec.git - -It is also mirrored on GitHub: +The upstream URL of this repo is: > [https://github.com/php/php-langspec](https://github.com/php/php-langspec) diff --git a/spec/00-specification-for-php.md b/spec/00-specification-for-php.md index a99db747..19e5b3d2 100644 --- a/spec/00-specification-for-php.md +++ b/spec/00-specification-for-php.md @@ -109,7 +109,6 @@ is distributed without any warranty. - [eval](10-expressions.md#eval) - [exit/die](10-expressions.md#exitdie) - [isset](10-expressions.md#isset) - - [print](10-expressions.md#print) - [Anonymous Function Creation](10-expressions.md#anonymous-function-creation) - [The `new` Operator](10-expressions.md#the-new-operator) - [Array Creation Operator](10-expressions.md#array-creation-operator) @@ -149,6 +148,7 @@ is distributed without any warranty. - [byRef Assignment](10-expressions.md#byref-assignment) - [Compound Assignment](10-expressions.md#compound-assignment) - [`yield` Operator](10-expressions.md#yield-operator) + - [Print expression](10-expressions.md#print-expression) - [Logical AND Operator (form 2)](10-expressions.md#logical-and-operator-form-2) - [Logical Exclusive OR Operator](10-expressions.md#logical-exclusive-or-operator) - [Logical Inclusive OR Operator (form 2)](10-expressions.md#logical-inclusive-or-operator-form-2) diff --git a/spec/04-basic-concepts.md b/spec/04-basic-concepts.md index bdb84eb0..6f99d468 100644 --- a/spec/04-basic-concepts.md +++ b/spec/04-basic-concepts.md @@ -516,12 +516,12 @@ We can remove all these handles using `$a = NULL` and `$b = NULL`: ``` [VSlot $a *]-->[VStore null] [HStore Point [VSlot $x *] [VSlot $y *] (dead)] | | -[VSlot $b *]-->[VStore null] [VStore int 2 (dead)]<--+ V +[VSlot $b *]-->[VStore null] [VStore int 2 (dead)]<--+ V [VStore int 1 (dead)] [HStore Point [VSlot $x *] [VSlot $y *] (dead)] | | - [VStore int 4 (dead)]<--+ V + [VStore int 4 (dead)]<--+ V [VStore int 6 (dead)] ``` @@ -750,7 +750,7 @@ assignment of other types. Recall the `Point` class from [the examples](#value-a V V [VStore int 10] [VStore Obj *] | - [HStore Point [VSlot $x *] [VSlot $y *]]<----+ + [HStore Point [VSlot $x *] [VSlot $y *]]<----+ | | V V [VStore int 1] [VStore int 3] @@ -782,7 +782,7 @@ the value assignment `$b = $a`: | | | +---------+ +---------+ | V V | -[VStore int 10] [VStore object *]-->[HStore Point [VSlot $x *] [VSlot $y *]]<---+ +[VStore int 10] [VStore object *]-->[HStore Point [VSlot $x *] [VSlot $y *]]<---+ | | V V [VStore int 1] [VStore int 3] @@ -830,7 +830,7 @@ implementation. Here is the first possible outcome: ``` [VSlot $a *]---->[VStore array *]---->[HStore Array [VSlot 0 *]] | -[VSlot $x *]-------------------------+ [VStore array *]<---+ +[VSlot $x *]-------------------------+ [VStore array *]<---+ | | [VSlot $b *]-->[VStore array *] | V | | [HStore Array [VSlot 0 *][VSlot 1 *]] @@ -852,7 +852,7 @@ Here is the second possible outcome: ``` [VSlot $a *]---->[VStore array *]---->[HStore Array [VSlot 0 *]] | -[VSlot $x *]-------------------------+ [VStore array *]<----+ +[VSlot $x *]-------------------------+ [VStore array *]<----+ | | [VSlot $b *]-->[VStore array *] | V | | [HStore Array [VSlot 0 *] [VSlot 1 *]] @@ -939,7 +939,7 @@ $b = $a; ``` [VSlot $a *]--->[VStore array *]--->[HStore Array [VSlot 0 *]] ^ | - | [VStore array *]<--+ + | [VStore array *]<--+ [VSlot $b *]--->[VStore Arr-D *]------+ | V [HStore Array [VSlot 0 *] [VSlot 1 *]] @@ -1001,7 +1001,7 @@ outcomes: ``` [VSlot $a *]---->[VStore array *]---->[HStore Array [VSlot 0 *]] | -[VSlot $b *]-->[VStore array *] [VStore Arr *]<---+ +[VSlot $b *]-->[VStore array *] [VStore Arr *]<---+ | | +----------------------+ +----------+ V V @@ -1036,7 +1036,7 @@ possible outcome: ``` [VSlot $a *]---->[VStore array *]---->[HStore Array [VSlot 0 *]] | -[VSlot $b *]-->[VStore array *] [VStore array *]<---+ +[VSlot $b *]-->[VStore array *] [VStore array *]<---+ | | V V [HStore Array [VSlot 0 *] [VSlot 1 *]] [HStore Array [VSlot 0 *] [VSlot 1 *]] @@ -1050,15 +1050,15 @@ possible outcome: | V | | [VStore string 'hi'] | V | - [VSlot $x *]--------------------->[VStore int 123]<--------+ + [VSlot $x *]--------------------->[VStore int 123]<--------+ ``` Here is the third possible outcome: ``` [VSlot $a *]---->[VStore array *-]---->[HStore Array [VSlot 0 *]] - | -[VSlot $b *]-->[VStore array *] [VStore array *]<---+ + | +[VSlot $b *]-->[VStore array *] [VStore array *]<---+ | | V V [HStore Array [VSlot 0 *] [VSlot 1 *]] [HStore Array [VSlot 0 *] [VSlot 1 *]] @@ -1068,11 +1068,11 @@ Here is the third possible outcome: V | V [VStore Arr-D *]-->[HStore Array [VSlot 0 *] [VSlot 1 *]] | [VStore string 'hi'] | | | - [VStore int 123]<-------+ | | + [VStore int 123]<-------+ | | V | [VStore string 'hi'] | | - [VSlot $x *]--------------------->[VStore int 123]<---------+ + [VSlot $x *]--------------------->[VStore int 123]<---------+ ``` The second and third possible outcomes show what can possibly happen if @@ -1204,7 +1204,7 @@ Will result in: | | | V V | [VStore int 1] [VStore int 3] | -[VSlot $b *]---------------->[VStore int 123]<---------------------------------------+ +[VSlot $b *]---------------->[VStore int 123]<---------------------------------------+ ``` ### Argument Passing @@ -1267,7 +1267,7 @@ some type(s) or to an instance of some other type. V V [VStore int 10] [VStore object *] | - [HStore ...]<---------+ + [HStore ...]<---------+ ``` Let us consider the result of `$b = clone $a`: @@ -1279,7 +1279,7 @@ Let us consider the result of `$b = clone $a`: | [VStore int 10] [VStore object *] +-----------------------+ | V | - [HStore Widget [VSlot $p1 *] [VSlot $p2 *]] +--->[HStore ...]<-+ + [HStore Widget [VSlot $p1 *] [VSlot $p2 *]] +--->[HStore ...]<-+ | | | V V | [VStore int 10] [VStore object *]----------+ diff --git a/spec/06-constants.md b/spec/06-constants.md index 06217185..8b23a2af 100644 --- a/spec/06-constants.md +++ b/spec/06-constants.md @@ -73,7 +73,6 @@ Constant Name | Description `E_USER_NOTICE` | `int`; User-generated warning message. This is like an `E_NOTICE`, except that `E_USER_NOTICE` is generated in PHP code by using the library function [`trigger_error`](http://www.php.net/trigger_error). `E_USER_WARNING` | `int`; User-generated warning message. This is like an `E_WARNING`, except that `E_USER_WARNING` is generated in PHP code by using the library function [`trigger_error`](http://www.php.net/trigger_error). `E_WARNING` | `int`; Run-time warnings (non-fatal errors). Execution of the script is not halted. -`E_USER_DEPRECATED` | `int`; User-generated warning message. This is like an `E_DEPRECATED`, except that `E_USER_DEPRECATED` is generated in PHP code by using the library function [`trigger_error`](http://www.php.net/trigger_error). `FALSE` | `bool`; the case-insensitive Boolean value `FALSE`. `INF` | `float`; Infinity `M_1_PI` | `float`; 1/pi diff --git a/spec/07-variables.md b/spec/07-variables.md index cfb17ff1..b280fda8 100644 --- a/spec/07-variables.md +++ b/spec/07-variables.md @@ -254,7 +254,7 @@ echo $colors[100]; // element with offset 100 is still undefined and NULL // is used as substitution value instead. Another // notice is emitted. -$b = &colors[100]; // a VSlot for $b is created which points to the array +$b = &$colors[100]; // a VSlot for $b is created which points to the array // element with the offset 100. An array element with // offset 100 was undefined but implicitly defined // because the assignment is byRef. Thus a VSlot for diff --git a/spec/08-conversions.md b/spec/08-conversions.md index e93183d3..069676d6 100644 --- a/spec/08-conversions.md +++ b/spec/08-conversions.md @@ -14,7 +14,7 @@ Conversions to `resource` and `null` types can not be performed. ## Converting to Boolean Type -The [result type] (http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting) is [`bool`](05-types.md#the-boolean-type). +The [result type](http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting) is [`bool`](05-types.md#the-boolean-type). If the source type is `int` or `float`, then if the source value tests equal to 0, the result value is `FALSE`; otherwise, the result value is `TRUE`. diff --git a/spec/09-lexical-structure.md b/spec/09-lexical-structure.md index 4a25908c..537c9936 100644 --- a/spec/09-lexical-structure.md +++ b/spec/09-lexical-structure.md @@ -683,7 +683,7 @@ b-prefix:: one of
 single-quoted-string-literal::
-   b-prefixopt   '   sq-char-sequenceopt   '
+   b-prefixopt   '   sq-char-sequenceopt   '
 
 sq-char-sequence::
    sq-char
@@ -691,10 +691,10 @@ b-prefix:: one of
 
 sq-char::
    sq-escape-sequence
-   \opt   any member of the source character set except single-quote (') or backslash (\)
+   \opt   any member of the source character set except single-quote (') or backslash (\)
 
 sq-escape-sequence:: one of
-   \'   \\
+   \'   \\
 
 b-prefix:: one of
    b   B
@@ -1065,7 +1065,7 @@ nowdoc-string-literal::
 
 
 nowdoc-string-literal::
-   b-prefixopt   <<<   '   name   '   new-line   hd-bodyopt   name   ;opt   new-line
+   b-prefixopt   <<<   '   name   '   new-line   hd-bodyopt   name   ;opt   new-line
 
**Constraints** diff --git a/spec/11-statements.md b/spec/11-statements.md index 39bd0ce1..61af9cc8 100644 --- a/spec/11-statements.md +++ b/spec/11-statements.md @@ -314,7 +314,7 @@ else // this else does go with the outer if
 namespace-definition:
-   namespace   name   ;
-   namespace   nameopt   compound-statement
+   namespace   namespace-name   ;
+   namespace   namespace-nameopt   compound-statement
 
**Constraints** diff --git a/spec/19-grammar.md b/spec/19-grammar.md index 1ebc1927..ae4117b8 100644 --- a/spec/19-grammar.md +++ b/spec/19-grammar.md @@ -170,7 +170,7 @@ The grammar notation is described in [Grammars section](09-lexical-structure.md# nowdoc-string-literal single-quoted-string-literal:: - b-prefixopt ' sq-char-sequenceopt ' + b-prefixopt ' sq-char-sequenceopt ' sq-char-sequence:: sq-char @@ -178,10 +178,10 @@ The grammar notation is described in [Grammars section](09-lexical-structure.md# sq-char:: sq-escape-sequence - \opt any member of the source character set except single-quote (') or backslash (\) + \opt any member of the source character set except single-quote (') or backslash (\) sq-escape-sequence:: one of - \' \\ + \' \\ b-prefix:: one of b B @@ -271,7 +271,7 @@ The grammar notation is described in [Grammars section](09-lexical-structure.md# \\ \$ \e \f \n \r \t \v nowdoc-string-literal:: - b-prefixopt <<< ' name ' new-line hd-bodyopt name ;opt new-line + b-prefixopt <<< ' name ' new-line hd-bodyopt name ;opt new-line operator-or-punctuator:: one of [ ] ( ) { } . -> ++ -- ** * + - ~ ! @@ -783,7 +783,7 @@ The grammar notation is described in [Grammars section](09-lexical-structure.md# switch-statement: switch ( expression ) { case-statementsopt } - switch ( expression ) : case-statementsopt endswitch; + switch ( expression ) : case-statementsopt endswitch ; case-statements: case-statement case-statementsopt @@ -964,11 +964,16 @@ The grammar notation is described in [Grammars section](09-lexical-structure.md#
 class-declaration:
-   class-modifieropt   class   name   class-base-clauseopt   class-interface-clauseopt   {   class-member-declarationsopt   }
+   class-modifiersopt   class   name   class-base-clauseopt   class-interface-clauseopt   {   class-member-declarationsopt   }
+
+class-modifiers:
+   class-modifier
+   class-modifiers   class-modifier
 
 class-modifier:
    abstract
    final
+   readonly
 
 class-base-clause:
    extends   qualified-name
@@ -1119,8 +1124,8 @@ The grammar notation is described in [Grammars section](09-lexical-structure.md#
 
 
 namespace-definition:
-   namespace   name   ;
-   namespace   nameopt   compound-statement
+   namespace   namespace-name   ;
+   namespace   namespace-nameopt   compound-statement
 
 namespace-use-declaration:
    use   namespace-function-or-constopt   namespace-use-clauses   ;