diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/gmp/tests/012.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/gmp/tests/012.phpt')
-rw-r--r-- | ext/gmp/tests/012.phpt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/gmp/tests/012.phpt b/ext/gmp/tests/012.phpt new file mode 100644 index 0000000..8582ba1 --- /dev/null +++ b/ext/gmp/tests/012.phpt @@ -0,0 +1,44 @@ +--TEST-- +gmp_neg() basic tests +--SKIPIF-- +<?php if (!extension_loaded("gmp")) print "skip"; ?> +--FILE-- +<?php + +var_dump(gmp_intval(gmp_neg(0))); +var_dump(gmp_intval(gmp_neg(1))); +var_dump(gmp_intval(gmp_neg(-1))); +var_dump(gmp_intval(gmp_neg("-1"))); +var_dump(gmp_intval(gmp_neg(""))); +var_dump(gmp_intval(gmp_neg(0))); + +$n = gmp_init("0"); +var_dump(gmp_intval(gmp_neg($n))); +$n = gmp_init("12345678901234567890"); +var_dump(gmp_strval(gmp_neg($n))); + +var_dump(gmp_neg(1,1)); +var_dump(gmp_neg()); +var_dump(gmp_neg(array())); + +echo "Done\n"; +?> +--EXPECTF-- +int(0) +int(-1) +int(1) +int(1) +int(0) +int(0) +int(0) +string(21) "-12345678901234567890" + +Warning: gmp_neg() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: gmp_neg() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: gmp_neg(): Unable to convert variable to GMP - wrong type in %s on line %d +bool(false) +Done |