Hello !
AFAIK class constants are optimized for speed and therefore don't
support expressions; don't expect this to change any time soon ;-)
Is there any feature request about constant and expression ?
I would like to write something like that :
<?php
namespace foo\bar\directories {
const tmp = __DIR__ . '/tmp';
}
?>
So the best solution is something like <?php
define('foo\bar\directories\tmp', __DIR__ . '/tmp'); ?>...
It 's strange that "define()" function can do something that the "const"
keyword can't do, even if "const" keyword evaluation is done at
compilation time and "define()" evaluation is done at runtime.
Best regards,
Fred.
--
========================================================================
Frédéric Hardy : Architecte d'application/Admin. système/Ergonome
Status : En recherche d'emploi
========================================================================
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php