summaryrefslogtreecommitdiff
path: root/ext/gmp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-01-30 21:42:36 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-02-03 18:52:57 +0100
commitfbeb900be4948d9a1bdc3e139937777534cc27e4 (patch)
treeac3046235e63f897969f9cfc084ef1fc7eafb1b7 /ext/gmp
parent000b504b51cb3a82df0496789f249bdfed65c11b (diff)
downloadphp-git-fbeb900be4948d9a1bdc3e139937777534cc27e4.tar.gz
Deprecate gmp_random()
Diffstat (limited to 'ext/gmp')
-rw-r--r--ext/gmp/gmp.c2
-rw-r--r--ext/gmp/tests/gmp_random.phpt19
-rw-r--r--ext/gmp/tests/gmp_random_seed-32bit.phpt4
-rw-r--r--ext/gmp/tests/gmp_random_seed.phpt2
4 files changed, 25 insertions, 2 deletions
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index 43e3c928d4..9fcf9c14d7 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -173,7 +173,7 @@ const zend_function_entry gmp_functions[] = {
ZEND_FE(gmp_legendre, arginfo_gmp_binary)
ZEND_FE(gmp_cmp, arginfo_gmp_binary)
ZEND_FE(gmp_sign, arginfo_gmp_unary)
- ZEND_FE(gmp_random, arginfo_gmp_random)
+ ZEND_DEP_FE(gmp_random, arginfo_gmp_random)
ZEND_FE(gmp_random_seed, arginfo_gmp_random_seed)
ZEND_FE(gmp_random_bits, arginfo_gmp_random_bits)
ZEND_FE(gmp_random_range, arginfo_gmp_random_range)
diff --git a/ext/gmp/tests/gmp_random.phpt b/ext/gmp/tests/gmp_random.phpt
index d1351bbd1e..da4ca5c7bd 100644
--- a/ext/gmp/tests/gmp_random.phpt
+++ b/ext/gmp/tests/gmp_random.phpt
@@ -20,22 +20,41 @@ var_dump(gmp_random("test"));
echo "Done\n";
?>
--EXPECTF--
+Deprecated: Function gmp_random() is deprecated in %s on line %d
string(%d) "%d"
+
+Deprecated: Function gmp_random() is deprecated in %s on line %d
string(%d) "%d"
+
+Deprecated: Function gmp_random() is deprecated in %s on line %d
string(1) "%d"
+
+Deprecated: Function gmp_random() is deprecated in %s on line %d
string(%d) "%d"
+
+Deprecated: Function gmp_random() is deprecated in %s on line %d
string(%d) "%d"
+
+Deprecated: Function gmp_random() is deprecated in %s on line %d
string(%d) "%d"
+Deprecated: Function gmp_random() is deprecated in %s on line %d
+
Warning: gmp_random() expects parameter 1 to be integer, array given in %s on line %d
NULL
+Deprecated: Function gmp_random() is deprecated in %s on line %d
+
Warning: gmp_random() expects at most 1 parameter, 2 given in %s on line %d
NULL
+Deprecated: Function gmp_random() is deprecated in %s on line %d
+
Warning: gmp_random() expects parameter 1 to be integer, string given in %s on line %d
NULL
+Deprecated: Function gmp_random() is deprecated in %s on line %d
+
Warning: gmp_random() expects parameter 1 to be integer, string given in %s on line %d
NULL
Done
diff --git a/ext/gmp/tests/gmp_random_seed-32bit.phpt b/ext/gmp/tests/gmp_random_seed-32bit.phpt
index f0f4fca6e3..95d8dd50f9 100644
--- a/ext/gmp/tests/gmp_random_seed-32bit.phpt
+++ b/ext/gmp/tests/gmp_random_seed-32bit.phpt
@@ -3,6 +3,8 @@ gmp_random_seed() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
+--INI--
+error_reporting=E_ALL&~E_DEPRECATED
--FILE--
<?php
@@ -227,4 +229,4 @@ string(4) "-378"
Warning: gmp_random_seed(): Unable to convert variable to GMP - string is not an integer in %s on line %d
bool(false)
-Done \ No newline at end of file
+Done
diff --git a/ext/gmp/tests/gmp_random_seed.phpt b/ext/gmp/tests/gmp_random_seed.phpt
index d28704e124..e143a5153e 100644
--- a/ext/gmp/tests/gmp_random_seed.phpt
+++ b/ext/gmp/tests/gmp_random_seed.phpt
@@ -3,6 +3,8 @@ gmp_random_seed() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
+--INI--
+error_reporting=E_ALL&~E_DEPRECATED
--FILE--
<?php