#48935 [NEW]: Comparison output
| From: | ultigma at hotmail dot com | Date: | Wed, 15 Jul 2009 20:51:30 +0000 |
| Subject: | #48935 [NEW]: Comparison output | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-139770@lists.php.net to get a copy of this message | ||
From: ultigma at hotmail dot com
Operating system: Vista
PHP version: 5.2.10
PHP Bug Type: Feature/Change Request
Bug description: Comparison output
Description:
------------
New to PHP but I'm sure this is just a small problem but i can't find a
solution to it anywhere. Comparisons that equate to false are not
returned to the browser at all and True values are displayed as 1.
I would have thought that, like most languages ($num1 == $num2) would
return False.
Reproduce code:
---------------
<?php
$num1 = 8;
$num2 = 21;
echo "Is " . $num1 . " equal to " . $num2 . " = " . ($num1 == $num2);
echo "<br />Is " . $num1 . " less than " . $num2 . " = " .
($num1 <
$num2);
echo "<br />Is " . $num1 . " greater than " . $num2 . " = " .
($num1 >
$num2);
echo "<br />Is " . $num1 . " less than or equal to " . $num2 . " =
" .
($num1 <= $num2);
?>
Expected result:
----------------
Is 8 equal to 21 = False
Is 8 less than 21 = True
Is 8 greater than 21 = False
Is 8 less than or equal to 21 = True
Actual result:
--------------
Is 8 equal to 21 =
Is 8 less than 21 = 1
Is 8 greater than 21 =
Is 8 less than or equal to 21 = 1
--
Edit bug report at http://bugs.php.net/?id=48935&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48935&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48935&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48935&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48935&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48935&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48935&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48935&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48935&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48935&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48935&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48935&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48935&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48935&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48935&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48935&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48935&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48935&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48935&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48935&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48935&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48935&r=mysqlcfg