php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #15180 _POST --> HTTP_POST_VARS (refrences!!! not)
Submitted: 2002-01-23 04:43 UTC Modified: 2002-10-28 22:25 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: edejanu at route66 dot ro Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.1.1 OS: ALL
Private report: No CVE-ID: None
 [2002-01-23 04:43 UTC] edejanu at route66 dot 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
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-27 22:40 UTC] sterling@php.net
feature/change request...
 [2002-10-28 21:45 UTC] yohgaki@php.net
I noticed it is a copy before release. Will this be changed? I don't care, but I guess not.

 [2002-10-28 22:25 UTC] yohgaki@php.net
Just for the record, I proposed the same thing.
But someone insisted it's not needed to be reference.

You can find it somewhere in archive.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 05 13:01:31 2024 UTC