RE: [PHP] Creating custom superglobals
| From: | KermodeBear | Date: | Mon, 14 Aug 2006 14:45:56 +0000 |
| Subject: | RE: [PHP] Creating custom superglobals | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240635@lists.php.net to get a copy of this message | ||
Hello,
You CAN create custom superglobals, but it requires that you have RunKit
enabled: http://us3.php.net/runkit
HTH,
K. Bear
> -----Original Message-----
> From: Stut [mailto:stuttle@gmail.com]
> Sent: Monday, August 14, 2006 10:04 AM
> To: Ville Mattila
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Creating custom superglobals
>
> Ville Mattila wrote:
> > Does the PHP environment (5.1.4) provide a way to define
> some custom
> > variables as a superglobal? It would be useful for saving
> certain site
> > preferences and settings that must be referred in many
> variables and
> > classes, without every time writing global keyword at the
> beginning of
> > a function definition.
>
> No, PHP does not allow userland to create superglobals.
> However, all global variables can be accessed through the
> $GLOBALS superglobal.
>
> -Stut
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>
>