From: [EMAIL PROTECTED]
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 [EMAIL PROTECTED] 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
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]