Skip to content

Stdlib: extract() and compact() for template includes (#275) - #373

Merged
PurHur merged 1 commit into
masterfrom
issue-275-extract-compact
May 20, 2026
Merged

PurHur merged 1 commit into
masterfrom
issue-275-extract-compact

Conversation

@PurHur

@PurHur PurHur commented May 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement extract() and compact() on the VM path for string-keyed arrays and literal compact() name lists.
  • Link the caller Frame when invoking internal builtins so scope import targets the correct compiled locals.
  • Add compliance PHPT coverage (extract_compact, extract_skip) and register builtins in ext/standard/Module.php.

JIT / AOT

JIT lowering is not enabled yet (not implemented for JIT); JITTest skips the new PHPT cases until LLVM scope import is stable (follow-up on #275). VM acceptance matches the issue:

docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  bash -c 'echo "<?php \$t=[\"name\"=>\"Dev\"]; extract(\$t); echo \$name;" | php bin/vm.php'
# Dev

Test plan

Closes #275

Made with Cursor

Caller frames are linked for internal builtins so string-keyed arrays can populate compiled locals (EXTR_SKIP). JIT/AOT lowering is deferred; compliance covers the VM path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit f438140 into master May 20, 2026
1 check failed
@PurHur
PurHur deleted the issue-275-extract-compact branch May 20, 2026 15:52
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.

Stdlib: extract() and compact() for PHP template includes

1 participant