note 117924 deleted from function.define by cmb

From: Date: Wed, 02 Sep 2015 19:25:05 +0000
Subject: note 117924 deleted from function.define by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-203578@lists.php.net to get a copy of this message
Note Submitter: rayschwartz at vassar dot edu ---- If you negate a boolean named constant, you get the opposite boolean in return which can be useful for conditional statements. A named constant can only have scalar values: boolean, float, integer, string or null. In the cases of float, integer, and string, negating a named constant always returns false. In the case of null, negating a named constant always returns true. If the named constant has a boolean value, negating it returns the opposite boolean. <?php define (‘CNST_FALSE', false); define (‘CNST_TRUE', true); if(!CNST_FALSE) { echo ’T’; } else{ echo ’F’; } output: ‘T' if(!CNST_TRUE) { echo ’F’; } else{ echo ’T’; } output: ‘F'

« previous php.notes (#203578) next »