|  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
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:
Solve the problem:
37 + 50 = ?
Subscribe to this entry?

 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 02:01:29 2024 UTC