Annotation of embedaddon/php/ext/gmp/tests/029.phpt, revision 1.1.1.1

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>