Re: Re: PHP-4.0.7RC1
| From: | Zeev Suraski | Date: | Sat, 18 Aug 2001 09:38:02 +0000 |
| Subject: | Re: Re: PHP-4.0.7RC1 | ||
| References: | 1 | Groups: | php.dev php.qa |
| Request: | Send a blank email to php-dev+get-63582@lists.php.net to get a copy of this message | ||
At 03:51 18-08-01, Richard Lynch wrote:
Relying on initialization by the system instead of doing it by hand is bad. What if somebody then includes your file into something else, but has used that variable, but their final value is usually 0, except when it's not... Then, your code works for a while and then inexplicably breaks. Always initialize variables.In that example, you would break the outer code if you initialize the variable... The right solution here is separation using scopes (functions or classes). I think that include()'ing logic into the global scope is not a very good idea unless they're integrated parts of the application. Zeev