Re: Bug #13280: suggestions about variables scope, warnning
| From: | derick@php.net | Date: | Thu, 13 Sep 2001 07:51:43 +0000 |
| Subject: | Re: Bug #13280: suggestions about variables scope, warnning | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-65860@lists.php.net to get a copy of this message | ||
On 13 Sep 2001 Xuefer@21cn.com wrote:
> suggestions
> 1. any variables start with $_ and $PHP_ and also $HTTP_
> should be always global
> no need to use such as
> global $PHP_SELF;
>
> if possible, set_global_all(true); makes variables scope just like c/java
> do
I think this is a bad idea, it is against the way PHP works...
>
> 2. if we access $PHP_POST_VARS['...'] and it's not set
> should trigger an special warnning, not a normal warnning
> cause it's not that variables we can initize
> so that, we can easily turn off the special warnning without ignoring the
> other normal warnning.
In PHP 4.0.7 and higher you can se $_POST, $_GET, $_SESSION and $_COOKIE
for this, they are global.
>
> 3. we don't like
> $a = 0;
> to initize an variable, we like
> int $a; // it's auto initized into 0
> or
> int $a=1234;
This is not in the nature of PHP, variables are loosely typed
regards,
Derick Rethans
---------------------------------------------------------------------
PHP: Scripting the Web - www.php.net - derick@php.net
SRM: Site Resource Manager - www.vl-srm.net
---------------------------------------------------------------------