Skip to content

Language: runtime __LINE__ on include stack (#715)#720

Merged
PurHur merged 1 commit into
masterfrom
issue-715-magic-line
May 22, 2026
Merged

Language: runtime __LINE__ on include stack (#715)#720
PurHur merged 1 commit into
masterfrom
issue-715-magic-line

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 22, 2026

Summary

  • Route __LINE__ through MagicScriptConst::KIND_LINE and TYPE_SCRIPT_MAGIC (arg2 = source line) instead of php-cfg MagicStringResolver parse-time folding.
  • VM returns the per-site line; JIT uses Variable::fromConstantInt.
  • Add compliance PHPT magic_line_include (+ JIT variant) and flip capabilities-syntax row to VM/JIT/AOT yes.

Test plan

  • php bin/vm.php test/compliance/cases/language/magic_line_include/entry.php7
  • ./script/docker-ci-local.sh fast (capabilities-syntax check + MiniWebApp gates)
  • Full gate: ./script/docker-ci-local.sh (LLVM phases)

Closes #715

Made with Cursor

Emit MagicScriptConst KIND_LINE instead of parse-time folding so __LINE__
reflects the correct per-file line in included helpers (VM + JIT).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 4d3394a into master May 22, 2026
@PurHur PurHur deleted the issue-715-magic-line branch May 22, 2026 23:23
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.

Language: runtime __LINE__ magic constant on include stack (#85 remainder)

1 participant