note 106890 deleted from function.define by danbrown

From: Date: Tue, 03 Jan 2012 22:10:26 +0000
Subject: note 106890 deleted from function.define by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-185326@lists.php.net to get a copy of this message
Note Submitter: metrox at cityz dot com ---- - About <?php if(CONST_DEFINED) ... ?> you should have use <?php if (defined(CONST_DEFINED)) ... ?> or <?php if (CONST_DEFINED === true) ... ?> as by default CONST_DEFINED value is "CONST_DEFINED" which is not false - About "integers starting with 0 won't work" please see http://www.php.net/manual/fr/language.types.integer.php as 09900 is not a valid number - About "redeclare define - it is possible" you are wrong. <?php define('TEST','foo',true); ?> is the same as <?php define('test','foo'); ?>, but "TEST" and "test" are two different constants. - About constant name you can use nearly anything and access your constant using constant() : <?php define('anything:()$ as a name :)', 'crazy name'); echo constant('anything:()$ as a name :)'); ?> ;)

« previous php.notes (#185326) next »