Skip to content

Commit 3e89e9a

Browse files
TysonAndrenikic
authored andcommitted
Add opcache return type for random_int()
random_int() will throw for incorrect argument counts, types (e.g. float that can't cast to int), or having min > max. See ext/standard/random.c
1 parent 45e529d commit 3e89e9a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ static const func_info_t func_infos[] = {
413413
#endif
414414
F0("rand", MAY_BE_NULL | MAY_BE_LONG),
415415
F1("random_bytes", MAY_BE_STRING),
416+
F1("random_int", MAY_BE_LONG),
416417
F0("srand", MAY_BE_NULL),
417418
F0("getrandmax", MAY_BE_NULL | MAY_BE_LONG),
418419
F0("mt_rand", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),

0 commit comments

Comments
 (0)