Re: Constants in namesapces

From: Date: Wed, 22 Aug 2007 13:27:57 +0000
Subject: Re: Constants in namesapces
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-31839@lists.php.net to get a copy of this message
yes. keep it consistent. if that means sacrificing features, so be it. David Am 22.08.2007 um 15:20 schrieb Antony Dovgal:
On 22.08.2007 17:03, Dmitry Stogov 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; ?>
Don't you think it's bad idea to use the same 'const' syntax, but different behavior? I believe it would be really confusing for users, as class constants are set in compile time, thus 'const DIR = dirname(__FILE__);' is not possible. --Wbr, Antony Dovgal --PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.internals (#31839) next »