Skip to content

PHP command line help text doesn't match behaviour (double dash usage) #21894

@bug-fix0r

Description

@bug-fix0r

Description

When I run php --help it says:

Usage: php [options] [-f] <file> [--] [args...]

The following code (when run using php test.php -- test):

<?php
var_dump($argv);

Resulted in this output:

array(3) {
  [0]=>
  string(8) "test.php"
  [1]=>
  string(2) "--"
  [2]=>
  string(4) "test"
}

But I expected this output instead:

array(3) {
  [0]=>
  string(8) "test.php"
  [1]=>
  string(4) "test"
}

So in my opinion either the help text or the code needs a fix.

PHP Version

PHP 8.5.4 (cli)

Operating System

Kubuntu 26.04 LTS

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