Re: Deprecating "global" + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only
| From: | Alain Williams | Date: | Thu, 09 Dec 2010 11:03:38 +0000 |
| Subject: | Re: Deprecating "global" + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50935@lists.php.net to get a copy of this message | ||
On Thu, Dec 09, 2010 at 11:53:08AM +0100, Andrey Hristov wrote:
> >Is copying the POST variables into another variables best practice (like a
> >manual register_globals)? In the global scope of the application I think
> >it's cleaner to work with $_POST to overwrite the values than copying the
> >items into variables. Inside a function/method, I agree that it's best
> >practice to pass $_POST as a parameter and then overwrite the values as you
> >need.
>
> $_POST is POST, incoming variables, everything else is a hack. If you
> expect that the variable might change then copy it, at least someone
> this will signal that the value might have been changed somewhere.
What is the real difference between operating on $_POST directly
and some other copy of it ? Not everyone writes huge, complicated scripts
written by many different people.
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h>