xref: /PHP-5.6/ext/gmp/tests/gmp_scan0.phpt (revision 9586b152)
1--TEST--
2gmp_scan0() basic tests
3--SKIPIF--
4<?php if (!extension_loaded("gmp")) print "skip"; ?>
5--FILE--
6<?php
7
8var_dump(gmp_scan0("434234", -10));
9var_dump(gmp_scan0("434234", 1));
10var_dump(gmp_scan0(4096, 0));
11var_dump(gmp_scan0("1000000000", 5));
12var_dump(gmp_scan0("1000000000", 200));
13
14$n = gmp_init("24234527465274");
15var_dump(gmp_scan0($n, 10));
16
17var_dump(gmp_scan0(array(), 200));
18var_dump(gmp_scan0(array()));
19var_dump(gmp_scan0());
20
21echo "Done\n";
22?>
23--EXPECTF--
24Warning: gmp_scan0(): Starting index must be greater than or equal to zero in %s on line %d
25bool(false)
26int(2)
27int(0)
28int(5)
29int(200)
30int(13)
31
32Warning: gmp_scan0(): Unable to convert variable to GMP - wrong type in %s on line %d
33bool(false)
34
35Warning: gmp_scan0() expects exactly 2 parameters, 1 given in %s on line %d
36NULL
37
38Warning: gmp_scan0() expects exactly 2 parameters, 0 given in %s on line %d
39NULL
40Done
41