#15180 [Opn]: _POST --> HTTP_POST_VARS (refrences!!! not)
| From: | yohgaki@php.net | Date: | Tue, 29 Oct 2002 03:45:30 +0000 |
| Subject: | #15180 [Opn]: _POST --> HTTP_POST_VARS (refrences!!! not) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-23615@lists.php.net to get a copy of this message | ||
ID: 15180
Updated by: yohgaki@php.net
Reported By: edejanu@route66.ro
Status: Open
Bug Type: Feature/Change Request
Operating System: ALL
PHP Version: 4.1.1
New Comment:
I noticed it is a copy before release. Will this be changed? I don't
care, but I guess not.
Previous Comments:
------------------------------------------------------------------------
[2002-10-27 22:40:41] sterling@php.net
feature/change request...
------------------------------------------------------------------------
[2002-01-23 04:43:02] edejanu@route66.ro
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 this bug report at http://bugs.php.net/?id=15180&edit=1