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
 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Mar 12 20:01:32 2025 UTC