Re: Re: Using register_globals
| From: | Don Read | Date: | Sun, 08 Jun 2003 08:15:04 +0000 |
| Subject: | Re: Re: Using register_globals | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150653@lists.php.net to get a copy of this message | ||
On 08-Jun-2003 Philip Olson wrote:
> [snip]
>> <rant>
>>
>> register_globals=off won't make good code any better --it's just
>> a safety net for the sloppy coders.
> [snip]
>
> In some sense, register_globals = off makes both bad and
> good code better, because it means less pollution. So
> many unused variables get defined with register_globals
> on and this means wasted memory/resources. Pollution
> makes any environment worse! Granted this isn't what you
> meant, but still... ;)
>
Also true.
On namespace pollution --based on some of the replies I've seen on the
list, there's a sizable number of neophyte (and too many veteran) coders
that are starting scripts with:
<?php
extract($_GET); extract($_POST); extract($_COOKIE);
...
And so far, I don't recall anybody mention that you need to
unset($admin, $internal_var, $nukenewyork, ...) afterwards.
So nothing's really changed.
Bad code will mysteriously go tits-up (or worse) and good code will
keep on cranking.
No matter what register_globals= is set to.
Regards,
--
Don Read dread@texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.