Commit fcede41
committed
ext/standard/array.c: implement transitive comparison for SORT_REGULAR
Add transitive comparison functions with deterministic ordering:
- Numeric types and numeric strings compare numerically
- Non-numeric strings sort after numeric types and numeric strings
- NaN sorts after all other numeric values
- Arrays recurse through transitive comparison
- Objects (same class) recurse through transitive property comparison
- Enums sort by object handle (stable grouping for array_unique)
Fixes GH-202621 parent 8398038 commit fcede41
File tree
7 files changed
+951
-23
lines changed- Zend
- ext/standard
- tests/array
- sort
7 files changed
+951
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2119 | 2119 | | |
2120 | 2120 | | |
2121 | 2121 | | |
| 2122 | + | |
| 2123 | + | |
2122 | 2124 | | |
2123 | 2125 | | |
2124 | 2126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2257 | 2257 | | |
2258 | 2258 | | |
2259 | 2259 | | |
| 2260 | + | |
| 2261 | + | |
2260 | 2262 | | |
2261 | 2263 | | |
2262 | 2264 | | |
| |||
2279 | 2281 | | |
2280 | 2282 | | |
2281 | 2283 | | |
| 2284 | + | |
| 2285 | + | |
2282 | 2286 | | |
2283 | 2287 | | |
2284 | 2288 | | |
| |||
2303 | 2307 | | |
2304 | 2308 | | |
2305 | 2309 | | |
| 2310 | + | |
| 2311 | + | |
2306 | 2312 | | |
2307 | 2313 | | |
2308 | 2314 | | |
| |||
3418 | 3424 | | |
3419 | 3425 | | |
3420 | 3426 | | |
| 3427 | + | |
| 3428 | + | |
3421 | 3429 | | |
3422 | 3430 | | |
3423 | 3431 | | |
| |||
3475 | 3483 | | |
3476 | 3484 | | |
3477 | 3485 | | |
| 3486 | + | |
| 3487 | + | |
3478 | 3488 | | |
3479 | 3489 | | |
3480 | 3490 | | |
| |||
3493 | 3503 | | |
3494 | 3504 | | |
3495 | 3505 | | |
| 3506 | + | |
| 3507 | + | |
3496 | 3508 | | |
3497 | 3509 | | |
3498 | 3510 | | |
| |||
0 commit comments