Re: [PHP-DEV] string operators for assigning class constants

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

 



this is a php generals type of question.

Sebastian schreef:
hi,

why isn't it possible to assign class constants like this:	

class test
{
const DIR='dirname'.DIRECTORY_SEPARATOR.'anotherdirname'.DIRECTORY_SEPARATOR;
}

is there some performance issue?

classes are defined at compile time, so are their const declarations - it's
not possible to evaluate an expression at compile time.

with define('FOO', 'bar'.QUX); you can do it because the define occurs at run time.



anyone ever tried this or was there a discussion about it? i would find this very useful.....

find another way to do 'it' :-)


greetings

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