File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
gmp /
tests /
023.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:47:56 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
gmp_invert() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
--FILE--
<?php
var_dump(gmp_strval(gmp_invert(123123,5467624)));
var_dump(gmp_strval(gmp_invert(123123,"3333334345467624")));
var_dump(gmp_strval(gmp_invert("12312323213123123",7624)));
var_dump(gmp_strval(gmp_invert(444,0)));
var_dump(gmp_strval(gmp_invert(0,28347)));
var_dump(gmp_strval(gmp_invert(-12,456456)));
var_dump(gmp_strval(gmp_invert(234234,-435345)));
$n = gmp_init("349827349623423452345");
$n1 = gmp_init("3498273496234234523451");
var_dump(gmp_strval(gmp_invert($n, $n1)));
var_dump(gmp_strval(gmp_invert($n1, $n)));
var_dump(gmp_invert($n1, $n, 10));
var_dump(gmp_invert($n1));
var_dump(gmp_invert(array(), 1));
var_dump(gmp_invert(1, array()));
var_dump(gmp_invert(array(), array()));
echo "Done\n";
?>
--EXPECTF--
string(7) "2293131"
string(1) "0"
string(4) "5827"
string(1) "0"
string(1) "0"
string(1) "0"
string(1) "0"
string(22) "3498273496234234523441"
string(1) "1"
Warning: gmp_invert() expects exactly 2 parameters, 3 given in %s on line %d
NULL
Warning: gmp_invert() expects exactly 2 parameters, 1 given in %s on line %d
NULL
Warning: gmp_invert(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
Warning: gmp_invert(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
Warning: gmp_invert(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>