Annotation of embedaddon/php/ext/gmp/tests/032.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: gmp_xor() basic tests
3: --SKIPIF--
4: <?php if (!extension_loaded("gmp")) print "skip"; ?>
5: --FILE--
6: <?php
7:
8: var_dump(gmp_strval(gmp_xor("111111", "2222222")));
9: var_dump(gmp_strval(gmp_xor(123123, 435234)));
10: var_dump(gmp_strval(gmp_xor(555, "2342341123")));
11: var_dump(gmp_strval(gmp_xor(-1, 3333)));
12: var_dump(gmp_strval(gmp_xor(4545, -20)));
13: var_dump(gmp_strval(gmp_xor("test", "no test")));
14:
15: $n = gmp_init("987657876543456");
16: var_dump(gmp_strval(gmp_xor($n, "34332")));
17: $n1 = gmp_init("987657878765436543456");
18: var_dump(gmp_strval(gmp_xor($n, $n1)));
19:
20: var_dump(gmp_xor($n, $n1, 1));
21: var_dump(gmp_xor(1));
22: var_dump(gmp_xor(array(), 1));
23: var_dump(gmp_xor(1, array()));
24: var_dump(gmp_xor(array(), array()));
25:
26: echo "Done\n";
27: ?>
28: --EXPECTF--
29: string(7) "2120329"
30: string(6) "476369"
31: string(10) "2342340648"
32: string(5) "-3334"
33: string(5) "-4563"
34: string(1) "0"
35: string(15) "987657876574716"
36: string(21) "987658017016065701376"
37:
38: Warning: gmp_xor() expects exactly 2 parameters, 3 given in %s on line %d
39: NULL
40:
41: Warning: gmp_xor() expects exactly 2 parameters, 1 given in %s on line %d
42: NULL
43:
44: Warning: gmp_xor(): Unable to convert variable to GMP - wrong type in %s on line %d
45: bool(false)
46:
47: Warning: gmp_xor(): Unable to convert variable to GMP - wrong type in %s on line %d
48: bool(false)
49:
50: Warning: gmp_xor(): Unable to convert variable to GMP - wrong type in %s on line %d
51: bool(false)
52: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>