Re: Changes to SuperGlobals for PHP 8 (was: something about session_start...)
| From: | Kalle Sommer Nielsen | Date: | Sat, 29 Jul 2017 23:35:40 +0000 |
| Subject: | Re: Changes to SuperGlobals for PHP 8 (was: something about session_start...) | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100116@lists.php.net to get a copy of this message | ||
Hi
2017-07-29 22:17 GMT+02:00 Stanislav Malyshev <smalyshev@gmail.com>:
> I've seen scenarios where it is very useful. Sure, you can always build
> another layer of indirection and solve it this way, but it's just making
> people do more work for no reason. I don't see any problem that would solve.
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.
If its something simple such as your code assumes $_GET['id'] always
is available, then either write it to a temp variable.
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.
--
regards,
Kalle Sommer Nielsen
kalle@php.net