Re: Why Constants could Not be Array?

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

 



On Saturday, 30 April 2011 at 10:51, Walkinraven wrote:
For needing a constants=array, I have to use
> 'public static $a = array(...)'
> 
> instead.
> 
> Why the language could not relax the restriction of constants?

As I understand it constants must be declarations not evaluations because they're initialised during parsing not execution. Arrays are evaluations even if they only contain literal values. It could be done, but it would require a fundamental change to the engine and the benefit-cost calculation just doesn't add up.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/






-- 
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