ID: 13859 Updated by: jeroen Reported By: [EMAIL PROTECTED] Old Summary: Inconsistent display of logical results Old Status: Open Status: Closed Old Bug Type: Performance problem Bug Type: Feature/Change Request Operating System: Windows95 PHP Version: 4.0.6 New Comment:
Reclassified and updated summary. But it's not going to happen, therefore closed. There are numerous reasons for todays behaviour. use var_dump anyway if you are interested in the value of an expression, and/or if() or something alike if you want to use the truth value of a variable. See also: http://www.php.net/types Previous Comments: ------------------------------------------------------------------------ [2001-10-28 12:22:40] [EMAIL PROTECTED] <?php $n1=10; $n2=8; echo '$n1<$n2 is '.($n1<$n2)."<br>"; echo '$n1<=$n2 is '.($n1<=$n2)."<br>"; echo '$n1>$n2 is '.($n1>$n2)."<br>"; echo '$n1>=$n2 is '.($n1>=$n2)."<br>"; echo '$n1==$n2 is '.($n1==$n2)."<br>"; echo '$n1!=$n2 is '.($n1!=$n2)."<br>"; echo '$n1<>$n2 is '.($n1<>$n2)."<br>"; echo '$n1===$n2 is '.($n1===$n2)."<br>"; echo '$n1!==$n2 is '.($n1!==$n2)."<br>"; echo "<br>"; $bool=($n1==$n2 || $n1===$n2); echo '$bool=($n1==$n2 || $n1===$n2);'."<br>"; echo '$bool is '.$bool; ?> --- This code is a simple run-through of the logical operators. The problem is that 0 is never displayed normally, but if you use boolean logic, then it is possible for 0 to be displayed. I prefer the 0 being displayed. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13859&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]