php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #41679 variables_order parameter is ignored
Submitted: 2007-06-13 12:28 UTC Modified: 2007-06-17 08:51 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: denis_test at freemail dot ru Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.2.3 OS: FreeBSD 6.2-RELEASE-p3
Private report: No CVE-ID: None
 [2007-06-13 12:28 UTC] denis_test at freemail dot ru
Description:
------------
Configuration:
variables_order 	EGPCS
register_globals	On

Environment variable HOME is set to "/".
I start script with test.php?HOME=test

Reproduce code:
---------------
<?
echo $HOME;
?>

Expected result:
----------------
test

Actual result:
--------------
/

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-14 08:12 UTC] denis_test at freemail dot ru
You say: "Env is parsed first, so no wonder it gets overwritten by GET that is parsed second."

But I am sorry, my situation is direct opposite. As you can see GET is overwritten by Env.
 [2007-06-14 19:03 UTC] sniper@php.net
You propably misunderstood how it works, it's the opposite:
http://www.php.net/manual/en/ini.core.php#ini.variables-order

"..for example if variables_order is set to "EGPCS", register_globals is enabled, and both $_GET['action'] and $_POST['action'] are set, then $action will contain the value of $_POST['action'] as P comes after G.."

 [2007-06-14 19:04 UTC] sniper@php.net
And now I misread the results. :D
 [2007-06-14 20:12 UTC] sniper@php.net
Are you by any chance using PHP as CGI/FastCGI binary here?
If so, this is expected, although not documented.
In CGI mode the environment is considered part of $_SERVER variables too so having that 'S' causes these to be overwritten.

 [2007-06-15 07:00 UTC] denis_test at freemail dot ru
Yes, phpinfo() says:

Server API 	CGI/FastCGI

Now it's clear. Thank you.
 [2007-06-15 08:41 UTC] sniper@php.net
Okay, I'm reclassifying this, the docs need some comment about this issue.
 [2007-06-17 08:51 UTC] gwynne@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 18:01:32 2025 UTC