Skip to content

Bad error line and file for invalid "-d" arguments #20871

@kkmuffme

Description

@kkmuffme

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions