RE: how to get var name and value from function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
JG125, The Headingley Library,
James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: m.ford@xxxxxxxxxxxxxx
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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux