|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75349 NAN comparison
Submitted: 2017-10-10 10:09 UTC Modified: 2017-10-10 12:07 UTC
From: fdivitto at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2017-10-10 10:09 UTC] fdivitto at gmail dot com
Why this?

var_dump(NAN < 0);
--> produces "bool(true)"


var_dump($x < 0);
--> produces "bool(false)"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-10 10:15 UTC]
-Status: Open +Status: Feedback
 [2017-10-10 10:15 UTC]
I'm pretty sure this has been fixed since 7.1.9 and since 7.2.0beta2

You said 'version irrelevant' - did you check up to date versions and are seeing something different, or did you just assume it affected all versions?
 [2017-10-10 10:20 UTC] spam2 at rhsoft dot net
it is fixed at least in 7.1.10 and hence "irrelevant" is always wrong to start with following

[harry@srv-rhsoft:~]$ php -v
PHP 7.1.10 (cli) (built: Sep 27 2017 15:50:29) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

[harry@srv-rhsoft:~]$ php -a
Interactive mode enabled
php > var_dump(NAN < 0);
php >
 [2017-10-10 11:49 UTC]
-Status: Feedback +Status: Open
 [2017-10-10 11:49 UTC]
This bug has been fixed with <;a=commit;h=c562d44>,
but probably should have a NEWS entry, pointing to this ticket.
 [2017-10-10 12:07 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Oct 03 02:01:24 2023 UTC