|
It also improves readability of your good immensely. Think of a script, 500 lines long, that you haven't touched a year long. Then you suddenly need to make some changes to it, and you run into a bunch of undeclared variables that seem to come from anywhere. No indication (if you don't explicitly comment this) is left *where* the variables come from - GET, POST, cookies, session, server environment... no one knows for sure unless you take the burden of testing this script in a context it's normally used.
Compared against $_POST, it's immediately clear where the variable is supposed to come from. Plus, the new $_POST|GET|etc. predefined variables are super-globals, which means you can access them in functions without the need to import them with the "global" keyword.
|