Bug #80104 [Opn->Nab]: PHP8 comparison greater than results in true for non-numeric string

From: Date: Mon, 14 Sep 2020 13:48:02 +0000
Subject: Bug #80104 [Opn->Nab]: PHP8 comparison greater than results in true for non-numeric string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229002@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80104&edit=1 ID: 80104 Updated by: derick@php.net Reported by: gielwijgergangs at gmail dot com Summary: PHP8 comparison greater than results in true for non-numeric string -Status: Open +Status: Not a bug Type: Bug Package: *General Issues Operating System: any PHP Version: 8.0.0beta3 Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. See https://wiki.php.net/rfc/saner-numeric-strings And hear: https://phpinternals.news/62 Previous Comments: ------------------------------------------------------------------------ [2020-09-14 13:43:46] gielwijgergangs at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=80104&edit=1

« previous php.bugs (#229002) next »