random: Mark mt_getrandmax() as @compile-time-eval (#18425)

This commit is contained in:
Tim Düsterhus 2025-04-25 22:57:04 +02:00 committed by GitHub
parent e3433fdaef
commit 61d15870aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -27,9 +27,13 @@ namespace {
function mt_rand(int $min = UNKNOWN, int $max = UNKNOWN): int {}
/** @compile-time-eval */
function mt_getrandmax(): int {}
/** @alias mt_getrandmax */
/**
* @compile-time-eval
* @alias mt_getrandmax
*/
function getrandmax(): int {}
/** @refcount 1 */

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: fad14b8b8abaf9f33d7837ba8f6190c5d10ff63f */
* Stub hash: 8b30f08404f2912d40f4cb61b76ec283af19b79c */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_lcg_value, 0, 0, IS_DOUBLE, 0)
ZEND_END_ARG_INFO()
@ -160,8 +160,8 @@ static const zend_function_entry ext_functions[] = {
ZEND_RAW_FENTRY("srand", zif_mt_srand, arginfo_srand, 0, NULL, NULL)
ZEND_FE(rand, arginfo_rand)
ZEND_FE(mt_rand, arginfo_mt_rand)
ZEND_FE(mt_getrandmax, arginfo_mt_getrandmax)
ZEND_RAW_FENTRY("getrandmax", zif_mt_getrandmax, arginfo_getrandmax, 0, NULL, NULL)
ZEND_RAW_FENTRY("mt_getrandmax", zif_mt_getrandmax, arginfo_mt_getrandmax, ZEND_ACC_COMPILE_TIME_EVAL, NULL, NULL)
ZEND_RAW_FENTRY("getrandmax", zif_mt_getrandmax, arginfo_getrandmax, ZEND_ACC_COMPILE_TIME_EVAL, NULL, NULL)
ZEND_FE(random_bytes, arginfo_random_bytes)
ZEND_FE(random_int, arginfo_random_int)
ZEND_FE_END