Bug #14952: $_GET and $HTTP_GET_VARS are separate arrays
| From: | ramses0 at yahoo dot com | Date: | Wed, 09 Jan 2002 17:38:14 +0000 |
| Subject: | Bug #14952: $_GET and $HTTP_GET_VARS are separate arrays | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-76371@lists.php.net to get a copy of this message | ||
From: ramses0@yahoo.com
Operating system: Linux
PHP version: 4.1.1
PHP Bug Type: Feature/Change Request
Bug description: $_GET and $HTTP_GET_VARS are separate arrays
blah.php
<?php
print_r( $HTTP_GET_VARS );
print_r( $_GET );
echo "<hr>";
$_GET['test'] = 1;
echo "<hr>";
print_r( $HTTP_GET_VARS );
print_r( $_GET );
?>
Results from blah.php
---------------------
Array ( ) Array ( )
Array ( ) Array ( [test] => 1 )
Results from blah.php?test=test
---------------------
Array ( [test] => test ) Array ( [test] => test )
Array ( [test] => test ) Array ( [test] => 1 )
Aside from the performance/memory implications of having two separate
arrays (ie: http://blah.com/blah.php?text=[shakespeare]&spell_check=1),
it's really annoying when trying to propagate information to a moduralized
script which normally takes data off the get-string.
Here is my patch: $_GET =& $HTTP_GET_VARS; It halves the memory
requirements of PHP's default arrays, and behaves much closer to what an
end-user would expect. I am willing to bet that NOBODY wants $_GET['blah']
= 'test'; echo $HTTP_GET_VARS['blah']; to fail in mysterious ways.
Why is this not done in the first place? I have checked on the mailing
lists and in the bug archives, but couldn't find any previous discussion.
Send me an email at ramses0@yahoo.com if there is a good reason for this,
or if I am missing something important.
--
Edit bug report at: http://bugs.php.net/?id=14952&edit=1