rfc:array_part
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:array_part [2012/05/21 21:03] – no references cataphract | rfc:array_part [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2012-05-14 | * Date: 2012-05-14 | ||
* Author: Gustavo Lopes < | * Author: Gustavo Lopes < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 25: | Line 25: | ||
Each part specification shall have one of the following forms: | Each part specification shall have one of the following forms: | ||
- | * A sequential numeric array of indexes, which specifies that only the elements existing at those indexes will be kept. | + | * A non-empty |
* A single index, which specifies that only the element existing at that index will be kept. In this case the level will be collapsed onto the previous one, meaning all the arrays at that level will be replaced with its element the specified index. | * A single index, which specifies that only the element existing at that index will be kept. In this case the level will be collapsed onto the previous one, meaning all the arrays at that level will be replaced with its element the specified index. | ||
* A span part specification is an associative array. The following keys are allowed //start//, //end// and //step//. At least //start// or //end// must be specified. //start// and //end// are an index or a special value -- '' | * A span part specification is an associative array. The following keys are allowed //start//, //end// and //step//. At least //start// or //end// must be specified. //start// and //end// are an index or a special value -- '' | ||
Line 78: | Line 78: | ||
This is true. We must traverse the array from the start or the end to get to the n-th element. That's just the way PHP arrays are implemented. However, if you have numeric sequential arrays, you can use '' | This is true. We must traverse the array from the start or the end to get to the n-th element. That's just the way PHP arrays are implemented. However, if you have numeric sequential arrays, you can use '' | ||
+ | |||
+ | ===== Vote ===== | ||
+ | |||
+ | < | ||
+ | title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
===== Changelog ===== | ===== Changelog ===== | ||
Line 84: | Line 92: | ||
* 2012-05-21 Dropped recursion restriction, | * 2012-05-21 Dropped recursion restriction, | ||
* 2012-05-21 References are not preserved after all | * 2012-05-21 References are not preserved after all | ||
+ | * 2012-05-28 Vote opened | ||
rfc/array_part.1337634232.txt.gz · Last modified: 2017/09/22 13:28 (external edit)