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
Refs #13050, #13053, #10533
Category
Stdlib· php-src-strict · AOT · pillar 4Problem
krsort/arsortmatch 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.$a=['b'=>2,'a'=>1,'c'=>3]; krsort($a); echo implode(',',array_keys($a)),'|',implode(',',array_values($a));c,b,a|3,2,1Module 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,1php-src reference
ext/standard/array.c—PHP_FUNCTION(krsort)/PHP_FUNCTION(arsort)PHP implementation target
ext/standard+lib/JIT(re-php-in-php: route standalone AOT ksort/krsort through KeySortJitHelper PHP (#12770 completion) #13050 / php-in-php: route standalone AOT asort/arsort through ValueSortJitHelper PHP (#12771 completion) #13053 / php-in-php: JIT ksort/krsort — route LLVM through KeySortJitHelper PHP (#1492) #12770 / php-in-php: JIT asort/arsort — route LLVM through ValueSortJitHelper PHP (#1492) #12771)runtime/*.clogicRepro
Done when
phpc buildsucceeds forkrsortandarsortkey/value echo reprostest/repro/guardRefs #13050, #13053, #10533