[php-src] Issue #14545: ksort extra sort flag SORT_RE_INDEX
| From: | remco-pc | Date: | Wed, 12 Jun 2024 11:26:49 +0000 |
| Subject: | [php-src] Issue #14545: ksort extra sort flag SORT_RE_INDEX | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247077@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14545
Author: remco-pc
### Description
can there become an extra sort flag for re-indexing the array starting from zero & up
ksort($array, SORT_NATURAL);
```
[0]=>
bool(true)
[3]=>
string(3) "and"
[4]=>
array(3) {
["attribute"]=>
string(4) "uuid"
["operator"]=>
string(6) "not-in"
["value"]=>
array(1) {
[0]=>
string(36) "58fe0cb0-17b9-4c14-af4f-2938ea423c72"
}
}
ksort($array, SORT_NATURAL | SORT_RE_INDEX);
# so above becomes:
[0]=>
bool(true)
[1]=>
string(3) "and"
[2]=>
array(3) {
["attribute"]=>
string(4) "uuid"
["operator"]=>
string(6) "not-in"
["value"]=>
array(1) {
[0]=>
string(36) "58fe0cb0-17b9-4c14-af4f-2938ea423c72"
}
}
```