com php-langspec: Adjust for PHP 8 negative array key change: spec/10-expressions.md tests/expressions/postfix_operators/su bscripting_2.phpt
| From: | Nikita Popov | Date: | Mon, 08 Apr 2019 07:21:58 +0000 |
| Subject: | com php-langspec: Adjust for PHP 8 negative array key change: spec/10-expressions.md tests/expressions/postfix_operators/su bscripting_2.phpt | ||
| Groups: | php.standards.cvs | ||
| Request: | Send a blank email to standards--cvs+get-441@lists.php.net to get a copy of this message | ||
Commit: 51566692791bfab5250488f319831925ca0c1c3b
Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 8 Apr 2019 09:21:58 +0200
Parents: 2f0881e79809cb0e910b38208f60a46106a60cf3
Branches: master
Link: http://git.php.net/?p=php-langspec.git;a=commitdiff;h=51566692791bfab5250488f319831925ca0c1c3b
Log:
Adjust for PHP 8 negative array key change
Changed paths:
M spec/10-expressions.md
M tests/expressions/postfix_operators/subscripting_2.phpt
Diff:
diff --git a/spec/10-expressions.md b/spec/10-expressions.md
index 93c8112..a328960 100644
--- a/spec/10-expressions.md
+++ b/spec/10-expressions.md
@@ -888,9 +888,8 @@ and value of the result is the type and value of that element;
otherwise, the result is
NULL.
If *expression* is omitted, a new element is inserted. Its key has type
-int and is one more than the highest, previously assigned, non-negative
-int key for this array.. If this is the first element with a non-negative
-int key, key 0 is used.
+int and is one more than the highest, previously assigned int key for
+this array. If this is the first element with an int key, key 0 is used.
If the largest previously assigned int key is the largest integer value that can be
represented,
the new element is not added.
The result is the added new element, or NULL if the element was not added.
diff --git a/tests/expressions/postfix_operators/subscripting_2.phpt
b/tests/expressions/postfix_operators/subscripting_2.phpt
index c9c2b49...a269350 100644
--- a/tests/expressions/postfix_operators/subscripting_2..phpt
+++ b/tests/expressions/postfix_operators/subscripting_2.phpt
@@ -11,7 +11,7 @@ var_dump($a);
echo "------\n";
$a = array(-30 => 33, -10 => -11);
-var_dump($a[] = 991); // creates $a[0]
+var_dump($a[] = 991); // creates $a[-9]
var_dump($a);
echo "------\n";
@@ -170,7 +170,7 @@ array(3) {
int(33)
[-10]=>
int(-11)
- [0]=>
+ [-9]=>
int(991)
}
------