(a) I agree that the names are long
(b) Remember that you can change the name by simply assigning it around 
(e.g., $GET_A = $HTTP_GET_VARS)
(c) I think that $GET_A is ugly :)  I'd go for something along the lines of 
$__GET
(d) Having these variables available on every function means that it's 
going to slow things down, so it's a no-no.  What we can do is do something 
along the lines of $GLOBALS - where it is available in every function that 
*uses* it.  The drawback here is that it means it will not be available via 
indirect reference (i.e., $foo = "__GET", $$foo["bar"]).  I don't think 
it's a serious drawback though.

Zeev

At 15:07 2/7/2001, Derick Rethans wrote:
>Hello list,
>
>sometimes I use PHP too, and today I noticed the things I described here.
>Per coincidence, Jani, who is working on the new bugsystem, had the same
>thoughts about this. I'll describe the problem now:
>
>All the arrays which hold the vars are not in de global name space, you
>you will always need to use the "global" keyword, or something like
>$GLOBALS["HTTP_SESSION_VARS"]["username"]; As you all can see, that's way
>to long and cumbersome to type. Just see this example:
>
>global $HTTP_GET_VARS;
>global $HTTP_POST_VARS;
>global $HTTP_COOKIE_VARS;
>
>if(     empty($HTTP_GET_VARS['PHPSESSID'])  &&
>         empty($HTTP_POST_VARS['PHPSESSID']) &&
>         empty($HTTP_COOKIE_VARS['PHPSESSID']) &&
>         !empty($sessid)
>
>I think this looks much better:
>if ( empty ($GET_A['PHPSESSID']) &&
>      empty ($POST_A['PHPSESSID']) &&
>      empty ($COOKIE_A['PHPSESSID']) &&
>      !empty ($sessid))
>
>I propose to change the names of the arrays and to make these arrays
>available in all functions, this will both eliminate the use of the global
>keyword, and will shorten the names significantly. This will speed op
>coding of course. Our proposal is to use the now second word of the array,
>postfixed by _A (array).
>
>regards,
>
>Jani Taskinen
>Derick Rethans
>
>
>--
>PHP Development Mailing List <http://www.php.net/>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Zeev Suraski <[EMAIL PROTECTED]>
CTO &  co-founder, Zend Technologies Ltd. http://www.zend.com/


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to