xref: /PHP-8.0/ext/gmp/tests/bug50175.phpt (revision c6c9e71a)
1--TEST--
2Bug #50175: gmp_init() results 0 on given base and number starting with 0x or 0b
3--SKIPIF--
4<?php if (!extension_loaded('gmp')) die('skip gmp extension not loaded'); ?>
5--FILE--
6<?php
7
8var_dump(gmp_init('0bcd', 16));
9var_dump(gmp_init('0xyz', 36));
10
11?>
12--EXPECTF--
13object(GMP)#%d (1) {
14  ["num"]=>
15  string(4) "3021"
16}
17object(GMP)#%d (1) {
18  ["num"]=>
19  string(5) "44027"
20}
21