Skip to content

filter_input() ignores $_SERVER['argv'] in cli mode #10480

@Boldewyn

Description

@Boldewyn

Description

The following code:

<?php
var_dump(filter_input(INPUT_SERVER, 'argv'));

when called in a shell in this way:

php index.php

resulted in this output:

NULL

But I expected this output instead:

array(1) {
  [0]=>
  string(9) "index.php"
}

Or put another way, filter_input(INPUT_SERVER, 'argv') and $_SERVER['argv'] are not working on the same data.

PHP Version

PHP 8.1.2-1ubuntu2.10 (Ubuntu 22.04) and PHP 8.2.1 (Docker)

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