summaryrefslogtreecommitdiff
path: root/ext/standard/basic_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r--ext/standard/basic_functions.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index c7411b2a63..fd1596e5cd 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -35,6 +35,7 @@
#include "zend_operators.h"
#include "ext/standard/php_dns.h"
#include "ext/standard/php_uuencode.h"
+#include "ext/standard/php_mt_rand.h"
#ifdef PHP_WIN32
#include "win32/php_win32_globals.h"
@@ -1883,18 +1884,10 @@ ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_encode, 0)
ZEND_ARG_INFO(0, str)
ZEND_END_ARG_INFO()
/* }}} */
-/* {{{ rand.c */
-ZEND_BEGIN_ARG_INFO_EX(arginfo_srand, 0, 0, 0)
- ZEND_ARG_INFO(0, seed)
-ZEND_END_ARG_INFO()
-
+/* {{{ mt_rand.c */
ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_srand, 0, 0, 0)
ZEND_ARG_INFO(0, seed)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_rand, 0, 0, 0)
- ZEND_ARG_INFO(0, min)
- ZEND_ARG_INFO(0, max)
+ ZEND_ARG_INFO(0, mode)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_rand, 0, 0, 0)
@@ -1902,9 +1895,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_rand, 0, 0, 0)
ZEND_ARG_INFO(0, max)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO(arginfo_getrandmax, 0)
-ZEND_END_ARG_INFO()
-
ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0)
ZEND_END_ARG_INFO()
/* }}} */
@@ -2860,10 +2850,10 @@ const zend_function_entry basic_functions[] = { /* {{{ */
PHP_FE(proc_nice, arginfo_proc_nice)
#endif
- PHP_FE(rand, arginfo_rand)
- PHP_FE(srand, arginfo_srand)
- PHP_FE(getrandmax, arginfo_getrandmax)
- PHP_FE(mt_rand, arginfo_mt_rand)
+ PHP_FALIAS(rand, mt_rand, arginfo_mt_rand)
+ PHP_FALIAS(srand, mt_srand, arginfo_mt_srand)
+ PHP_FALIAS(getrandmax, mt_getrandmax, arginfo_mt_getrandmax)
+ PHP_FE(mt_rand, arginfo_mt_rand)
PHP_FE(mt_srand, arginfo_mt_srand)
PHP_FE(mt_getrandmax, arginfo_mt_getrandmax)
@@ -3478,8 +3468,8 @@ static void php_putenv_destructor(zval *zv) /* {{{ */
static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */
{
- BG(rand_is_seeded) = 0;
BG(mt_rand_is_seeded) = 0;
+ BG(mt_rand_mode) = MT_RAND_MT19937;
BG(umask) = -1;
BG(next) = NULL;
BG(left) = -1;
@@ -3661,6 +3651,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
BASIC_MINIT_SUBMODULE(standard_filters)
BASIC_MINIT_SUBMODULE(user_filters)
BASIC_MINIT_SUBMODULE(password)
+ BASIC_MINIT_SUBMODULE(mt_rand)
#if defined(HAVE_LOCALECONV) && defined(ZTS)
BASIC_MINIT_SUBMODULE(localeconv)