note 31797 deleted from function.define by didou

From: Date: Fri, 12 Sep 2003 12:13:35 +0000
Subject: note 31797 deleted from function.define by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-56371@lists.php.net to get a copy of this message
Note Submitter: brentonb (isat) uvic (.dot.) ca ---- Just a note when it comes to defining booleans ... if you have a condition where a constant will be defined as a true, but no else to define it as false ... it will still 'technically' be true ... example: if ($is_popup) { define ("POPUP", TRUE); } used anywhere else such as: if (POPUP) { // blah blah } will always execute. You can see this in the fact that if you print out POPUP: echo (POPUP); it will either print: "POPUP" or "TRUE" .. therefore, it's still "technically" true This one had me stumped for a while .. I suggest either putting in the else part: else { define ("POPUP", FALSE); } or using the defined () function.

« previous php.notes (#56371) next »