Bug #15180: _POST --> HTTP_POST_VARS (refrences!!! not)
| From: | edejanu at route66 dot ro | Date: | Wed, 23 Jan 2002 09:43:04 +0000 |
| Subject: | Bug #15180: _POST --> HTTP_POST_VARS (refrences!!! not) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-77873@lists.php.net to get a copy of this message | ||
From: edejanu@route66.ro
Operating system: ALL
PHP version: 4.1.1
PHP Bug Type: Performance problem
Bug description: _POST --> HTTP_POST_VARS (refrences!!! not)
Hi,
I have recently installed PHP 4.1.1 and I found
that _POST is not a reference of HTTP_POST_VARS
but a copy. I think that it should be reference.
Here is a reply to one of my old message in which
Yasuo Ohgaki wrote:
> $_SEERVER, etc are reference of $HTTP_*_VARS.
> I think this should be noted *obvious* place when 4.1.0 is
> released :)
http://www.zend.com/lists/php-dev/200112/msg00376.html
A simple script for prove:
<?php
function func_change(&$value, $key)
{
if (is_string($value)) {
$value = '***'.$value;
}
}
echo('<PRE>');
echo('HTTP_GET_VARS before: '); print_r($HTTP_GET_VARS);
echo('_GET before: '); print_r($_GET);
reset($HTTP_GET_VARS);
array_walk($HTTP_GET_VARS, 'func_change');
reset($HTTP_GET_VARS);
echo('HTTP_GET_VARS after: '); print_r($HTTP_GET_VARS);
echo('_GET after: '); print_r($_GET);
echo('</PRE>');
?>
call it as:
/testsuperglobals.php?x=lalal&a=1&b=dkdkkd
and you will see this:
HTTP_GET_VARS before: Array
(
[x] => lalal
[a] => 1
[b] => dkdkkd
)
_GET before: Array
(
[x] => lalal
[a] => 1
[b] => dkdkkd
)
HTTP_GET_VARS after: Array
(
[x] => ***lalal
[a] => ***1
[b] => ***dkdkkd
)
_GET after: Array
(
[x] => lalal
[a] => 1
[b] => dkdkkd
)
--
Edit bug report at: http://bugs.php.net/?id=15180&edit=1