Re: Question about superglobals
| From: | Johannes Schlüter | Date: | Fri, 16 Nov 2007 21:58:05 +0000 |
| Subject: | Re: Question about superglobals | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-33181@lists.php.net to get a copy of this message | ||
Hi Sam,
you could use pecl/runkit for registering your own super globals. See
example 2071 on http://de3.php.net/manual/en/ref.runkit.php
johannes
On Fri, 2007-11-16 at 15:53 -0500, Sam Barrow wrote:
> I am trying to develop a patch for personal use to enable custom
> superglobals.
>
> I seemed to have had it working, but am I allowed to specify
> superglobals in my script, or do they have to be specified in an ini
> file or statically in the PHP code?
>
> I created a superglobal keyword and a function that calls
> zend_register_auto_global upon the use of this keyword, but it doesn't
> work. It calls zend_register_auto_global correctly and passes the
> variable name and length of the variable name, but when i try to access
> the variable inside a function in my PHP script, it is undefined.
> However I am able to hard code my superglobal into the PHP source files
> and it works.
>
> Is there some type of restriction on setting superglobals at runtime, or
> does the structure of the PHP interpreter not allow this, or am I doing
> something wrong?
>
> Thanks in advanced for your help.