@@ -197,22 +197,22 @@ PHPAPI uint64_t php_random_range64(php_random_algo_with_state engine, uint64_t u
197
197
198
198
static zend_object * php_random_engine_mt19937_new (zend_class_entry * ce )
199
199
{
200
- return & php_random_engine_common_init (ce , & random_engine_mt19937_object_handlers , & php_random_algo_mt19937 )-> std ;
200
+ return & php_random_engine_common_init (ce , & php_random_algo_mt19937 )-> std ;
201
201
}
202
202
203
203
static zend_object * php_random_engine_pcgoneseq128xslrr64_new (zend_class_entry * ce )
204
204
{
205
- return & php_random_engine_common_init (ce , & random_engine_pcgoneseq128xslrr64_object_handlers , & php_random_algo_pcgoneseq128xslrr64 )-> std ;
205
+ return & php_random_engine_common_init (ce , & php_random_algo_pcgoneseq128xslrr64 )-> std ;
206
206
}
207
207
208
208
static zend_object * php_random_engine_xoshiro256starstar_new (zend_class_entry * ce )
209
209
{
210
- return & php_random_engine_common_init (ce , & random_engine_xoshiro256starstar_object_handlers , & php_random_algo_xoshiro256starstar )-> std ;
210
+ return & php_random_engine_common_init (ce , & php_random_algo_xoshiro256starstar )-> std ;
211
211
}
212
212
213
213
static zend_object * php_random_engine_secure_new (zend_class_entry * ce )
214
214
{
215
- return & php_random_engine_common_init (ce , & random_engine_secure_object_handlers , & php_random_algo_secure )-> std ;
215
+ return & php_random_engine_common_init (ce , & php_random_algo_secure )-> std ;
216
216
}
217
217
218
218
static zend_object * php_random_randomizer_new (zend_class_entry * ce )
@@ -250,7 +250,7 @@ PHPAPI void php_random_status_free(void *status, const bool persistent)
250
250
pefree (status , persistent );
251
251
}
252
252
253
- PHPAPI php_random_engine * php_random_engine_common_init (zend_class_entry * ce , zend_object_handlers * handlers , const php_random_algo * algo )
253
+ PHPAPI php_random_engine * php_random_engine_common_init (zend_class_entry * ce , const php_random_algo * algo )
254
254
{
255
255
php_random_engine * engine = zend_object_alloc (sizeof (php_random_engine ), ce );
256
256
@@ -261,7 +261,6 @@ PHPAPI php_random_engine *php_random_engine_common_init(zend_class_entry *ce, ze
261
261
.algo = algo ,
262
262
.state = php_random_status_alloc (algo , false)
263
263
};
264
- engine -> std .handlers = handlers ;
265
264
266
265
return engine ;
267
266
}
@@ -746,6 +745,7 @@ PHP_MINIT_FUNCTION(random)
746
745
/* Random\Engine\Mt19937 */
747
746
random_ce_Random_Engine_Mt19937 = register_class_Random_Engine_Mt19937 (random_ce_Random_Engine );
748
747
random_ce_Random_Engine_Mt19937 -> create_object = php_random_engine_mt19937_new ;
748
+ random_ce_Random_Engine_Mt19937 -> default_object_handlers = & random_engine_mt19937_object_handlers ;
749
749
memcpy (& random_engine_mt19937_object_handlers , zend_get_std_object_handlers (), sizeof (zend_object_handlers ));
750
750
random_engine_mt19937_object_handlers .offset = XtOffsetOf (php_random_engine , std );
751
751
random_engine_mt19937_object_handlers .free_obj = php_random_engine_common_free_object ;
@@ -754,6 +754,7 @@ PHP_MINIT_FUNCTION(random)
754
754
/* Random\Engine\PcgOnseq128XslRr64 */
755
755
random_ce_Random_Engine_PcgOneseq128XslRr64 = register_class_Random_Engine_PcgOneseq128XslRr64 (random_ce_Random_Engine );
756
756
random_ce_Random_Engine_PcgOneseq128XslRr64 -> create_object = php_random_engine_pcgoneseq128xslrr64_new ;
757
+ random_ce_Random_Engine_PcgOneseq128XslRr64 -> default_object_handlers = & random_engine_pcgoneseq128xslrr64_object_handlers ;
757
758
memcpy (& random_engine_pcgoneseq128xslrr64_object_handlers , zend_get_std_object_handlers (), sizeof (zend_object_handlers ));
758
759
random_engine_pcgoneseq128xslrr64_object_handlers .offset = XtOffsetOf (php_random_engine , std );
759
760
random_engine_pcgoneseq128xslrr64_object_handlers .free_obj = php_random_engine_common_free_object ;
@@ -762,6 +763,7 @@ PHP_MINIT_FUNCTION(random)
762
763
/* Random\Engine\Xoshiro256StarStar */
763
764
random_ce_Random_Engine_Xoshiro256StarStar = register_class_Random_Engine_Xoshiro256StarStar (random_ce_Random_Engine );
764
765
random_ce_Random_Engine_Xoshiro256StarStar -> create_object = php_random_engine_xoshiro256starstar_new ;
766
+ random_ce_Random_Engine_Xoshiro256StarStar -> default_object_handlers = & random_engine_xoshiro256starstar_object_handlers ;
765
767
memcpy (& random_engine_xoshiro256starstar_object_handlers , zend_get_std_object_handlers (), sizeof (zend_object_handlers ));
766
768
random_engine_xoshiro256starstar_object_handlers .offset = XtOffsetOf (php_random_engine , std );
767
769
random_engine_xoshiro256starstar_object_handlers .free_obj = php_random_engine_common_free_object ;
@@ -770,6 +772,7 @@ PHP_MINIT_FUNCTION(random)
770
772
/* Random\Engine\Secure */
771
773
random_ce_Random_Engine_Secure = register_class_Random_Engine_Secure (random_ce_Random_CryptoSafeEngine );
772
774
random_ce_Random_Engine_Secure -> create_object = php_random_engine_secure_new ;
775
+ random_ce_Random_Engine_Secure -> default_object_handlers = & random_engine_secure_object_handlers ;
773
776
memcpy (& random_engine_secure_object_handlers , zend_get_std_object_handlers (), sizeof (zend_object_handlers ));
774
777
random_engine_secure_object_handlers .offset = XtOffsetOf (php_random_engine , std );
775
778
random_engine_secure_object_handlers .free_obj = php_random_engine_common_free_object ;
0 commit comments