xref: /PHP-7.4/ext/standard/php_array.h (revision 0cf7de1c)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 7                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) The PHP Group                                          |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP license,      |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | http://www.php.net/license/3_01.txt                                  |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Authors: Andi Gutmans <andi@php.net>                                 |
16    |          Zeev Suraski <zeev@php.net>                                 |
17    |          Rasmus Lerdorf <rasmus@php.net>                             |
18    |          Andrei Zmievski <andrei@php.net>                            |
19    +----------------------------------------------------------------------+
20 */
21 
22 #ifndef PHP_ARRAY_H
23 #define PHP_ARRAY_H
24 
25 PHP_MINIT_FUNCTION(array);
26 PHP_MSHUTDOWN_FUNCTION(array);
27 
28 PHP_FUNCTION(ksort);
29 PHP_FUNCTION(krsort);
30 PHP_FUNCTION(natsort);
31 PHP_FUNCTION(natcasesort);
32 PHP_FUNCTION(asort);
33 PHP_FUNCTION(arsort);
34 PHP_FUNCTION(sort);
35 PHP_FUNCTION(rsort);
36 PHP_FUNCTION(usort);
37 PHP_FUNCTION(uasort);
38 PHP_FUNCTION(uksort);
39 PHP_FUNCTION(array_walk);
40 PHP_FUNCTION(array_walk_recursive);
41 PHP_FUNCTION(count);
42 PHP_FUNCTION(end);
43 PHP_FUNCTION(prev);
44 PHP_FUNCTION(next);
45 PHP_FUNCTION(reset);
46 PHP_FUNCTION(current);
47 PHP_FUNCTION(key);
48 PHP_FUNCTION(min);
49 PHP_FUNCTION(max);
50 PHP_FUNCTION(in_array);
51 PHP_FUNCTION(array_search);
52 PHP_FUNCTION(extract);
53 PHP_FUNCTION(compact);
54 PHP_FUNCTION(array_fill);
55 PHP_FUNCTION(array_fill_keys);
56 PHP_FUNCTION(range);
57 PHP_FUNCTION(shuffle);
58 PHP_FUNCTION(array_multisort);
59 PHP_FUNCTION(array_push);
60 PHP_FUNCTION(array_pop);
61 PHP_FUNCTION(array_shift);
62 PHP_FUNCTION(array_unshift);
63 PHP_FUNCTION(array_splice);
64 PHP_FUNCTION(array_slice);
65 PHP_FUNCTION(array_merge);
66 PHP_FUNCTION(array_merge_recursive);
67 PHP_FUNCTION(array_replace);
68 PHP_FUNCTION(array_replace_recursive);
69 PHP_FUNCTION(array_keys);
70 PHP_FUNCTION(array_key_first);
71 PHP_FUNCTION(array_key_last);
72 PHP_FUNCTION(array_values);
73 PHP_FUNCTION(array_count_values);
74 PHP_FUNCTION(array_column);
75 PHP_FUNCTION(array_reverse);
76 PHP_FUNCTION(array_reduce);
77 PHP_FUNCTION(array_pad);
78 PHP_FUNCTION(array_flip);
79 PHP_FUNCTION(array_change_key_case);
80 PHP_FUNCTION(array_rand);
81 PHP_FUNCTION(array_unique);
82 PHP_FUNCTION(array_intersect);
83 PHP_FUNCTION(array_intersect_key);
84 PHP_FUNCTION(array_intersect_ukey);
85 PHP_FUNCTION(array_uintersect);
86 PHP_FUNCTION(array_intersect_assoc);
87 PHP_FUNCTION(array_uintersect_assoc);
88 PHP_FUNCTION(array_intersect_uassoc);
89 PHP_FUNCTION(array_uintersect_uassoc);
90 PHP_FUNCTION(array_diff);
91 PHP_FUNCTION(array_diff_key);
92 PHP_FUNCTION(array_diff_ukey);
93 PHP_FUNCTION(array_udiff);
94 PHP_FUNCTION(array_diff_assoc);
95 PHP_FUNCTION(array_udiff_assoc);
96 PHP_FUNCTION(array_diff_uassoc);
97 PHP_FUNCTION(array_udiff_uassoc);
98 PHP_FUNCTION(array_sum);
99 PHP_FUNCTION(array_product);
100 PHP_FUNCTION(array_filter);
101 PHP_FUNCTION(array_map);
102 PHP_FUNCTION(array_key_exists);
103 PHP_FUNCTION(array_chunk);
104 PHP_FUNCTION(array_combine);
105 
106 PHPAPI int php_array_merge(HashTable *dest, HashTable *src);
107 PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src);
108 PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src);
109 PHPAPI int php_multisort_compare(const void *a, const void *b);
110 PHPAPI zend_long php_count_recursive(HashTable *ht);
111 
112 #define PHP_SORT_REGULAR            0
113 #define PHP_SORT_NUMERIC            1
114 #define PHP_SORT_STRING             2
115 #define PHP_SORT_DESC               3
116 #define PHP_SORT_ASC                4
117 #define PHP_SORT_LOCALE_STRING      5
118 #define PHP_SORT_NATURAL            6
119 #define PHP_SORT_FLAG_CASE          8
120 
121 #define COUNT_NORMAL      0
122 #define COUNT_RECURSIVE   1
123 
124 #define ARRAY_FILTER_USE_BOTH	1
125 #define ARRAY_FILTER_USE_KEY	2
126 
127 ZEND_BEGIN_MODULE_GLOBALS(array)
128 	compare_func_t *multisort_func;
129 ZEND_END_MODULE_GLOBALS(array)
130 
131 #define ARRAYG(v) ZEND_MODULE_GLOBALS_ACCESSOR(array, v)
132 
133 #endif /* PHP_ARRAY_H */
134