php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78388 GMP does not support overloaded unary plus operator
Submitted: 2019-08-09 04:26 UTC Modified: 2019-08-09 04:41 UTC
From: smokey101stair at gmail dot com Assigned:
Status: Not a bug Package: GNU MP related
PHP Version: Irrelevant OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
6 + 28 = ?
Subscribe to this entry?

 
 [2019-08-09 04:26 UTC] smokey101stair at gmail dot com
Description:
------------
According to the documentation, the GMP object overloads the arithmetic, bitwise, and comparison operators in PHP 5.6+. However, it seems that the unary plus operator is not supported. Not sure if this is a bug or intentional. The negation operator seems to work as expected.

Test script:
---------------
https://3v4l.org/PvRhf


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-08-09 04:41 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2019-08-09 04:41 UTC] requinix@php.net
A unary plus does not make the value positive. Just like how a unary minus does not make the value negative.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 22 09:01:23 2020 UTC