RE: [PHP-DEV] Constants in namesapces
| From: | Dmitry Stogov | Date: | Wed, 22 Aug 2007 14:55:53 +0000 |
| Subject: | RE: [PHP-DEV] Constants in namesapces | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-31843@lists.php.net to get a copy of this message | ||
We never resolved constants in compile time, because constants' values may
be unknown in compile time.
Thanks. Dmitry.
> -----Original Message-----
> From: Pierre [mailto:pierre.php@gmail.com]
> Sent: Wednesday, August 22, 2007 5:12 PM
> To: Dmitry Stogov
> Cc: Johannes Schlьter; PHP Internals List
> Subject: Re: [PHP-DEV] Constants in namesapces
>
>
> On 8/22/07, Dmitry Stogov <dmitry@zend.com> wrote:
> > You can have "const" outside namespaces but they are not real
> > compile-time constants. They are set during execution in
> the same way
> > as define() does.
> >
> > <?php
> > const DIR = dirname(__FILE__);
> > echo DIR;
> > ?>
>
> Off topic but this const makes me think about hidef (see
> pecl/hidef). It would be nice if we can have them resolved at
> compile time. At least when no instructions are involved in
> the definition (numbers or single quote strings).
>
> Cheers,
> --Pierre
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>