Re: Constant arrays
| From: | Ángel González | Date: | Mon, 19 Dec 2011 20:47:43 +0000 |
| Subject: | Re: Constant arrays | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56951@lists.php.net to get a copy of this message | ||
On 19/12/11 21:23, Paul Dragoonis wrote:
> Barbu,
>
> This is how constants work in all viable languages such as C/++.
I disagree. In C you can have:
const data foo[] = { { "Data1", 2 }, { "Data2", 78 } };
It's not unusual in php to have a complex structure that won't change
in a variable. It should be an array, but as array is not allowed as
content,
you need to leave it as a static variable that you won't never change.