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

Reply via email to