note 32042 deleted from control-structures by didou

From: Date: Sun, 03 Aug 2003 10:00:44 +0000
Subject: note 32042 deleted from control-structures by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-53238@lists.php.net to get a copy of this message
Note Submitter: armond A.T technoREM0VEmonk d0t com ---- From my tests, some more complex if() statements may not have desired results. Take for instance, $a = 79; $b = 82; $c = 40; if($c == ($a || $b)) { ... } You would think that would be stating: "If $c equals $a or $b" And would return false, but think again. I have an idea of whats going on here-its equating it like a matematical equasion, and we follow the EPMDAS order. I haven't found a workaround, so for now we're stuck to: if($c == $a || $c == $b) { .. } Armond Carroll

« previous php.notes (#53238) next »