Skip to content

Bootstrap AOT: minimal namespace support (closes #513)#518

Merged
PurHur merged 1 commit into
masterfrom
issue-513-bootstrap-namespace
May 22, 2026
Merged

Bootstrap AOT: minimal namespace support (closes #513)#518
PurHur merged 1 commit into
masterfrom
issue-513-bootstrap-namespace

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 22, 2026

Summary

  • Compile PHPCfg\Op\Expr\NsFuncCall using the fully-qualified nsName operand for function lookup (definitions already use namespacedName from php-cfg).
  • Add patches/php-types-ns-func-call.patch so TypeReconstructor resolves namespaced calls.
  • Add test/bootstrap-aot/namespace_hello.php and register it in the bootstrap profile / AOT lint ladder.

Progresses #513 (self-host namespace gate) and #84 (PHP namespaces). Single file, single namespace, no use imports.

Test plan

  • docker run --rm -m 10g -v $(pwd):/compiler -w /compiler php-compiler:22.04-dev bash -c 'source script/ci-defaults.env && php bin/compile.php -l test/bootstrap-aot/namespace_hello.php'
  • php script/bootstrap-aot-lint.php (6 targets)

Still blocking full lib/ self-host (#84)

  • use / import aliases and multi-file PSR-4 autoload
  • Namespaced classes, constants, and namespace blocks without hoisted functions
  • Compiling lib/*.php units that mix namespaces with classes, traits, etc.

Closes #513
Refs #84

Made with Cursor

Compile PHPCfg NsFuncCall via fully-qualified names, add php-types
reconstructor support, and gate with test/bootstrap-aot/namespace_hello.php.

Closes #513
Refs #84

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit f9ebf2c into master May 22, 2026
@PurHur PurHur deleted the issue-513-bootstrap-namespace branch May 22, 2026 12:14
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.

Self-host: namespace support blocks compiling lib/ (bootstrap gate)

1 participant