#50942 [NEW]: gmp_strval() only allows base 2 to 36

From: Date: Fri, 05 Feb 2010 20:22:33 +0000
Subject: #50942 [NEW]: gmp_strval() only allows base 2 to 36
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3828@lists.php.net to get a copy of this message
From:             php dot devel at homelinkcs dot com
Operating system: GNU/Linux
PHP version:      5.2.12
PHP Bug Type:     Documentation problem
Bug description:  gmp_strval() only allows base 2 to 36

Description:
------------
The manual says that as of PHP 5.2.12, the range for the base argument to
gmp_strval() was extended from 2 to 36, to 2 to 62 and -2 to -36.  However,
in my tests only 2 to 26 worked.

Reproduce code:
---------------
foreach (array_merge(range(-2, -36), range(2, 62)) as $num) {
	if (@gmp_strval(gmp_init(62), $num)) echo "Base $num: GOOD\n";
	else echo "Base $num: BAD\n";
}

Expected result:
----------------
gmp_strval() should return a value for all bases in specified range.

Actual result:
--------------
gmp_strval() fails to return a value and gives warning, "Bad base for
conversion", for bases -2 to -36 and 27 to 62.

-- 
Edit bug report at http://bugs.php.net/?id=50942&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=50942&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=50942&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=50942&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=50942&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50942&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=50942&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=50942&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=50942&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=50942&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=50942&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=50942&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=50942&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=50942&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=50942&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50942&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50942&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=50942&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=50942&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=50942&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=50942&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=50942&r=mysqlcfg



Thread (5 messages)

« previous php.doc.bugs (#3828) next »