com php-src: Deprecate gmp_random(): ext/gmp/gmp.c ext/gmp/tests/gmp_random.phpt ext/gmp/tests/gmp_rand om_seed-32bit.phpt
ext/gmp/tests/gmp_random_seed .phpt
| From: | Nikita Popov | Date: | Fri, 03 Feb 2017 17:52:57 +0000 |
| Subject: | com php-src: Deprecate gmp_random(): ext/gmp/gmp.c ext/gmp/tests/gmp_random.phpt ext/gmp/tests/gmp_rand om_seed-32bit.phpt ext/gmp/tests/gmp_random_seed .phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97019@lists.php.net to get a copy of this message | ||
Commit: fbeb900be4948d9a1bdc3e139937777534cc27e4
Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 30 Jan 2017 21:42:36 +0100
Parents: 000b504b51cb3a82df0496789f249bdfed65c11b
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fbeb900be4948d9a1bdc3e139937777534cc27e4
Log:
Deprecate gmp_random()
Changed paths:
M ext/gmp/gmp.c
M ext/gmp/tests/gmp_random.phpt
M ext/gmp/tests/gmp_random_seed-32bit.phpt
M ext/gmp/tests/gmp_random_seed..phpt
Diff:
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index 43e3c92..9fcf9c1 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 d1351bb..da4ca5c 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 f0f4fca..95d8dd5 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 d28704e..e143a51 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