php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68008 When variables_order is set to "" doesn't work as expected
Submitted: 2014-09-11 18:04 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: joksnet at gmail dot com Assigned:
Status: Open Package: *Configuration Issues
PHP Version: 5.5.16 OS: x86_64 GNU/Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-09-11 18:04 UTC] joksnet at gmail dot com
Description:
------------
Hello,

When the setting `variables_order` is set to "", the documentation [0] says:

>  Setting to "" means no superglobals will be set.

But instead the default "EGPCS" is set.

The only way I found of disable superglobals (because `track_vars` is deprecated) is to set `variables_order` to a letter different of "EGPCS", like "N". This way superglobals are set (`isset($_SERVER)` still true), but not populated.

[0]: http://php.net/manual/en/ini.core.php#ini.variables-order

Test script:
---------------
% php -n -d variables_order="" -r "var_dump(\$_SERVER);"
% php -n -d variables_order="N" -r "var_dump(\$_SERVER);"

Expected result:
----------------
array(0) {
}
array(0) {
}

Actual result:
--------------
array(52) {
...
  ["SHELL"]=>
  string(8) "/bin/zsh"
  ["TERM"]=>
  string(14) "xterm-256color"
...
}
array(0) {
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:25 2019 UTC