php.net |  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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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
Description:
------------
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:
----------------
"0"

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

"0"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-06 22:07 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 [2014-02-06 22:07 UTC] nikic@php.net
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: Sun Dec 22 11:01:30 2024 UTC