Annotation of embedaddon/php/ext/gmp/tests/036.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: gmp_hamdist() basic tests
3: --SKIPIF--
4: <?php if (!extension_loaded("gmp")) print "skip"; ?>
5: --FILE--
6: <?php
7:
8: var_dump(gmp_hamdist(1231231, 0));
9: var_dump(gmp_hamdist(1231231, -1));
10: var_dump(gmp_hamdist(1231231, "8765434567897654333334567"));
11: var_dump(gmp_hamdist(-364264234, "8333765434567897654333334567"));
12:
13: $n = gmp_init("8765434567");
14: $n1 = gmp_init("987654445678");
15: var_dump(gmp_hamdist($n, "8333765434567897654333334567"));
16: var_dump(gmp_hamdist($n, $n));
17: var_dump(gmp_hamdist($n, $n1));
18:
19: var_dump(gmp_hamdist($n, $n1, 1));
20: var_dump(gmp_hamdist($n, array()));
21: var_dump(gmp_hamdist(array(), $n));
22: var_dump(gmp_hamdist(array(), array()));
23: var_dump(gmp_hamdist());
24:
25: echo "Done\n";
26: ?>
27: --EXPECTF--
28: int(13)
29: int(-1)
30: int(36)
31: int(-1)
32: int(43)
33: int(0)
34: int(26)
35:
36: Warning: gmp_hamdist() expects exactly 2 parameters, 3 given in %s on line %d
37: NULL
38:
39: Warning: gmp_hamdist(): Unable to convert variable to GMP - wrong type in %s on line %d
40: bool(false)
41:
42: Warning: gmp_hamdist(): Unable to convert variable to GMP - wrong type in %s on line %d
43: bool(false)
44:
45: Warning: gmp_hamdist(): Unable to convert variable to GMP - wrong type in %s on line %d
46: bool(false)
47:
48: Warning: gmp_hamdist() expects exactly 2 parameters, 0 given in %s on line %d
49: NULL
50: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>