Skip to content

Stdlib: register array_uasort()/array_uksort() (Closes #5649) - #7933

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-5649-array-uasort-uksort
Jun 11, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-5649-array-uasort-uksort

Conversation

@PurHur

@PurHur PurHur commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Register array_uasort() and array_uksort() as Zend aliases delegating to existing uasort() / uksort() builtins (ext/standard/array.c php_array_uasort / php_array_uksort).
  • PHP-in-PHP only: thin delegate wrappers in ext/standard/array_uasort.php and array_uksort.php; no C runtime changes.

php-src reference

  • ext/standard/array.c — PHP_FUNCTION(array_uasort), PHP_FUNCTION(array_uksort)

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro-maintainer/parity_array_uasort_uksort.php
vendor/bin/phpunit --filter array_uasort_uksort
vendor/bin/phpunit --filter array_uksort_jit
php bin/compile.php -l test/repro-maintainer/parity_array_uasort_uksort.php
'

VM repro output:

true
true
array (
  'a' => 1,
  'b' => 2,
)
array (
  'a' => 2,
  'b' => 1,
)

PHPUnit: array_uasort_uksort OK (VM + JIT), array_uksort_jit OK (VM + JIT)

AOT: php bin/compile.php -l test/repro-maintainer/parity_array_uasort_uksort.php exit 0

Closes #5649

Made with Cursor

Closes #5649 — delegates to existing VM/JIT sort builtins with compliance coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit a2f217d into master Jun 11, 2026
@PurHur
PurHur deleted the agent/issue-5649-array-uasort-uksort branch June 11, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: array_uasort()/array_uksort() — user comparator sort builtins missing (ext/standard/array.c)

1 participant