Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / gmp / tests / 003.phpt
blob379833024d05aa28e87fe62c7e80cc5f06e87a9b
1 --TEST--
2 Check for number base recognition
3 --SKIPIF--
4 <?php if (!extension_loaded("gmp")) print "skip"; ?>
5 --FILE--
6 <?php
7         /* Binary */
8         $test[] = gmp_init("0b10011010010");
9         $test[] = gmp_init("0b10011010010", 2);
10         $test[] = gmp_init("10011010010");
11         $test[] = gmp_init("10011010010", 2);
13         /* Octal */
14         $test[] = gmp_init("02322");
15         $test[] = gmp_init("02322", 8);
16         $test[] = gmp_init("2322");
17         $test[] = gmp_init("2322", 8);
19         /* Decimal */
20         $test[] = gmp_init("1234");
21         $test[] = gmp_init("1234", 10);
23         /* Hexidecimal */
24         $test[] = gmp_init("0x4d2");
25         $test[] = gmp_init("0x4d2", 16);
26         $test[] = gmp_init("4d2");
27         $test[] = gmp_init("4d2", 16);
29         for ($i = 0; $i < count($test); $i++) {
30                 printf("%s\n", gmp_strval($test[$i]));
31         }
33 --EXPECT--
34 1234
35 1234
36 10011010010
37 1234
38 1234
39 1234
40 2322
41 1234
42 1234
43 1234
44 1234
45 1234
47 1234