Re: Constants

From: Date: Mon, 03 Dec 2001 18:30:49 +0000
Subject: Re: Constants
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-72357@lists.php.net to get a copy of this message
On Mon, Dec 03, 2001 at 08:24:29PM +0200, Andi Gutmans wrote: > a) There are almost no constants in PHP which are case-insensitive (which > aren't user land defined with define()). Actually the only ones I could > find are in the Zend Engine such as TRUE & FALSE which makes sense. All PHP > extensions which use REGISTER_LONG_CONSTANT() and friends use the CONST_CS > (case-sensitive flag). I would like to change these macros to *always* > register as case-sensitive. Unless I missed some extensions this shouldn't > bite anyone as all extensions seem to use CONST_CS. Of course I won't > change the special purpose constants such as TRUE & FALSE which are today > registered as case-insensitive. What do you guys think? I think that makes a lot of sense. Go for it. > b) REGISTER_MAIN_LONG_CONSTANT() and friends (notice the MAIN) are used to > register constants which shouldn't be unloaded when the PHP extension is > unloaded. I can't think of many cases where this is applicable. For > example, if the pspell extension is unloaded I think all of its constants > should be unloaded too. However, this extension is one example of an > extension using the _MAIN_ macro. Can each of you check your extension and > move to REGISTER_LONG_CONSTANT() unless there's a good reason not to? I can't think of a good reason why an extension should leave any remnants of itself lying around once it's unloaded. -- Jon Parise (jon@csh.rit.edu) . Information Technology (2001) http://www.csh.rit.edu/~jon/ : Computer Science House Member

« previous php.dev (#72357) next »