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