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
)





-- 
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]

Reply via email to