com php-langspec: Update spec for by-ref list RFC: spec/10-expressions.md spec/19-grammar.md
[email protected] (Nikita Popov) Fri, 15 Mar 2019 09:30:11 +0000
| Newsgroups | php.standards.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: ee9565cf6affd003280097f76cfa82f756e2305c=0AAuthor: David Walk= er <[email protected]> Fri, 30 Dec 2016 20:20:48 -0700=0ACommitter: = Nikita Popov <[email protected]> Fri, 15 Mar 2019 10:30:11 +0100=0A= Parents: 9d99cf029b84f40b99bdab0224c79dd89c09e41a=0ABranches: master=0A= =0ALink: http://git.php.net/?p=3Dphp-langspec.git;a=3Dcommitdiff;h=3D= ee9565cf6affd003280097f76cfa82f756e2305c=0A=0ALog:=0AUpdate spec for by-ref= list RFC=0A=0AChanged paths:=0A M spec/10-expressions.md=0A M spec/19-= grammar.md=0A=0A=0ADiff:=0Adiff --git a/spec/10-expressions.md b/spec/10-ex= pressions.md=0Aindex 8c8af69..0e8fc92 100644=0A--- a/spec/10-expressions.md= =0A+++ b/spec/10-expressions.md=0A@@ -2852,7 +2852,7 @@ keyed-list-expressi= on-list:=0A =0A list-or-variable:=0A list-intrinsic=0A- variable=0A+ '&= '? variable=0A -->=0A =0A <pre>=0A@@ -2874,7 +2874,7 @@ list-or-variable:= =0A =0A <i id=3D"grammar-list-or-variable">list-or-variable:</i>=0A <i><= a href=3D"#grammar-list-intrinsic">list-intrinsic</a></i>=0A- <i><a href= =3D"#grammar-variable">variable</a></i>=0A+ &<sub>opt</sub> <i><a h= ref=3D"#grammar-variable">variable</a></i>=0A </pre>=0A =0A **Constraints**= =0A@@ -2892,7 +2892,8 @@ At least one of the elements of the *list-expressi= on-list* must be non-empty.=0A **Semantics**=0A =0A This intrinsic assigns = one or more elements of the source array to the=0A-target variables. On suc= cess, it returns a copy of the source array. If the=0A+target variables. T= arget variables may be assigned by reference.=0A+On success, it will return= a copy of the source array. If the=0A source array is not an array or obje= ct implementing `ArrayAccess` no=0A assignments are performed and the retur= n value is `NULL`.=0A =0A@@ -2942,6 +2943,12 @@ list($arr[1], $arr[0]) =3D = [0, 1];=0A list($arr2[], $arr2[]) =3D [0, 1];=0A // $arr2 is [0, 1]=0A = =0A+$a =3D [1, 2];=0A+list(&$one, $two) =3D $a;=0A+ // $a[0] is 1, $a[1] i= s 2=0A+$one++;=0A+ // $a[0] is 2, $a[1] is 2=0A+=0A list("one" =3D> $one, = "two" =3D> $two) =3D ["one" =3D> 1, "two" =3D> 2];=0A // $one is 1, $two = is 2=0A list(=0A@@ -2952,6 +2959,13 @@ list(=0A "two" =3D> 2,=0A ];=0A = // $one is 1, $two is 2=0A+=0A+$a =3D ['one' =3D> 1, 'two' =3D> 2];=0A+li= st('one' =3D> &$one, 'two' =3D> $two) =3D $a;=0A+ // $a['one'] is 1, $a['t= wo'] is 2=0A+$one++;=0A+ // $a['one'] is 2, $a['two'] is 2=0A+=0A list(lis= t("x" =3D> $x1, "y" =3D> $y1), list("x" =3D> $x2, "y" =3D> $y2)) =3D [=0A = ["x" =3D> 1, "y" =3D> 2],=0A ["x" =3D> 3, "y" =3D> 4]=0Adiff --git a= /spec/19-grammar.md b/spec/19-grammar.md=0Aindex 0cc4f68..3755b4b 100644=0A= --- a/spec/19-grammar.md=0A+++ b/spec/19-grammar.md=0A@@ -657,7 +657,7 @@ T= he grammar notation is described in [Grammars section](09-lexical-structure= .md#=0A =0A <i id=3D"grammar-list-or-variable">list-or-variable:</i>=0A = <i><a href=3D"#grammar-list-intrinsic">list-intrinsic</a></i>=0A- <i><a h= ref=3D"#grammar-variable">variable</a></i>=0A+ &<sub>opt</sub> <i><= a href=3D"#grammar-variable">variable</a></i>=0A =0A <i id=3D"grammar-byref= -assignment-expression">byref-assignment-expression:</i>=0A <i><a href= =3D"#grammar-variable">variable</a></i> =3D & <i><a href=3D"#gram= mar-variable">variable</a></i>=0A