Skip to content

Regression: AOT extract() compile fails — array_filter callback unsupported (ext/standard/array.c) #27520

Closed

Description

@PurHur

Category

bug · php-src-strict · stdlib · user-script AOT · pillar 4

Problem

extract matches Zend on VM and JIT, but thin AOT fails at compile with array_filter() with a callback is not supported by the JIT compiler in this build. Happy-path symbol import never emits.

Probed 2026-08-03 @ 6f975866e.

Repro Zend / VM / JIT AOT (2026-08-03)
extract(['hello'=>'world','n'=>7]); echo $hello,':',$n; world:7 BUILD FAIL array_filter() with a callback…
extract(null) TypeError:…null given same BUILD FAIL

Related: compact('a','b') hits the same compile diagnostic (likely shared helper path) — fix once if the root is shared.

php-src reference

PHP implementation target

  • NestedJIT / AOT lowering for extract must not depend on unsupported array_filter-callback JIT path; implement extract helper in PHP (ext/standard + lib/JIT)
  • php-in-PHP first; no new runtime/*.c

Repro

./script/docker-exec.sh -- bash -lc '
cat > /tmp/issue_extract.php <<'\''PHP'\''
<?php
$arr = ["hello"=>"world", "n"=>7];
extract($arr);
echo $hello, ":", $n, "\n";
PHP
php bin/vm.php /tmp/issue_extract.php
php bin/jit.php /tmp/issue_extract.php
php bin/compile.php -o /tmp/issue_extract /tmp/issue_extract.php
'

Done when

  • AOT build succeeds; binary prints world:7 matching VM/JIT
  • extract(null) throws the same TypeError as VM/JIT
  • Prefer also unblocking compact() if it shares the root cause
  • Compliance/test/repro/ guard; php-src-strict

Refs #10533

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 STD Lib — starting this run

    Pillar probe before claim:

    Repro still red: php bin/compile.php for extract(['hello'=>'world','n'=>7]) → array_filter() with a callback is not supported by the JIT compiler in this build

  3. PurHur commented on Aug 5, 2026

    @PurHur
    OwnerAuthor

    Merged in #27843

    Verification

    • VM/JIT/AOT extract(['hello'=>'world','n'=>7]); echo \$hello,':',\$n → world:7 (AOT 3/3)
    • AOT \$a=null; extract(\$a) → TypeError (3/3)
    • ScopeBuiltinRuntimeShrinkTest + AotRegressionFixtureCatalog OK

    Not covered: AOT compact() still fails module verify (separate from array_filter root).

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