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