Hi!

> Sure it seems useful, but I see it more as a hack if you are just
> writing to superglobals anyway, if you need to change something you
> should do that with your own logic instead.

That's what I said - you can always add a layer of indirection. But why?
What is so sacred in those variables that writing into them is taboo and
writing into intermediate layer is OK?

> If its something simple such as your code assumes $_GET['id'] always
> is available, then either write it to a temp variable.

Again, could do it, but why? What is so special in '_GET' that is not in
temp variable? Why make me do extra work?

> I know many applications nowadays are not written with an excess
> amount of globals everywhere, but writing to a global without
> explicitly declaring you want to, can cause some hard to debug cases
> if one function modifies a global and another assumes an unmodified
> value. I'd like to see that gone.

Request context is a global state. It is a legit global state -
everything within the request is executed in the context of the request.
If you put this global state into some kind of intermediate layer
instead of _GET, you would have absolutely the same global state issues.
You can write your app so that it extracts data from global state into
local state and does not depend on it, but this has nothing to do with
_GET itself - you could do it very well without changing anything with
_GET. Changing _GET does not solve the issues if you use global state,
and the issues do not exist if you don't.
-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to