xref: /PHP-5.5/ext/gmp/tests/027.phpt (revision eb5bd09c)
1--TEST--
2gmp_sign() basic tests
3--SKIPIF--
4<?php if (!extension_loaded("gmp")) print "skip"; ?>
5--FILE--
6<?php
7
8var_dump(gmp_sign(-1));
9var_dump(gmp_sign(1));
10var_dump(gmp_sign(0));
11var_dump(gmp_sign("123718235123123"));
12var_dump(gmp_sign("-34535345345"));
13var_dump(gmp_sign("+34534573457345"));
14$n = gmp_init("098909878976786545");
15var_dump(gmp_sign($n));
16var_dump(gmp_sign($n, $n));
17var_dump(gmp_sign(array()));
18var_dump(gmp_sign());
19
20echo "Done\n";
21?>
22--EXPECTF--
23int(-1)
24int(1)
25int(0)
26int(1)
27int(-1)
28bool(false)
29int(0)
30
31Warning: gmp_sign() expects exactly 1 parameter, 2 given in %s on line %d
32NULL
33
34Warning: gmp_sign(): Unable to convert variable to GMP - wrong type in %s on line %d
35bool(false)
36
37Warning: gmp_sign() expects exactly 1 parameter, 0 given in %s on line %d
38NULL
39Done
40