php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67288 GMP functions accept strings in addition to resources
Submitted: 2014-05-15 22:09 UTC Modified: 2014-06-01 21:55 UTC
From: benjamin dot morel at gmail dot com Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: benjamin dot morel at gmail dot com
New email:
PHP Version: OS:

 

 [2014-05-15 22:09 UTC] benjamin dot morel at gmail dot com
Description:
------------
The documentation for gmp_add() for example:
http://www.php.net/manual/en/function.gmp-add.php

Says about parameters:

> It can be either a GMP number resource, or a numeric string given that it is possible to convert the latter to a number.

So the function signature is wrong.

Expected result:
----------------
resource gmp_add ( resource|string $a , resource|string $b )

Actual result:
--------------
resource gmp_add ( resource $a , resource $b )

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-15 22:11 UTC] benjamin dot morel at gmail dot com
Please note that this needs to be fixed in all gmp_* functions, not just gmp_add().
 [2014-05-21 17:37 UTC] aharvey@php.net
This is going to get even messier in PHP 5.6, since the resources are changing to objects. We'll have to figure out the best way to document this.
 [2014-06-01 21:55 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2014-06-01 21:55 UTC] aharvey@php.net
PhD won't really let us do the resource|GMP|integer|string syntax (even if it was a good idea, which it probably isn't with that many types), and I'd rather not go with "mixed" here.

I've changed these to "GMP" as part of the prep for PHP 5.6.0, but I think that's about the best we can do.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 15:01:31 2024 UTC