Re: Deprecating "global" + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only
| From: | Michael Shadle | Date: | Thu, 09 Dec 2010 10:44:44 +0000 |
| Subject: | Re: Deprecating "global" + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50929@lists.php.net to get a copy of this message | ||
On Thu, Dec 9, 2010 at 2:38 AM, Andrey Hristov <php@hristov.com> wrote:
> Yes, as the documentation will mention how to do it, for old applications.
> For new apps it is easy - pass all the information you need as parameter to
> the function. It works in other languages, why shouldn't it work for PHP?
named parameters would help here. otherwise you wind up with a mess of
argument hell. or passing a single array in and then in the function
parsing that for the items (which is what I do, sort of a userland way
of doing named parameters)
but adding more and more parameters to functions over time leads to
issues if they do not have default values and if you have to pass say,
the 6th parameter, but don't need to pass the rest, etc.