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