|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66657 gmp_init('') throws warning
Submitted: 2014-02-06 15:45 UTC Modified: 2014-02-06 22:07 UTC
From: thomas dot hebinck at digionline dot de Assigned:
Status: Not a bug Package: GNU MP related
PHP Version: 5.6Git-2014-02-06 (snap) OS: Linux
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.
Bug Type:
From: thomas dot hebinck at digionline dot de
New email:
PHP Version: OS:


 [2014-02-06 15:45 UTC] thomas dot hebinck at digionline dot de
Up to PHP 5.5.9 gmp_init() called with an empty string as argument had the same result as called with a zero. In PHP 5.6 Alpha 1 (and the current snapshot) this call throws a warning. This breaks existing code.

Test script:
echo gmp_strval(gmp_init(''));

Expected result:

Actual result:
Warning:  gmp_init() [function.gmp-init.php]: Unable to convert variable to GMP - string is not an integer in /SPACE/ww3/www/wws/130009.php(103) : eval()'d code on line 1



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-06 22:07 UTC]
-Status: Open +Status: Not a bug
 [2014-02-06 22:07 UTC]
gmp_init('') did not return a GMP zero, but boolean false, indicating an error condition. PHP 5.6 adds a warning for that previously silent error.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Oct 21 17:01:27 2019 UTC