php-src/ext/gmp/tests/bug50175.phpt
Nikita Popov 834daa455b Fixed bug #50175
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.
2014-09-02 19:04:55 +02:00

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"
}