add some stubs for array func in basic_functions

This commit is contained in:
jason-liew 2019-08-12 00:32:12 +08:00 committed by Christoph M. Becker
parent f40cc41465
commit ffffaf12cf
3 changed files with 45 additions and 42 deletions

View File

@ -123,48 +123,6 @@ static void user_tick_function_dtor(user_tick_function_entry *tick_function_entr
/* {{{ arginfo */
/* {{{ array.c */
ZEND_BEGIN_ARG_INFO_EX(arginfo_krsort, 0, 0, 1)
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
ZEND_ARG_INFO(0, sort_flags)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ksort, 0, 0, 1)
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
ZEND_ARG_INFO(0, sort_flags)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_count, 0, 0, 1)
ZEND_ARG_INFO(0, var)
ZEND_ARG_INFO(0, mode)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_natsort, 0)
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_natcasesort, 0)
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_asort, 0, 0, 1)
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
ZEND_ARG_INFO(0, sort_flags)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_arsort, 0, 0, 1)
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
ZEND_ARG_INFO(0, sort_flags)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_sort, 0, 0, 1)
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
ZEND_ARG_INFO(0, sort_flags)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_rsort, 0, 0, 1)
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
ZEND_ARG_INFO(0, sort_flags)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_usort, 0)
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */

View File

@ -60,6 +60,25 @@ function stream_wrapper_restore(string $protocol): bool {}
/** @return int|false */
function array_push(array &$stack, ...$args) {}
function krsort(array &$arg, int $sort_flags = SORT_REGULAR): bool {}
function ksort(array &$arg, int $sort_flags = SORT_REGULAR): bool {}
/** @param array|Countable $array */
function count($var, int $mode = COUNT_NORAML): int {}
function natsort(array &$arg): bool {}
function natcasesort(array &$arg): bool {}
function asort(array &$arg, int $sort_flags = SORT_REGULAR): bool {}
function arsort(array &$arg, int $sort_flags = SORT_REGULAR): bool {}
function sort(array &$arg, int $sort_flags = SORT_REGULAR): bool {}
function rsort(array &$arg, int $sort_flags = SORT_REGULAR): bool {}
/* base64.c */
function base64_encode(string $str): string {}

View File

@ -70,6 +70,32 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_push, 0, 0, 1)
ZEND_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_krsort, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(1, arg, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, sort_flags, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_ksort arginfo_krsort
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_count, 0, 1, IS_LONG, 0)
ZEND_ARG_INFO(0, var)
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_natsort, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(1, arg, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
#define arginfo_natcasesort arginfo_natsort
#define arginfo_asort arginfo_krsort
#define arginfo_arsort arginfo_krsort
#define arginfo_sort arginfo_krsort
#define arginfo_rsort arginfo_krsort
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_base64_encode, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
ZEND_END_ARG_INFO()