Bug #13280: suggestions about variables scope, warnning
| From: | Xuefer at 21cn dot com | Date: | Thu, 13 Sep 2001 07:43:05 +0000 |
| Subject: | Bug #13280: suggestions about variables scope, warnning | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-65859@lists.php.net to get a copy of this message | ||
From: Xuefer@21cn.com
Operating system: any
PHP version: 4.0.6
PHP Bug Type: Feature/Change Request
Bug description: suggestions about variables scope, warnning
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
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.
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;
--
Edit bug report at: http://bugs.php.net/?id=13280&edit=1