At 14:07 7/2/2001, Derick Rethans wrote the following:
-------------------------------------------------------------- 
>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))

encapsulation!

>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).

It will also (IMNSHO) lessen the readability of the code. And slow down 
things pretty much -- all that copying all over the place. I don't like it. 
And $GET_A['var'] looks like a function pointer to some fetching function, 
$POST['var'] would post $var somewhere... Dunno what would $COOKIE_A do. :)

PHP is my primary language (99% of time && work done in it).

>regards,
>
>Jani Taskinen
>Derick Rethans




[EMAIL PROTECTED]
-------------
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
    - Book of Installation chapt 3 sec 7 


-- 
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