Bad error line and file for invalid "-d" arguments
Open
Nobody has claimed this yet.
Feature
Status: Verified
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
The following code:
php -d 'foo=bar=asd' -r "echo 'hello' . PHP_EOL;"
Resulted in this output:
PHP: syntax error, unexpected '=' in Unknown on line 6
hello
But I expected this output instead:
PHP: syntax error, unexpected '=' in -d option on line 0
hello
Not sure where it gets that line 6 from, and the "Unknown" could also be improved
PHP Version
8.5
Operating System
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown php -d 'foo=bar=asd' -r command and inspect the PHP CLI handling for invalid -d arguments. The work is done when the diagnostic reports -d option and line 0 while the command still prints hello.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100