xref: /PHP-5.3/ext/gmp/tests/006.phpt (revision d0fffa7a)
1--TEST--
2gmp_sub() tests
3--SKIPIF--
4<?php if (!extension_loaded("gmp")) print "skip"; ?>
5--FILE--
6<?php
7
8var_dump(gmp_sub());
9var_dump(gmp_sub(""));
10var_dump(gmp_sub("", ""));
11var_dump(gmp_sub("", "", ""));
12var_dump(gmp_sub(array(), array()));
13
14var_dump($g = gmp_sub(10000, 10001));
15var_dump(gmp_strval($g));
16var_dump($g = gmp_sub(10000, -1));
17var_dump(gmp_strval($g));
18var_dump($g = gmp_sub(10000, new stdclass));
19var_dump(gmp_strval($g));
20var_dump($g = gmp_sub(new stdclass, 100));
21var_dump(gmp_strval($g));
22
23echo "Done\n";
24?>
25--EXPECTF--
26Warning: gmp_sub() expects exactly 2 parameters, 0 given in %s on line %d
27NULL
28
29Warning: gmp_sub() expects exactly 2 parameters, 1 given in %s on line %d
30NULL
31bool(false)
32
33Warning: gmp_sub() expects exactly 2 parameters, 3 given in %s on line %d
34NULL
35
36Warning: gmp_sub(): Unable to convert variable to GMP - wrong type in %s on line %d
37bool(false)
38resource(%d) of type (GMP integer)
39string(2) "-1"
40resource(%d) of type (GMP integer)
41string(5) "10001"
42
43Warning: gmp_sub(): Unable to convert variable to GMP - wrong type in %s on line %d
44bool(false)
45string(1) "0"
46
47Warning: gmp_sub(): Unable to convert variable to GMP - wrong type in %s on line %d
48bool(false)
49string(1) "0"
50Done
51