Skip to content

Regression: AOT krsort()/arsort() compile fails — Module verify arity (ext/standard/array.c) #27227

Description

@PurHur

Category

Stdlib · php-src-strict · AOT · pillar 4

Problem

krsort / arsort match Zend on VM and JIT, but thin AOT fails module verification with incorrect call arity (2026-08-03, e4059a309). Prior KeySort/ValueSort AOT routes (#13050 / #13053) regress at build time.

Repro Zend / VM / JIT AOT (2026-08-03)
$a=['b'=>2,'a'=>1,'c'=>3]; krsort($a); echo implode(',',array_keys($a)),'|',implode(',',array_values($a)); c,b,a|3,2,1 BUILD FAIL Module verification failed due to Incorrect number of arguments passed to called function! (Module.php:180)
$a=['a'=>2,'b'=>3,'c'=>1]; arsort($a); … b,a,c|3,2,1 same BUILD FAIL

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'cat >/tmp/aot_krsort.php <<'"'"'P'"'"'
<?php
$a=["b"=>2,"a"=>1,"c"=>3];
krsort($a);
echo implode(",", array_keys($a)), "|", implode(",", array_values($a)), "\n";
P
php bin/vm.php /tmp/aot_krsort.php
php bin/jit.php /tmp/aot_krsort.php
./phpc build -o /tmp/aot_krsort.bin /tmp/aot_krsort.php'

Done when

  • phpc build succeeds for krsort and arsort key/value echo repros
  • Native binary stdout matches Zend / VM / JIT
  • Compliance or test/repro/ guard
  • php-src-strict; no php-compiler-strict shortcut

Refs #13050, #13053, #10533

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions