php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #76781 Add an option to set the order of $_GET
Submitted: 2018-08-22 21:50 UTC Modified: 2018-08-23 03:25 UTC
From: hitodado at bit-degree dot com Assigned:
Status: Suspended Package: PHP options/info functions
PHP Version: 7.2.9 OS: ubuntu 16.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-08-22 21:50 UTC] hitodado at bit-degree dot com
Description:
------------
Add an option in the php.ini file to make PHP read the first variable with the same key in the url. Thank you.

// --------------------------------
//
//
// PS.: Yes, it's possible to parse $_SERVER['QUERY_STRING'], but it would better to have a native option.
//
// PSĀ².: Sorry if this is not the place for suggestions. 
//

Test script:
---------------
// Example URL: http://example.com/?var=foo&var=bar

ini_set('variables_key_order', 'first');

echo $_GET['var']; // => foo

// --------------------------------

ini_set('variables_key_order', 'last'); // last is default

echo $_GET['var']; // => bar


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-23 00:16 UTC] carusogabriel@php.net
-Type: Bug +Type: Feature/Change Request
 [2018-08-23 03:25 UTC] requinix@php.net
-Status: Open +Status: Suspended
 [2018-08-23 03:25 UTC] requinix@php.net
Surely something that could get you *all* the values would be better?

A change like this would require some discussion and possibly an RFC. https://wiki.php.net/rfc/howto
When the mailing lists are back up again, feel free to raise the subject on the internals list.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 05:01:29 2024 UTC