Skip to content

Commit 9906e13

Browse files
committed
[skip ci] Update wording
1 parent cfc1bd7 commit 9906e13

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

ext/spl/spl_deque.stub.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ final class Deque implements IteratorAggregate, Countable, JsonSerializable, Arr
2121
/** Construct the Deque from the values of the Traversable/array, ignoring keys */
2222
public function __construct(iterable $iterator = []) {}
2323
/**
24-
* The final version of getIterator will iterate over a copy of the Deque's values taken at the time getIterator was called.
25-
* The iteration keys will be the offsets of the copy(0, 1, ...), and the values will be the values from front to back.
26-
*
27-
* i.e. `foreach($deque as $k => $v)` and `foreach($deque->toArray() as $k => $v)` will iterate over the same elements.
28-
*
29-
* This will be done to avoid surprises in case pushFront/popFront/clear are called.
30-
*
31-
* To access the current version of the Deque without making a copy,
32-
* use `for ($i = 0; $i < count($deque); $i++) { process($deque[$i]); }`.
24+
* Returns an iterator that accounts for calls to shift/unshift tracking the position of the front of the Deque.
25+
* Calls to shift/unshift will do the following:
26+
* - Increase/Decrease the value returned by the iterator's key()
27+
* by the number of elements added/removed to/from the front of the Deque.
28+
* (`$deque[$iteratorKey] === $iteratorValue` at the time the key and value are returned).
29+
* - Repeated calls to shift will cause valid() to return false if the iterator's
30+
* position ends up before the start of the Deque at the time iteration resumes.
31+
* - They will not cause the remaining values to be iterated over more than once or skipped.
3332
*/
3433
public function getIterator(): InternalIterator {}
3534
/** Returns the number of elements in the Deque. */

ext/spl/spl_deque_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 49a35ccd63900ec4e1bcb992357d1d3a211f999e */
2+
* Stub hash: 1e1fc67dd37c51352430e9ea9f4385a3e10b971e */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Deque___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iterator, IS_ITERABLE, 0, "[]")

0 commit comments

Comments
 (0)