[php-src] Issue #10337: _REQUEST does not contain _COOKIE

From: Date: Mon, 16 Jan 2023 09:38:28 +0000
Subject: [php-src] Issue #10337: _REQUEST does not contain _COOKIE
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-243458@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/10337
Author: timint

### Description

The superglobal $_REQUEST does not contain a $_COOKIE value although the documentation states it
should:

> $_REQUEST
> An associative array that by default contains the contents of $_GET, $_POST and $_COOKIE.

https://www.php.net/manual/en/reserved.variables.request.php

```
      var_dump([
        'PHP_VERISON' => PHP_VERSION,
        '_GET[foo]' => $_GET['foo'] ?? null,
        '_POST[foo]' => $_POST['foo'] ?? null,
        '_COOKIE[foo]' => $_COOKIE['foo'] ?? null,
        '_REQUEST[foo]' => $_REQUEST['foo'] ?? null,
        'variables_order' => ini_get('variables_order'),
      ]);
```


Returns:

```
    array(6) {
      ["PHP_VERISON"]=>
      string(6) "8.1.13"
      ["_GET[foo]"]=>
      NULL
      ["_POST[foo]"]=>
      NULL
      ["_COOKIE[foo]"]=>
      string(1) "a"              // <-- The cookie exists
      ["_REQUEST[foo]"]=>
      NULL                       // <-- Although not here
      ["variables_order"]=>
      string(4) "GPCS"
    }
```

Is this a bug? Or is it just the documentation that needs an update?

### PHP Version

PHP 8.1.13

### Operating System

Cloud Linux


Thread (1 message)

  • timint
« previous php.bugs (#243458) next »