Bug #13859: Inconsistent display of logical results
| From: | perry at globalnet dot co dot uk | Date: | Sun, 28 Oct 2001 17:22:40 +0000 |
| Subject: | Bug #13859: Inconsistent display of logical results | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-69200@lists.php.net to get a copy of this message | ||
From: perry@globalnet.co.uk
Operating system: Windows95
PHP version: 4.0.6
PHP Bug Type: Performance problem
Bug description: Inconsistent display of logical results
<?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 bug report at: http://bugs.php.net/?id=13859&edit=1