Re: Why can constants only be scalars?

From: Date: Thu, 13 May 2004 06:57:09 +0000
Subject: Re: Why can constants only be scalars?
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-9829@lists.php.net to get a copy of this message
Andi Gutmans wrote: [snip, text was about non-scalar constant]
I don't see this as something which should be changed. Definitely not before 5.0 but I'm not sure it's that critical also to change afterwards although it might be possible. Andi
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. $a=array('x'=>1); superglobal $a; function f() { echo $a['x']; } with combination of naming convention to express the constant nature of the data for example: $const_a=...; superglobal $const_a; or $MY_PARAMETERS=....; superglobal $MY_PARAMETERS; HTH. Regards, Ilya

« previous php.internals (#9829) next »