Category
stdlib · php-src-strict · ext/ldap · JIT/AOT lowering
Problem
ldap_count_entries() works on the VM via VmLdapNative::countEntries(), but compiled JIT/AOT calls still throw LogicException from call() in ext/ldap/ldap_search_builtins.php. Compiled PHP therefore cannot walk search results even though the PHP-side runtime already exists.
| Repro |
Zend 8.2+ |
VM |
JIT/AOT |
ldap_count_entries($ldap, $result) |
callable |
callable |
LogicException today |
php-src reference
PHP implementation target
ext/ldap/ldap_search_builtins.php — replace the JIT stub in ldap_count_entries::call()
ext/ldap/JitLdapResult.php + ext/ldap/LdapResultJitHelper.php — lower LDAP\Connection + LDAP\Result handles through PHP helper code
lib/JIT/Builtin/LdapRuntime.php — register the bridge; keep behavior in PHP, no new runtime/*.c logic
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && PHP_COMPILER_ENABLE_LDAP=1 php bin/vm.php test/repro/issue_ldap_count_entries_jit.php'
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && PHP_COMPILER_ENABLE_LDAP=1 php bin/jit.php test/repro/issue_ldap_count_entries_jit.php'
Done when
Category
stdlib· php-src-strict · ext/ldap · JIT/AOT loweringProblem
ldap_count_entries()works on the VM viaVmLdapNative::countEntries(), but compiled JIT/AOT calls still throwLogicExceptionfromcall()inext/ldap/ldap_search_builtins.php. Compiled PHP therefore cannot walk search results even though the PHP-side runtime already exists.ldap_count_entries($ldap, $result)LogicExceptiontodayphp-src reference
ext/ldap/ldap.c—PHP_FUNCTION(ldap_count_entries)ext/ldap/ldap.stub.php—function ldap_count_entries(\LDAP\Connection $ldap, \LDAP\Result $result): intPHP implementation target
ext/ldap/ldap_search_builtins.php— replace the JIT stub inldap_count_entries::call()ext/ldap/JitLdapResult.php+ext/ldap/LdapResultJitHelper.php— lowerLDAP\Connection+LDAP\Resulthandles through PHP helper codelib/JIT/Builtin/LdapRuntime.php— register the bridge; keep behavior in PHP, no newruntime/*.clogicRepro
Done when
LDAP\Connection+LDAP\Resultwith php-src-strict TypeErrors on bad argsintmatching VM/ldap_count_entries()(including-1when libldap reports error)runtime/*.clogic