Hi,
this was asked on this list at least once.
The answer is no because the design of the language is this.
If the user is given the chance to make variables superglobals than in my
opinion
big mess will come up. It is a mess even with coding by using global
statement and global vars.

Andrey

----- Original Message -----
From: "Alexander Radivanovich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 1:06 PM
Subject: [PHP-DEV] my own superglobals?


> Hi Gurus
>
>
>
>
> Is there any way to make my own variables supeglobal like $_GET, $_POST,
...
> ?
>
> I don't like $GLOBALS and I don't want  to write the 'global' keyword each
> time I use my global variable in functions, I want to have a method to
make
> it superglobal by default.
>
> 'Superglobal' means that it is available in all scopes throughout a
script.
>
> I suggest following syntax:
>
>
> <?php
>
> // will declare superglobal variables
>
> global $mySuperglobalVariable = "Hello"; // make it superglobal
>
> global $_FORM = array_merge($_GET, $_POST); // yet another superglobal
>
> function test()
>
> {
>
>     echo($mySuperglobalVariable);
>
>     print_r($_FORM);
>
>
>
>     // don't need "global $mySuperglobalVariable"
>
>     // don't need "$GLOBALS['mySuperglobalVariable ']"
>
> }
>
> ?>
>
> I hope it isn't a stupid idea, thaks
>
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to