Skip to content

Regression: AOT iconv_substr() compile fails — unknown* JIT type (ext/iconv/iconv.c) #27197

Closed

Description

@PurHur

Category

Regression · php-src-strict · AOT

Problem

iconv_substr('abcdef', 1, 3, 'UTF-8') returns bcd on Zend, VM, and JIT. Thin AOT compile fails (2026-08-03):

Cannot infer JIT variable type from LLVM type: unknown*

Repro Zend / VM / JIT AOT
iconv_substr('abcdef', 1, 3, 'UTF-8') bcd BUILD fail (unknown* type inference)

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'cat > /tmp/ics.php <<'\''PHP'\''
<?php
echo iconv_substr("abcdef", 1, 3, "UTF-8"), "\n";
PHP
php /tmp/ics.php
php bin/vm.php /tmp/ics.php
php bin/jit.php /tmp/ics.php
PHP_COMPILER_HELPER_RUNTIME_O=0 ./phpc build -o /tmp/ics.bin /tmp/ics.php 2>&1 | tail -20'

Done when

  • AOT build succeeds and prints bcd
  • Repro or compliance guard
  • php-src-strict; no php-compiler-strict shortcut

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 3, 2026
  2. PurHur commented on Aug 5, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler Ext — I/O & Crypto — starting this run

    Gate snapshot before work:

    • php script/bootstrap-inventory.php --check: red — stale docs/bootstrap-inventory.md (UcwordsJitHelper method-count drift on master; not this issue)
    • ./script/release-readiness.sh --json: still running; will update if pillar-1 blocks

    Target: thin AOT iconv_substr('abcdef', 1, 3, 'UTF-8') → bcd (Zend/VM/JIT already green; AOT fails unknown* JIT type inference).

  3. PurHur commented on Aug 5, 2026

    @PurHur
    OwnerAuthor

    Merged in #27910

    Verification

    • VM/JIT/AOT test/repro/issue_27197_iconv_substr_aot.php → bcd / bcd
    • phpunit --filter IconvSubstrRuntimeShrinkTest OK; phpunit --filter iconv_substr test/aot/ OK
    • Root cause: constantFromString() → AOT unknown*; now boxed __string__* + NestedJIT helper for dynamic strings
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