Skip to content

fix #2690 - #2691

Open
henderkes wants to merge 1 commit into
mainfrom
fix/cli-argv
Open

henderkes wants to merge 1 commit into
mainfrom
fix/cli-argv

Conversation

@henderkes

@henderkes henderkes commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

closes #2690

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation resolves the reported argument shift and includes focused regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes CLI argument handling so PHP scripts receive the script path as $argv[0].

Changes:

  • Rebuilds script and eval argument vectors to match native PHP CLI behavior.
  • Preserves the executable location during embedded startup.
  • Adds regression tests for script and -r execution.
File Description
emulate_php_cli.c Corrects CLI argument initialization.
cli_test.go Tests script and eval argument behavior.
testdata/​argv.php Adds the argument-reporting fixture.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
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.

php-cli (v1.13.0): $argv[0] is "frankenphp" and the script path is shifted to $argv[1] — breaks Symfony Console

2 participants