php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68008 When variables_order is set to "" doesn't work as expected
Submitted: 2014-09-11 18:04 UTC Modified: 2021-04-27 14:25 UTC
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: Verified Package: *Configuration Issues
PHP Version: 5.5.16 OS: x86_64 GNU/Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: joksnet at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-27 14:25 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem
 [2021-04-27 14:25 UTC] cmb@php.net
The documentation is obviously wrong, since the on_modify handler
of variables_orders is OnUpdateStringUnempty[1].

[1] <https://github.com/php/php-src/blob/php-7.4.16/main/main.c#L784>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 20:01:28 2024 UTC