You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stdlib: sort() on float arrays with NAN — LogicException not Zend sort order (ext/standard/array.c) #10144
sort($arr, SORT_REGULAR) on arrays containing float values (including NAN) must use php-src comparison semantics. VM throws LogicException: sort() only supports homogeneous string or integer arrays instead of sorting.
Activity
PurHur commentedon Jul 4, 2026
claim: cursor-agent-lane-B — starting this run
PurHur commentedon Jul 4, 2026
Merged via #15788.
Fix: NaN-aware numeric compare in
VmInternalCompare::compareNumericScalarsForSort()— ascending sort places NaN before finite values; descending keeps NaN slots stable (php-src parity).Verification (docker-exec):
php test/repro/sort_float_nan.php/php bin/vm.php test/repro/sort_float_nan.php→ both print[NAN, 1.0, 3.0]then[3.0, NAN, 1.0]vendor/bin/phpunit --filter sort_float_nan→ OKStdlib: sort() float arrays with NAN match php-src order (#10144) (#1…