Bug->Doc #68008 [Opn->Ver]: When variables_order is set to "" doesn't work as expected
| From: | cmb@php.net | Date: | Tue, 27 Apr 2021 14:25:09 +0000 |
| Subject: | Bug->Doc #68008 [Opn->Ver]: When variables_order is set to "" doesn't work as expected | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18733@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68008&edit=1
ID: 68008
Updated by: cmb@php.net
Reported by: joksnet at gmail dot com
Summary: When variables_order is set to "" doesn't work as
expected
-Status: Open
+Status: Verified
-Type: Bug
+Type: Documentation Problem
Package: *Configuration Issues
Operating System: x86_64 GNU/Linux
PHP Version: 5.5.16
Block user comment: N
Private report: N
New Comment:
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>
Previous Comments:
------------------------------------------------------------------------
[2014-09-11 18:04:40] 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) {
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68008&edit=1