Re: Why can constants only be scalars?

From: Date: Thu, 13 May 2004 15:43:08 +0000
Subject: Re: Why can constants only be scalars?
Groups: php.internals 
Request: Send a blank email to internals+get-9841@lists.php.net to get a copy of this message
Was this considered? $GLOBALS['foo'] = array('bar', 'baz'); function oink() {
    echo $GLOBALS['foo'];
} ~Jason At 5/13/2004 11:29 AM -0400, Sean Coates wrote:
Ilya Sher wrote:
We discussed this issue with Jevon Wright (private emails) and in the end of the day agreed that most simple yet powerful solution is "superglobals", which would work like $_GET,$_POST etc.
This can be accomplished in user-space, by cheating the existing $_* superglobals (if you must -- cowiki does this, IIRC): <?php $_SERVER['foo'] = array('bar', 'baz'); function oink() { print_r($_SERVER['foo']); } oink(); ?> S


« previous php.internals (#9841) next »