On 4/19/07, Ford, Mike <[EMAIL PROTECTED]> wrote:
On 19 April 2007 04:36, Richard Lynch wrote:

> On Wed, April 18, 2007 4:57 am, Ford, Mike wrote:
> > On 17 April 2007 01:18, Richard Lynch wrote:
> > > Or is it explicitly stated in the manual somewhere I'm not seeing
> > > that one can put things in $GLOBALS directly? [shrug]
> >
> http://uk2.php.net/manual/en/language.variables.predefined.php
> #language.variables.superglobals
>
> When I read that section of the manual, along with similar variables,
> such as: $_SERVER, $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_REQUEST
>
> I do not, in my mind, see anything indicating that it is a documented
> feature that cramming some value into $_GLOBALS['foo'] is
> specifically supported...

Well the definition of $GLOBALS says:

 "Contains a reference to every variable which is currently available
  within the global scope of the script."

I take that to mean reference as in the & operator, so that
$GLOBALS['foo'] is a reference to $foo, and when you assign to a
reference you also assign to....

But, notwithstanding that, how about Example 12.3 at 
http://php.net/global#language.variables.scope.global?

Cheers!

Mike

Hmm, that's quite ugly, what happens when defining a variable outside,
and inside a function. and then get the reference to it? Will the
first var be overwritten, and when the function ends, it will refer to
the old var again?

Tijnema

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
JG125, The Headingley Library,
James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 812 4730          Fax:  +44 113 812 3211


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to