rfc:arrayiterator-improvements
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:arrayiterator-improvements [2016/11/21 14:48] – wesnetmo | rfc:arrayiterator-improvements [2016/11/24 21:10] – wesnetmo | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== ArrayIterator improvements | + | ====== ArrayIterator improvements ====== |
- | * Version: | + | * Version: |
* Date: 2016-11-21 | * Date: 2016-11-21 | ||
* Author: @WesNetmo on Twitter - with Room 11's help | * Author: @WesNetmo on Twitter - with Room 11's help | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | This RFC proposes the addition of a couple of functions that would expose to userland | + | This RFC proposes the addition of a couple of functions that would expose to userland important features of PHP's (linked) hash-tables. |
- | important features of PHP's (linked) hash-tables. | + | |
- | ===== Add `ArrayIterator:: | + | ===== ArrayIterator:: |
- | This method would move the Iterator' | + | This method would move the Iterator' |
- | After calling | + | The existing method '' |
- | the specified | + | |
- | doesn't exist the method would return `false` | + | Specifically, if the given key is present in the array the method would successfully return '' |
- | otherwise | + | |
+ | ===== ArrayIterator:: | ||
+ | |||
+ | This method would simply move the Iterator' | ||
- | The existing `ArrayIterator:: | ||
- | this is absolutely not ideal for many uses, as what it does is simply iterating over the | ||
- | array to reach the specified position (or key, assuming the array is a list). Instead, the | ||
- | proposed method `ArrayIterator:: | ||
- | immediately jump to the Entry identified by the specified `$key`. | ||
- | ===== Add `ArrayIterator:: | ||
- | This method would simply move the Iterator' | ||
- | table' | ||
- | `null`, but if there is no previous Entry, after calling it, an immediate call to the | ||
- | `valid()` method would return `false`. | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
Line 44: | Line 36: | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
- | Accept | + | Accept ArrayIterator:: |
- | Requires a 50% + 1 majority. | + | |
- | *votes* | + | * vote 1 * |
- | Accept | + | Accept ArrayIterator:: |
- | Requires a 50% + 1 majority. | + | |
- | *votes* | + | * vote 2 * |
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
- | N/A | + | None yet. |
+ | |||
+ | ===== References ===== | ||
+ | [[http:// |
rfc/arrayiterator-improvements.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1