diff options
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r-- | ext/standard/basic_functions.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 55e1f7e2eb..e712d76216 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" @@ -1887,24 +1888,29 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_srand, 0, 0, 0) ZEND_ARG_INFO(0, seed) ZEND_END_ARG_INFO() -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_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO(arginfo_getrandmax, 0) +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_mt_rand, 0, 0, 0) ZEND_ARG_INFO(0, min) ZEND_ARG_INFO(0, max) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_getrandmax, 0) +ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_rand_mode, 0, 0, 1) + ZEND_ARG_INFO(0, mode) ZEND_END_ARG_INFO() /* }}} */ /* {{{ random.c */ @@ -2865,6 +2871,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(mt_rand, arginfo_mt_rand) PHP_FE(mt_srand, arginfo_mt_srand) PHP_FE(mt_getrandmax, arginfo_mt_getrandmax) + PHP_FE(mt_rand_mode, arginfo_mt_rand_mode) PHP_FE(random_bytes, arginfo_random_bytes) PHP_FE(random_int, arginfo_random_int) @@ -3479,6 +3486,7 @@ 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; @@ -3660,6 +3668,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) |