]> granicus.if.org Git - php/commitdiff
Add opcache return type for random_int()
authorTyson Andre <tysonandre775@hotmail.com>
Mon, 9 Sep 2019 12:30:18 +0000 (08:30 -0400)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 9 Sep 2019 15:19:04 +0000 (17:19 +0200)
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

ext/opcache/Optimizer/zend_func_info.c

index 551e8e3bd1d39b1ccc547bf3c3176a5a851d25d3..1553635d078c6a7a30dedc320dd274cdfbe2bef8 100644 (file)
@@ -413,6 +413,7 @@ static const func_info_t func_infos[] = {
 #endif
        F0("rand",                         MAY_BE_NULL | MAY_BE_LONG),
        F1("random_bytes",                 MAY_BE_STRING),
+       F1("random_int",                   MAY_BE_LONG),
        F0("srand",                        MAY_BE_NULL),
        F0("getrandmax",                   MAY_BE_NULL | MAY_BE_LONG),
        F0("mt_rand",                      MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),