Skip to content

REQUEST_TIME/REQUEST_TIME_FLOAT missing in INPUT_SERVER #17543

Open
@kkmuffme

Description

@kkmuffme

Description

The following code:

<?php

if ( php_sapi_name() === 'cli' ) {
    echo "filter_input does not work in PHP CLI";
    exit;
}

var_dump( filter_input( INPUT_SERVER, 'REQUEST_TIME_FLOAT' ) );
var_dump( $_SERVER['REQUEST_TIME_FLOAT'] );

var_dump( filter_input( INPUT_SERVER, 'REQUEST_TIME' ) );
var_dump( $_SERVER['REQUEST_TIME'] );

Resulted in this output:

NULL
float(1737560728.0001)
NULL
int(1737560728)

But I expected this output instead:

float(1737560728.0001)
float(1737560728.0001)
int(1737560728)
int(1737560728)

These are the only 2 documented in https://www.php.net/manual/en/reserved.variables.server.php with that behavior? Is this a bug?

I only encountered this behavior with other (non-documented) variables HOME and USER

PHP Version

PHP 8.4

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions