Bug #75192 [Opn]: Spaceship operator returns wrong value for GMP numbers

From: Date: Tue, 12 Sep 2017 01:38:44 +0000
Subject: Bug #75192 [Opn]: Spaceship operator returns wrong value for GMP numbers
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211080@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75192&edit=1

 ID:                 75192
 User updated by:    marcospassos dot com at gmail dot com
 Reported by:        marcospassos dot com at gmail dot com
 Summary:            Spaceship operator returns wrong value for GMP
                     numbers
 Status:             Open
 Type:               Bug
 Package:            GNU MP related
 Operating System:   Mac
 PHP Version:        7.1.9
 Block user comment: N
 Private report:     N

 New Comment:

In fact, the operator overloading works, but the result is not compatible with the operator
specification.


Previous Comments:
------------------------------------------------------------------------
[2017-09-12 01:34:56] marcospassos dot com at gmail dot com

Description:
------------
Operator overloading does not work for the spaceship operator.

Test script:
---------------
$result = gmp_init('1') <=> gmp_init('-1');

Expected result:
----------------
1

Actual result:
--------------
2


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75192&edit=1


Thread (4 messages)

« previous php.bugs (#211080) next »