Bug #80104 [NEW]: PHP8 comparison greater than results in true for non-numeric string
| From: | gielwijgergangs at gmail dot com | Date: | Mon, 14 Sep 2020 13:43:46 +0000 |
| Subject: | Bug #80104 [NEW]: PHP8 comparison greater than results in true for non-numeric string | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-229000@lists.php.net to get a copy of this message | ||
From: gielwijgergangs at gmail dot com
Operating system: any
PHP version: 8.0.0beta3
Package: *General Issues
Bug Type: Bug
Bug description:PHP8 comparison greater than results in true for non-numeric string
Description:
------------
PHP8 comparison results in true where previous php versions do not
Check script at:
https://3v4l.org/lsJkL
The result is the same when $val = 'someprefix';
Not sure whether this is a bug of intended in php8!?
Test script:
---------------
<?php
$val = 'someprefix3333';
if($val > 0){
echo $val . ' is greater than 0';
}
else {
echo $val . ' is NOT greater than 0';
}
Expected result:
----------------
someprefix3333 is NOT greater than 0
Actual result:
--------------
someprefix3333 is greater than 0
--
Edit bug report at https://bugs.php.net/bug.php?id=80104&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80104&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80104&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80104&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80104&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80104&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80104&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80104&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80104&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80104&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80104&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80104&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80104&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80104&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80104&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80104&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80104&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80104&r=mysqlcfg