Hello !
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';
}
?>
Best regards,
Fred.
AFAIK class constants are optimized for speed and therefore don't
support expressions; don't expect this to change any time soon ;-)
On Wed, May 19, 2010 at 4:54 PM, Frederic Hardy
frederic.hardy@mageekbox.net wrote:
Hello !
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';
}?>
Best regards,
Fred.--
--
Tjerk
hi,
AFAIK class constants are optimized for speed and therefore don't
support expressions; don't expect this to change any time soon ;-)
It would require to do a two passes compilation (or something along
this line) as you can define constants later in your script. They will
also be defined at runtime, not at buildtime. pecl's hidef may help
:).
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org