Re: Constant arrays

From: Date: Mon, 19 Dec 2011 20:23:59 +0000
Subject: Re: Constant arrays
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-56950@lists.php.net to get a copy of this message
Barbu, This is how constants work in all viable languages such as C/++. They are not 'variables of data', they contain scalar values so that you can have a maintainable source for your value to refer to later. http://msdn.microsoft.com/en-us/library/357syhfh(v=vs.80).aspx I believe constants come from the philosophy of 'enums' in C. Just google some more on it. Regards, - Paul. On Mon, Dec 19, 2011 at 8:20 PM, Barbu Paul Gh. <paullik.paul@gmail.com> wrote: > Hello! > > I wonder why I cannot assign arrays to constants. > According to the PHP manual: > "only scalar and null values are allowed. Scalar values are integer, float, > string or boolean values." > > What is the mechanism behind this? > What's the explanation? > > -- > > Common sense is not so common - Voltaire > http://tweak-it.tk/ - Personal portfolio and web-log - Barbu > Paul - Gh. > Visit My GitHub profile to see my open-source projects - > https://github.com/paullik > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.internals (#56950) next »