Skip to content

Stdlib: AOT extract() EXTR_OVERWRITE + null TypeError (#27520) - #27843

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-27520-extract-aot
Aug 5, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/stdlib-27520-extract-aot

Conversation

@PurHur

@PurHur PurHur commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Closes Regression: AOT extract() compile fails — array_filter callback unsupported (ext/standard/array.c) #27520: thin AOT extract() no longer fails NestedJIT on array_filter()+callback; default EXTR_OVERWRITE imports named locals and prints world:7.
  • extract(null) throws catchable TypeError under AOT (3/3).
  • Root causes: NestedJIT-hostile array_filter in ScopeBuiltinJitHelper::matchNamedVariableIndex; EXTR_OVERWRITE uses LLVM JitStringCompare (avoids NestedJIT string-return resolve); script-global assign loads __value__* before copy; merge continues strKeys walk (avoids sealFunction ret void).

php-src: ext/standard/array.c — php_extract / PHP_FUNCTION(extract).

Test plan

  • php bin/vm.php test/repro/aot_extract_import_named.php → world:7
  • php bin/jit.php test/repro/aot_extract_import_named.php → world:7
  • php bin/compile.php -o /tmp/x test/repro/aot_extract_import_named.php && /tmp/x → world:7 (3×)
  • AOT $a=null; extract($a) → TypeError:…null given (3×)
  • vendor/bin/phpunit --filter ScopeBuiltinRuntimeShrinkTest OK
  • AotRegressionFixtureCatalog OK with new fixtures
  • Not covered: AOT compact() still has a separate module-verify signature mismatch; non-OVERWRITE EXTR_* still use NestedJIT resolve.

Made with Cursor

NestedJIT of ScopeBuiltinJitHelper failed on array_filter()+callback; EXTR_OVERWRITE now matches keys in LLVM and loads script-global __value__* before copy so thin AOT imports work.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit b0b02b0 into master Aug 5, 2026
1 check failed
@PurHur
PurHur deleted the agent/stdlib-27520-extract-aot branch August 5, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant