summaryrefslogtreecommitdiff
path: root/ext/spl/php_spl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/php_spl.c')
-rw-r--r--ext/spl/php_spl.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 87fb2ae37b..d352893672 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -39,8 +39,7 @@
#include "spl_heap.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"
-#include "ext/standard/php_rand.h"
-#include "ext/standard/php_lcg.h"
+#include "ext/standard/php_mt_rand.h"
#include "main/snprintf.h"
#ifdef COMPILE_DL_SPL
@@ -747,10 +746,6 @@ PHPAPI zend_string *php_spl_object_hash(zval *obj) /* {{{*/
intptr_t hash_handle, hash_handlers;
if (!SPL_G(hash_mask_init)) {
- if (!BG(mt_rand_is_seeded)) {
- php_mt_srand((uint32_t)GENERATE_SEED());
- }
-
SPL_G(hash_mask_handle) = (intptr_t)(php_mt_rand() >> 1);
SPL_G(hash_mask_handlers) = (intptr_t)(php_mt_rand() >> 1);
SPL_G(hash_mask_init) = 1;
@@ -759,7 +754,7 @@ PHPAPI zend_string *php_spl_object_hash(zval *obj) /* {{{*/
hash_handle = SPL_G(hash_mask_handle)^(intptr_t)Z_OBJ_HANDLE_P(obj);
hash_handlers = SPL_G(hash_mask_handlers);
- return strpprintf(32, "%016lx%016lx", hash_handle, hash_handlers);
+ return strpprintf(32, "%016zx%016zx", hash_handle, hash_handlers);
}
/* }}} */