Category
bug · php-src-strict · stdlib · user-script AOT · pillar 4
Problem
asort / ksort match Zend on VM and JIT, but thin AOT fails module verification with incorrect call arity. Sibling of #27227 (krsort/arsort same Module.php:180 failure).
Probed 2026-08-03 @ 3cf38597b.
| Repro |
Zend / VM / JIT |
AOT (2026-08-03) |
$a=['b'=>2,'a'=>1,'c'=>3]; asort($a); echo keys|values |
a,b,c|1,2,3 |
BUILD FAIL Module verification failed due to Incorrect number of arguments passed to called function! |
$a=…; ksort($a); … |
a,b,c|1,2,3 |
same BUILD FAIL |
Null-array probes also fail at compile with the same verify error (cannot reach TypeError path until build is fixed).
php-src reference
PHP implementation target
Repro
./script/docker-exec.sh -- bash -lc '
cat > /tmp/aot_asort.php <<'"'"'PHP'"'"'
<?php
$a = ["b" => 2, "a" => 1, "c" => 3];
asort($a);
echo implode(",", array_keys($a)), "|", implode(",", array_values($a)), "\n";
PHP
php bin/vm.php /tmp/aot_asort.php
php bin/jit.php /tmp/aot_asort.php
php bin/compile.php -o /tmp/aot_asort /tmp/aot_asort.php
/tmp/aot_asort
'
Done when
Refs #27227, #10533
Category
bug· php-src-strict · stdlib · user-script AOT · pillar 4Problem
asort/ksortmatch Zend on VM and JIT, but thin AOT fails module verification with incorrect call arity. Sibling of #27227 (krsort/arsortsame Module.php:180 failure).Probed 2026-08-03 @
3cf38597b.$a=['b'=>2,'a'=>1,'c'=>3]; asort($a); echo keys|valuesa,b,c|1,2,3Module verification failed due to Incorrect number of arguments passed to called function!$a=…; ksort($a); …a,b,c|1,2,3Null-array probes also fail at compile with the same verify error (cannot reach TypeError path until build is fixed).
php-src reference
ext/standard/array.c—PHP_FUNCTION(asort)/PHP_FUNCTION(ksort)ext/standard/array.stub.phpPHP implementation target
ext/standard+lib/JIT(same arity mismatch class as Regression: AOT krsort()/arsort() compile fails — Module verify arity (ext/standard/array.c) #27227 / 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)runtime/*.clogicRepro
Done when
phpc build/bin/compile.phpsucceeds forasortandksortkey/value echo reprostest/repro/guardRefs #27227, #10533