mirror of
https://github.com/php/php-src.git
synced 2024-09-30 14:26:12 +00:00
834daa455b
0x and 0b prefix is now only handled if either no base is given or if the base is 16 (0x) or 2 (0b). Always handling it is incorrect because 0x and 0b are perfectly valid numbers in other bases.
19 lines
295 B
PHP
19 lines
295 B
PHP
--TEST--
|
|
Bug #50175: gmp_init() results 0 on given base and number starting with 0x or 0b
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(gmp_init('0bcd', 16));
|
|
var_dump(gmp_init('0xyz', 36));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
object(GMP)#%d (1) {
|
|
["num"]=>
|
|
string(4) "3021"
|
|
}
|
|
object(GMP)#%d (1) {
|
|
["num"]=>
|
|
string(5) "44027"
|
|
}
|