]> granicus.if.org Git - php/commitdiff
Make array_rand() type info more accurate
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 27 Apr 2020 13:35:19 +0000 (15:35 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 27 Apr 2020 13:36:32 +0000 (15:36 +0200)
ext/opcache/Optimizer/zend_func_info.c

index ad774facfe88f91c3f977077df74537a6822c3ac..6654ce42d880877b4870c288ddcace34f3ebb32d 100644 (file)
@@ -388,7 +388,7 @@ static const func_info_t func_infos[] = {
        FN("array_pad",                    MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
        F1("array_flip",                   MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
        F1("array_change_key_case",        MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
-       F1("array_rand",                   UNKNOWN_INFO),
+       FN("array_rand",                   MAY_BE_LONG | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
        FN("array_unique",                 MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
        F1("array_intersect",              MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
        F1("array_intersect_key",          MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),