com php-langspec: consistency in byRef assignments: spec/php-spec-draft.md

From: Date: Wed, 30 Jul 2014 22:06:34 +0000
Subject: com php-langspec: consistency in byRef assignments: spec/php-spec-draft.md
Groups: php.standards 
Request: Send a blank email to standards-+get-160@lists.php.net to get a copy of this message
Commit: 75abe71a0912475f079d42c36ce1f38ba0f877d2 Author: Jonas Nyrup <jnyrup@gmail.com> Thu, 31 Jul 2014 00:06:34 +0200 Parents: 10a77a79579a09ec8da82a4d67455f3b4ba96f69 Branches: master Link: http://git.php.net/?p=php-langspec.git;a=commitdiff;h=75abe71a0912475f079d42c36ce1f38ba0f877d2 Log: consistency in byRef assignments some places =& is used, while other places = & is used. Changed paths: M spec/php-spec-draft.md Diff: diff --git a/spec/php-spec-draft.md b/spec/php-spec-draft.md index 2864a7d..157eb84 100644 --- a/spec/php-spec-draft.md +++ b/spec/php-spec-draft.md @@ -990,8 +990,8 @@ It is also possible to use byRef assignment to make three or more VSlots point to the same VStore. Consider the following example: ``` -$b = &$a; -$c = &$b; +$b =& $a; +$c =& $b; $a = 123; ``` <pre> @@ -1144,7 +1144,7 @@ as follows: - If $source’s VStore has a refcount that is greater than 1, the Engine uses an implementation-defined algorithm to decide whether to copy the element using value assignment ($destination = $source) or byRef - assignment ($destination = &$source). + assignment ($destination =& $source). Note the member-copy assignment =* is **not** an operator or language construct in the PHP language, but instead it is used internally to @@ -5851,14 +5851,14 @@ expression having array type, see [§§](#deferred-array-copying). ``` $a = 10; -$b = &$a; // make $b an alias of $a +$b =& $a; // make $b an alias of $a ++$a; // increment $a/$b to 11 $b = -12; // sets $a/$b to -12 $a = "abc"; // sets $a/$b to "abc" unset($b); // removes $b's alias to $a // ----------------------------------------- function &g2() { $t = "xxx"; return $t; } // return byRef -$b = &g2(); // make $b an alias to "xxx" +$b =& g2(); // make $b an alias to "xxx" ``` ##Compound Assignment

« previous php.standards (#160) next »