summaryrefslogtreecommitdiff
path: root/ext/gmp/tests/gmp_scan0.phpt
diff options
context:
space:
mode:
authorFlorian MARGAINE <florian@margaine.com>2014-09-20 10:09:21 +0200
committerFlorian MARGAINE <florian@margaine.com>2014-09-20 10:09:21 +0200
commit8eb7e7bf7f63f49e97f112871df47c6d6213e715 (patch)
tree24b9059118cf6abb5fe0837eaa477b4668b18435 /ext/gmp/tests/gmp_scan0.phpt
parent58ed832fc99d5c5aeac7849819bbc4e0dc90d698 (diff)
parent95836a350420cabc2e8e5f5c45131fba46504a3b (diff)
downloadphp-git-8eb7e7bf7f63f49e97f112871df47c6d6213e715.tar.gz
Merge branch 'master' into issue-67910
Conflicts: README.PARAMETER_PARSING_API ext/gmp/tests/001.phpt
Diffstat (limited to 'ext/gmp/tests/gmp_scan0.phpt')
-rw-r--r--ext/gmp/tests/gmp_scan0.phpt40
1 files changed, 40 insertions, 0 deletions
diff --git a/ext/gmp/tests/gmp_scan0.phpt b/ext/gmp/tests/gmp_scan0.phpt
new file mode 100644
index 0000000000..2a87a968a2
--- /dev/null
+++ b/ext/gmp/tests/gmp_scan0.phpt
@@ -0,0 +1,40 @@
+--TEST--
+gmp_scan0() basic tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_scan0("434234", -10));
+var_dump(gmp_scan0("434234", 1));
+var_dump(gmp_scan0(4096, 0));
+var_dump(gmp_scan0("1000000000", 5));
+var_dump(gmp_scan0("1000000000", 200));
+
+$n = gmp_init("24234527465274");
+var_dump(gmp_scan0($n, 10));
+
+var_dump(gmp_scan0(array(), 200));
+var_dump(gmp_scan0(array()));
+var_dump(gmp_scan0());
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: gmp_scan0(): Starting index must be greater than or equal to zero in %s on line %d
+bool(false)
+int(2)
+int(0)
+int(5)
+int(200)
+int(13)
+
+Warning: gmp_scan0(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+
+Warning: gmp_scan0() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: gmp_scan0() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+Done