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 +----------------------------------------------------------------------+
18 */
19
20 #include "php.h"
21 #include "php_streams.h"
22 #include "php_main.h"
23 #include "php_globals.h"
24 #include "php_variables.h"
25 #include "php_ini.h"
26 #include "php_standard.h"
27 #include "php_math.h"
28 #include "php_http.h"
29 #include "php_incomplete_class.h"
30 #include "php_getopt.h"
31 #include "ext/standard/info.h"
32 #include "ext/session/php_session.h"
33 #include "zend_operators.h"
34 #include "ext/standard/php_dns.h"
35 #include "ext/standard/php_uuencode.h"
36 #include "ext/standard/php_mt_rand.h"
37
38 #ifdef PHP_WIN32
39 #include "win32/php_win32_globals.h"
40 #include "win32/time.h"
41 #include "win32/ioutil.h"
42 #endif
43
44 typedef struct yy_buffer_state *YY_BUFFER_STATE;
45
46 #include "zend.h"
47 #include "zend_ini_scanner.h"
48 #include "zend_language_scanner.h"
49 #include <zend_language_parser.h>
50
51 #include "zend_portability.h"
52
53 #include <stdarg.h>
54 #include <stdlib.h>
55 #include <math.h>
56 #include <time.h>
57 #include <stdio.h>
58
59 #ifndef PHP_WIN32
60 #include <sys/types.h>
61 #include <sys/stat.h>
62 #endif
63
64 #ifndef PHP_WIN32
65 # include <netdb.h>
66 #else
67 #include "win32/inet.h"
68 #endif
69
70 #if HAVE_ARPA_INET_H
71 # include <arpa/inet.h>
72 #endif
73
74 #if HAVE_UNISTD_H
75 # include <unistd.h>
76 #endif
77
78 #include <string.h>
79 #include <locale.h>
80
81 #if HAVE_SYS_MMAN_H
82 # include <sys/mman.h>
83 #endif
84
85 #if HAVE_SYS_LOADAVG_H
86 # include <sys/loadavg.h>
87 #endif
88
89 #ifdef PHP_WIN32
90 # include "win32/unistd.h"
91 #endif
92
93 #ifndef INADDR_NONE
94 #define INADDR_NONE ((zend_ulong) -1)
95 #endif
96
97 #include "zend_globals.h"
98 #include "php_globals.h"
99 #include "SAPI.h"
100 #include "php_ticks.h"
101
102 #ifdef ZTS
103 PHPAPI int basic_globals_id;
104 #else
105 PHPAPI php_basic_globals basic_globals;
106 #endif
107
108 #include "php_fopen_wrappers.h"
109 #include "streamsfuncs.h"
110
111 static zend_class_entry *incomplete_class_entry = NULL;
112
113 typedef struct _user_tick_function_entry {
114 zval *arguments;
115 int arg_count;
116 int calling;
117 } user_tick_function_entry;
118
119 /* some prototypes for local functions */
120 static void user_shutdown_function_dtor(zval *zv);
121 static void user_tick_function_dtor(user_tick_function_entry *tick_function_entry);
122
123 /* {{{ arginfo */
124 /* {{{ main/main.c */
125 ZEND_BEGIN_ARG_INFO(arginfo_set_time_limit, 0)
126 ZEND_ARG_INFO(0, seconds)
127 ZEND_END_ARG_INFO()
128 /* }}} */
129
130 /* {{{ main/sapi.c */
131 ZEND_BEGIN_ARG_INFO(arginfo_header_register_callback, 0)
132 ZEND_ARG_INFO(0, callback)
133 ZEND_END_ARG_INFO()
134 /* }}} */
135
136 /* {{{ main/output.c */
137 ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_start, 0, 0, 0)
138 ZEND_ARG_INFO(0, user_function)
139 ZEND_ARG_INFO(0, chunk_size)
140 ZEND_ARG_INFO(0, flags)
141 ZEND_END_ARG_INFO()
142
143 ZEND_BEGIN_ARG_INFO(arginfo_ob_flush, 0)
144 ZEND_END_ARG_INFO()
145
146 ZEND_BEGIN_ARG_INFO(arginfo_ob_clean, 0)
147 ZEND_END_ARG_INFO()
148
149 ZEND_BEGIN_ARG_INFO(arginfo_ob_end_flush, 0)
150 ZEND_END_ARG_INFO()
151
152 ZEND_BEGIN_ARG_INFO(arginfo_ob_end_clean, 0)
153 ZEND_END_ARG_INFO()
154
155 ZEND_BEGIN_ARG_INFO(arginfo_ob_get_flush, 0)
156 ZEND_END_ARG_INFO()
157
158 ZEND_BEGIN_ARG_INFO(arginfo_ob_get_clean, 0)
159 ZEND_END_ARG_INFO()
160
161 ZEND_BEGIN_ARG_INFO(arginfo_ob_get_contents, 0)
162 ZEND_END_ARG_INFO()
163
164 ZEND_BEGIN_ARG_INFO(arginfo_ob_get_level, 0)
165 ZEND_END_ARG_INFO()
166
167 ZEND_BEGIN_ARG_INFO(arginfo_ob_get_length, 0)
168 ZEND_END_ARG_INFO()
169
170 ZEND_BEGIN_ARG_INFO(arginfo_ob_list_handlers, 0)
171 ZEND_END_ARG_INFO()
172
173 ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_get_status, 0, 0, 0)
174 ZEND_ARG_INFO(0, full_status)
175 ZEND_END_ARG_INFO()
176
177 ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_implicit_flush, 0, 0, 0)
178 ZEND_ARG_INFO(0, flag)
179 ZEND_END_ARG_INFO()
180
181 ZEND_BEGIN_ARG_INFO(arginfo_output_reset_rewrite_vars, 0)
182 ZEND_END_ARG_INFO()
183
184 ZEND_BEGIN_ARG_INFO(arginfo_output_add_rewrite_var, 0)
185 ZEND_ARG_INFO(0, name)
186 ZEND_ARG_INFO(0, value)
187 ZEND_END_ARG_INFO()
188 /* }}} */
189 /* {{{ main/streams/userspace.c */
190 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_wrapper_register, 0, 0, 2)
191 ZEND_ARG_INFO(0, protocol)
192 ZEND_ARG_INFO(0, classname)
193 ZEND_ARG_INFO(0, flags)
194 ZEND_END_ARG_INFO()
195
196 ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_unregister, 0)
197 ZEND_ARG_INFO(0, protocol)
198 ZEND_END_ARG_INFO()
199
200 ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_restore, 0)
201 ZEND_ARG_INFO(0, protocol)
202 ZEND_END_ARG_INFO()
203 /* }}} */
204 /* {{{ array.c */
205 ZEND_BEGIN_ARG_INFO_EX(arginfo_krsort, 0, 0, 1)
206 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
207 ZEND_ARG_INFO(0, sort_flags)
208 ZEND_END_ARG_INFO()
209
210 ZEND_BEGIN_ARG_INFO_EX(arginfo_ksort, 0, 0, 1)
211 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
212 ZEND_ARG_INFO(0, sort_flags)
213 ZEND_END_ARG_INFO()
214
215 ZEND_BEGIN_ARG_INFO_EX(arginfo_count, 0, 0, 1)
216 ZEND_ARG_INFO(0, var)
217 ZEND_ARG_INFO(0, mode)
218 ZEND_END_ARG_INFO()
219
220 ZEND_BEGIN_ARG_INFO(arginfo_natsort, 0)
221 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
222 ZEND_END_ARG_INFO()
223
224 ZEND_BEGIN_ARG_INFO(arginfo_natcasesort, 0)
225 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
226 ZEND_END_ARG_INFO()
227
228 ZEND_BEGIN_ARG_INFO_EX(arginfo_asort, 0, 0, 1)
229 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
230 ZEND_ARG_INFO(0, sort_flags)
231 ZEND_END_ARG_INFO()
232
233 ZEND_BEGIN_ARG_INFO_EX(arginfo_arsort, 0, 0, 1)
234 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
235 ZEND_ARG_INFO(0, sort_flags)
236 ZEND_END_ARG_INFO()
237
238 ZEND_BEGIN_ARG_INFO_EX(arginfo_sort, 0, 0, 1)
239 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
240 ZEND_ARG_INFO(0, sort_flags)
241 ZEND_END_ARG_INFO()
242
243 ZEND_BEGIN_ARG_INFO_EX(arginfo_rsort, 0, 0, 1)
244 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
245 ZEND_ARG_INFO(0, sort_flags)
246 ZEND_END_ARG_INFO()
247
248 ZEND_BEGIN_ARG_INFO(arginfo_usort, 0)
249 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
250 ZEND_ARG_INFO(0, cmp_function)
251 ZEND_END_ARG_INFO()
252
253 ZEND_BEGIN_ARG_INFO(arginfo_uasort, 0)
254 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
255 ZEND_ARG_INFO(0, cmp_function)
256 ZEND_END_ARG_INFO()
257
258 ZEND_BEGIN_ARG_INFO(arginfo_uksort, 0)
259 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
260 ZEND_ARG_INFO(0, cmp_function)
261 ZEND_END_ARG_INFO()
262
263 ZEND_BEGIN_ARG_INFO(arginfo_end, 0)
264 ZEND_ARG_INFO(1, arg)
265 ZEND_END_ARG_INFO()
266
267 ZEND_BEGIN_ARG_INFO(arginfo_prev, 0)
268 ZEND_ARG_INFO(1, arg)
269 ZEND_END_ARG_INFO()
270
271 ZEND_BEGIN_ARG_INFO(arginfo_next, 0)
272 ZEND_ARG_INFO(1, arg)
273 ZEND_END_ARG_INFO()
274
275 ZEND_BEGIN_ARG_INFO(arginfo_reset, 0)
276 ZEND_ARG_INFO(1, arg)
277 ZEND_END_ARG_INFO()
278
279 ZEND_BEGIN_ARG_INFO(arginfo_current, 0)
280 ZEND_ARG_INFO(0, arg)
281 ZEND_END_ARG_INFO()
282
283 ZEND_BEGIN_ARG_INFO(arginfo_key, 0)
284 ZEND_ARG_INFO(0, arg)
285 ZEND_END_ARG_INFO()
286
287 ZEND_BEGIN_ARG_INFO_EX(arginfo_min, 0, 0, 1)
288 ZEND_ARG_VARIADIC_INFO(0, args)
289 ZEND_END_ARG_INFO()
290
291 ZEND_BEGIN_ARG_INFO_EX(arginfo_max, 0, 0, 1)
292 ZEND_ARG_VARIADIC_INFO(0, args)
293 ZEND_END_ARG_INFO()
294
295 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk, 0, 0, 2)
296 ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
297 ZEND_ARG_INFO(0, funcname)
298 ZEND_ARG_INFO(0, userdata)
299 ZEND_END_ARG_INFO()
300
301 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk_recursive, 0, 0, 2)
302 ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
303 ZEND_ARG_INFO(0, funcname)
304 ZEND_ARG_INFO(0, userdata)
305 ZEND_END_ARG_INFO()
306
307 ZEND_BEGIN_ARG_INFO_EX(arginfo_in_array, 0, 0, 2)
308 ZEND_ARG_INFO(0, needle)
309 ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
310 ZEND_ARG_INFO(0, strict)
311 ZEND_END_ARG_INFO()
312
313 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_search, 0, 0, 2)
314 ZEND_ARG_INFO(0, needle)
315 ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
316 ZEND_ARG_INFO(0, strict)
317 ZEND_END_ARG_INFO()
318
319 ZEND_BEGIN_ARG_INFO_EX(arginfo_extract, 0, 0, 1)
320 ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) /* ARRAY_INFO(0, arg, 0) */
321 ZEND_ARG_INFO(0, extract_type)
322 ZEND_ARG_INFO(0, prefix)
323 ZEND_END_ARG_INFO()
324
325 ZEND_BEGIN_ARG_INFO_EX(arginfo_compact, 0, 0, 1)
326 ZEND_ARG_VARIADIC_INFO(0, var_names)
327 ZEND_END_ARG_INFO()
328
329 ZEND_BEGIN_ARG_INFO(arginfo_array_fill, 0)
330 ZEND_ARG_INFO(0, start_key)
331 ZEND_ARG_INFO(0, num)
332 ZEND_ARG_INFO(0, val)
333 ZEND_END_ARG_INFO()
334
335 ZEND_BEGIN_ARG_INFO(arginfo_array_fill_keys, 0)
336 ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
337 ZEND_ARG_INFO(0, val)
338 ZEND_END_ARG_INFO()
339
340 ZEND_BEGIN_ARG_INFO_EX(arginfo_range, 0, 0, 2)
341 ZEND_ARG_INFO(0, low)
342 ZEND_ARG_INFO(0, high)
343 ZEND_ARG_INFO(0, step)
344 ZEND_END_ARG_INFO()
345
346 ZEND_BEGIN_ARG_INFO(arginfo_shuffle, 0)
347 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
348 ZEND_END_ARG_INFO()
349
350 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_push, 0, 0, 1)
351 ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
352 ZEND_ARG_VARIADIC_INFO(0, vars)
353 ZEND_END_ARG_INFO()
354
355 ZEND_BEGIN_ARG_INFO(arginfo_array_pop, 0)
356 ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
357 ZEND_END_ARG_INFO()
358
359 ZEND_BEGIN_ARG_INFO(arginfo_array_shift, 0)
360 ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
361 ZEND_END_ARG_INFO()
362
363 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unshift, 0, 0, 1)
364 ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
365 ZEND_ARG_VARIADIC_INFO(0, vars)
366 ZEND_END_ARG_INFO()
367
368 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_splice, 0, 0, 2)
369 ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
370 ZEND_ARG_INFO(0, offset)
371 ZEND_ARG_INFO(0, length)
372 ZEND_ARG_INFO(0, replacement) /* ARRAY_INFO(0, arg, 1) */
373 ZEND_END_ARG_INFO()
374
375 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_slice, 0, 0, 2)
376 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(1, arg, 0) */
377 ZEND_ARG_INFO(0, offset)
378 ZEND_ARG_INFO(0, length)
379 ZEND_ARG_INFO(0, preserve_keys)
380 ZEND_END_ARG_INFO()
381
382 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 0)
383 ZEND_ARG_VARIADIC_INFO(0, arrays)
384 ZEND_END_ARG_INFO()
385
386 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 0)
387 ZEND_ARG_VARIADIC_INFO(0, arrays)
388 ZEND_END_ARG_INFO()
389
390 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 1)
391 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
392 ZEND_ARG_VARIADIC_INFO(0, arrays)
393 ZEND_END_ARG_INFO()
394
395 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 1)
396 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
397 ZEND_ARG_VARIADIC_INFO(0, arrays)
398 ZEND_END_ARG_INFO()
399
400 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_keys, 0, 0, 1)
401 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
402 ZEND_ARG_INFO(0, search_value)
403 ZEND_ARG_INFO(0, strict)
404 ZEND_END_ARG_INFO()
405
406 ZEND_BEGIN_ARG_INFO(arginfo_array_key_first, 0)
407 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
408 ZEND_END_ARG_INFO()
409
410 ZEND_BEGIN_ARG_INFO(arginfo_array_key_last, 0)
411 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
412 ZEND_END_ARG_INFO()
413
414
415 ZEND_BEGIN_ARG_INFO(arginfo_array_values, 0)
416 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
417 ZEND_END_ARG_INFO()
418
419 ZEND_BEGIN_ARG_INFO(arginfo_array_count_values, 0)
420 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
421 ZEND_END_ARG_INFO()
422
423 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_column, 0, 0, 2)
424 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
425 ZEND_ARG_INFO(0, column_key)
426 ZEND_ARG_INFO(0, index_key)
427 ZEND_END_ARG_INFO()
428
429 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reverse, 0, 0, 1)
430 ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
431 ZEND_ARG_INFO(0, preserve_keys)
432 ZEND_END_ARG_INFO()
433
434 ZEND_BEGIN_ARG_INFO(arginfo_array_pad, 0)
435 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
436 ZEND_ARG_INFO(0, pad_size)
437 ZEND_ARG_INFO(0, pad_value)
438 ZEND_END_ARG_INFO()
439
440 ZEND_BEGIN_ARG_INFO(arginfo_array_flip, 0)
441 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
442 ZEND_END_ARG_INFO()
443
444 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_change_key_case, 0, 0, 1)
445 ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
446 ZEND_ARG_INFO(0, case)
447 ZEND_END_ARG_INFO()
448
449 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unique, 0, 0, 1)
450 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
451 ZEND_ARG_INFO(0, flags)
452 ZEND_END_ARG_INFO()
453
454 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_key, 0, 0, 2)
455 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
456 ZEND_ARG_VARIADIC_INFO(0, arrays)
457 ZEND_END_ARG_INFO()
458
459 ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_ukey, 0)
460 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
461 ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
462 ZEND_ARG_INFO(0, callback_key_compare_func)
463 ZEND_END_ARG_INFO()
464
465 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect, 0, 0, 2)
466 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
467 ZEND_ARG_VARIADIC_INFO(0, arrays)
468 ZEND_END_ARG_INFO()
469
470 ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect, 0)
471 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
472 ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
473 ZEND_ARG_INFO(0, callback_data_compare_func)
474 ZEND_END_ARG_INFO()
475
476 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_assoc, 0, 0, 2)
477 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
478 ZEND_ARG_VARIADIC_INFO(0, arrays)
479 ZEND_END_ARG_INFO()
480
481 ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_assoc, 0)
482 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
483 ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
484 ZEND_ARG_INFO(0, callback_data_compare_func)
485 ZEND_END_ARG_INFO()
486
487 ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_uassoc, 0)
488 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
489 ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
490 ZEND_ARG_INFO(0, callback_key_compare_func)
491 ZEND_END_ARG_INFO()
492
493 ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_uassoc, 0)
494 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
495 ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
496 ZEND_ARG_INFO(0, callback_data_compare_func)
497 ZEND_ARG_INFO(0, callback_key_compare_func)
498 ZEND_END_ARG_INFO()
499
500 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_key, 0, 0, 2)
501 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
502 ZEND_ARG_VARIADIC_INFO(0, arrays)
503 ZEND_END_ARG_INFO()
504
505 ZEND_BEGIN_ARG_INFO(arginfo_array_diff_ukey, 0)
506 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
507 ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
508 ZEND_ARG_INFO(0, callback_key_comp_func)
509 ZEND_END_ARG_INFO()
510
511 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff, 0, 0, 2)
512 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
513 ZEND_ARG_VARIADIC_INFO(0, arrays)
514 ZEND_END_ARG_INFO()
515
516 ZEND_BEGIN_ARG_INFO(arginfo_array_udiff, 0)
517 ZEND_ARG_INFO(0, arr1)
518 ZEND_ARG_INFO(0, arr2)
519 ZEND_ARG_INFO(0, callback_data_comp_func)
520 ZEND_END_ARG_INFO()
521
522 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_assoc, 0, 0, 2)
523 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
524 ZEND_ARG_VARIADIC_INFO(0, arrays)
525 ZEND_END_ARG_INFO()
526
527 ZEND_BEGIN_ARG_INFO(arginfo_array_diff_uassoc, 0)
528 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
529 ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
530 ZEND_ARG_INFO(0, callback_data_comp_func)
531 ZEND_END_ARG_INFO()
532
533 ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_assoc, 0)
534 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
535 ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
536 ZEND_ARG_INFO(0, callback_key_comp_func)
537 ZEND_END_ARG_INFO()
538
539 ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_uassoc, 0)
540 ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
541 ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
542 ZEND_ARG_INFO(0, callback_data_comp_func)
543 ZEND_ARG_INFO(0, callback_key_comp_func)
544 ZEND_END_ARG_INFO()
545
546 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, 0, 0, 1)
547 ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr1) /* ARRAY_INFO(0, arg1, 0) */
548 ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_order)
549 ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_flags)
550 ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, arr2)
551 ZEND_END_ARG_INFO()
552
553 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1)
554 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
555 ZEND_ARG_INFO(0, num_req)
556 ZEND_END_ARG_INFO()
557
558 ZEND_BEGIN_ARG_INFO(arginfo_array_sum, 0)
559 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
560 ZEND_END_ARG_INFO()
561
562 ZEND_BEGIN_ARG_INFO(arginfo_array_product, 0)
563 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
564 ZEND_END_ARG_INFO()
565
566 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reduce, 0, 0, 2)
567 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
568 ZEND_ARG_INFO(0, callback)
569 ZEND_ARG_INFO(0, initial)
570 ZEND_END_ARG_INFO()
571
572 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_filter, 0, 0, 1)
573 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
574 ZEND_ARG_INFO(0, callback)
575 ZEND_ARG_INFO(0, use_keys)
576 ZEND_END_ARG_INFO()
577
578 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 2)
579 ZEND_ARG_INFO(0, callback)
580 ZEND_ARG_VARIADIC_INFO(0, arrays)
581 ZEND_END_ARG_INFO()
582
583 ZEND_BEGIN_ARG_INFO(arginfo_array_key_exists, 0)
584 ZEND_ARG_INFO(0, key)
585 ZEND_ARG_INFO(0, search)
586 ZEND_END_ARG_INFO()
587
588 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_chunk, 0, 0, 2)
589 ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
590 ZEND_ARG_INFO(0, size)
591 ZEND_ARG_INFO(0, preserve_keys)
592 ZEND_END_ARG_INFO()
593
594 ZEND_BEGIN_ARG_INFO(arginfo_array_combine, 0)
595 ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
596 ZEND_ARG_INFO(0, values) /* ARRAY_INFO(0, values, 0) */
597 ZEND_END_ARG_INFO()
598 /* }}} */
599 /* {{{ basic_functions.c */
600 ZEND_BEGIN_ARG_INFO(arginfo_get_magic_quotes_gpc, 0)
601 ZEND_END_ARG_INFO()
602
603 ZEND_BEGIN_ARG_INFO(arginfo_get_magic_quotes_runtime, 0)
604 ZEND_END_ARG_INFO()
605
606 ZEND_BEGIN_ARG_INFO(arginfo_constant, 0)
607 ZEND_ARG_INFO(0, const_name)
608 ZEND_END_ARG_INFO()
609
610 #ifdef HAVE_INET_NTOP
611 ZEND_BEGIN_ARG_INFO(arginfo_inet_ntop, 0)
612 ZEND_ARG_INFO(0, in_addr)
613 ZEND_END_ARG_INFO()
614 #endif
615
616 #ifdef HAVE_INET_PTON
617 ZEND_BEGIN_ARG_INFO(arginfo_inet_pton, 0)
618 ZEND_ARG_INFO(0, ip_address)
619 ZEND_END_ARG_INFO()
620 #endif
621
622 ZEND_BEGIN_ARG_INFO(arginfo_ip2long, 0)
623 ZEND_ARG_INFO(0, ip_address)
624 ZEND_END_ARG_INFO()
625
626 ZEND_BEGIN_ARG_INFO(arginfo_long2ip, 0)
627 ZEND_ARG_INFO(0, proper_address)
628 ZEND_END_ARG_INFO()
629
630 ZEND_BEGIN_ARG_INFO_EX(arginfo_getenv, 0, 0, 0)
631 ZEND_ARG_INFO(0, varname)
632 ZEND_ARG_INFO(0, local_only)
633 ZEND_END_ARG_INFO()
634
635 #ifdef HAVE_PUTENV
636 ZEND_BEGIN_ARG_INFO(arginfo_putenv, 0)
637 ZEND_ARG_INFO(0, setting)
638 ZEND_END_ARG_INFO()
639 #endif
640
641 ZEND_BEGIN_ARG_INFO_EX(arginfo_getopt, 0, 0, 1)
642 ZEND_ARG_INFO(0, options)
643 ZEND_ARG_INFO(0, opts) /* ARRAY_INFO(0, opts, 1) */
644 ZEND_ARG_INFO(1, optind)
645 ZEND_END_ARG_INFO()
646
647 ZEND_BEGIN_ARG_INFO(arginfo_flush, 0)
648 ZEND_END_ARG_INFO()
649
650 ZEND_BEGIN_ARG_INFO(arginfo_sleep, 0)
651 ZEND_ARG_INFO(0, seconds)
652 ZEND_END_ARG_INFO()
653
654 ZEND_BEGIN_ARG_INFO(arginfo_usleep, 0)
655 ZEND_ARG_INFO(0, micro_seconds)
656 ZEND_END_ARG_INFO()
657
658 #if HAVE_NANOSLEEP
659 ZEND_BEGIN_ARG_INFO(arginfo_time_nanosleep, 0)
660 ZEND_ARG_INFO(0, seconds)
661 ZEND_ARG_INFO(0, nanoseconds)
662 ZEND_END_ARG_INFO()
663
664 ZEND_BEGIN_ARG_INFO(arginfo_time_sleep_until, 0)
665 ZEND_ARG_INFO(0, timestamp)
666 ZEND_END_ARG_INFO()
667 #endif
668
669 ZEND_BEGIN_ARG_INFO(arginfo_get_current_user, 0)
670 ZEND_END_ARG_INFO()
671
672 ZEND_BEGIN_ARG_INFO(arginfo_get_cfg_var, 0)
673 ZEND_ARG_INFO(0, option_name)
674 ZEND_END_ARG_INFO()
675
676 ZEND_BEGIN_ARG_INFO_EX(arginfo_error_log, 0, 0, 1)
677 ZEND_ARG_INFO(0, message)
678 ZEND_ARG_INFO(0, message_type)
679 ZEND_ARG_INFO(0, destination)
680 ZEND_ARG_INFO(0, extra_headers)
681 ZEND_END_ARG_INFO()
682
683 ZEND_BEGIN_ARG_INFO_EX(arginfo_error_get_last, 0, 0, 0)
684 ZEND_END_ARG_INFO()
685
686 ZEND_BEGIN_ARG_INFO_EX(arginfo_error_clear_last, 0, 0, 0)
687 ZEND_END_ARG_INFO()
688
689 ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func, 0, 0, 1)
690 ZEND_ARG_INFO(0, function_name)
691 ZEND_ARG_VARIADIC_INFO(0, parameters)
692 ZEND_END_ARG_INFO()
693
694 ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func_array, 0, 0, 2)
695 ZEND_ARG_INFO(0, function_name)
696 ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
697 ZEND_END_ARG_INFO()
698
699 ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call, 0, 0, 1)
700 ZEND_ARG_INFO(0, function_name)
701 ZEND_ARG_VARIADIC_INFO(0, parameters)
702 ZEND_END_ARG_INFO()
703
704 ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call_array, 0, 0, 2)
705 ZEND_ARG_INFO(0, function_name)
706 ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
707 ZEND_END_ARG_INFO()
708
709 ZEND_BEGIN_ARG_INFO_EX(arginfo_register_shutdown_function, 0, 0, 1)
710 ZEND_ARG_INFO(0, function_name)
711 ZEND_ARG_VARIADIC_INFO(0, parameters)
712 ZEND_END_ARG_INFO()
713
714 ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_file, 0, 0, 1)
715 ZEND_ARG_INFO(0, file_name)
716 ZEND_ARG_INFO(0, return)
717 ZEND_END_ARG_INFO()
718
719 ZEND_BEGIN_ARG_INFO(arginfo_php_strip_whitespace, 0)
720 ZEND_ARG_INFO(0, file_name)
721 ZEND_END_ARG_INFO()
722
723 ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_string, 0, 0, 1)
724 ZEND_ARG_INFO(0, string)
725 ZEND_ARG_INFO(0, return)
726 ZEND_END_ARG_INFO()
727
728 ZEND_BEGIN_ARG_INFO(arginfo_ini_get, 0)
729 ZEND_ARG_INFO(0, varname)
730 ZEND_END_ARG_INFO()
731
732 ZEND_BEGIN_ARG_INFO_EX(arginfo_ini_get_all, 0, 0, 0)
733 ZEND_ARG_INFO(0, extension)
734 ZEND_ARG_INFO(0, details)
735 ZEND_END_ARG_INFO()
736
737 ZEND_BEGIN_ARG_INFO(arginfo_ini_set, 0)
738 ZEND_ARG_INFO(0, varname)
739 ZEND_ARG_INFO(0, newvalue)
740 ZEND_END_ARG_INFO()
741
742 ZEND_BEGIN_ARG_INFO(arginfo_ini_restore, 0)
743 ZEND_ARG_INFO(0, varname)
744 ZEND_END_ARG_INFO()
745
746 ZEND_BEGIN_ARG_INFO(arginfo_set_include_path, 0)
747 ZEND_ARG_INFO(0, new_include_path)
748 ZEND_END_ARG_INFO()
749
750 ZEND_BEGIN_ARG_INFO(arginfo_get_include_path, 0)
751 ZEND_END_ARG_INFO()
752
753 ZEND_BEGIN_ARG_INFO(arginfo_restore_include_path, 0)
754 ZEND_END_ARG_INFO()
755
756 ZEND_BEGIN_ARG_INFO_EX(arginfo_print_r, 0, 0, 1)
757 ZEND_ARG_INFO(0, var)
758 ZEND_ARG_INFO(0, return)
759 ZEND_END_ARG_INFO()
760
761 ZEND_BEGIN_ARG_INFO(arginfo_connection_aborted, 0)
762 ZEND_END_ARG_INFO()
763
764 ZEND_BEGIN_ARG_INFO(arginfo_connection_status, 0)
765 ZEND_END_ARG_INFO()
766
767 ZEND_BEGIN_ARG_INFO_EX(arginfo_ignore_user_abort, 0, 0, 0)
768 ZEND_ARG_INFO(0, value)
769 ZEND_END_ARG_INFO()
770
771 #if HAVE_GETSERVBYNAME
772 ZEND_BEGIN_ARG_INFO(arginfo_getservbyname, 0)
773 ZEND_ARG_INFO(0, service)
774 ZEND_ARG_INFO(0, protocol)
775 ZEND_END_ARG_INFO()
776 #endif
777
778 #if HAVE_GETSERVBYPORT
779 ZEND_BEGIN_ARG_INFO(arginfo_getservbyport, 0)
780 ZEND_ARG_INFO(0, port)
781 ZEND_ARG_INFO(0, protocol)
782 ZEND_END_ARG_INFO()
783 #endif
784
785 #if HAVE_GETPROTOBYNAME
786 ZEND_BEGIN_ARG_INFO(arginfo_getprotobyname, 0)
787 ZEND_ARG_INFO(0, name)
788 ZEND_END_ARG_INFO()
789 #endif
790
791 #if HAVE_GETPROTOBYNUMBER
792 ZEND_BEGIN_ARG_INFO(arginfo_getprotobynumber, 0)
793 ZEND_ARG_INFO(0, proto)
794 ZEND_END_ARG_INFO()
795 #endif
796
797 ZEND_BEGIN_ARG_INFO_EX(arginfo_register_tick_function, 0, 0, 1)
798 ZEND_ARG_INFO(0, function_name)
799 ZEND_ARG_VARIADIC_INFO(0, parameters)
800 ZEND_END_ARG_INFO()
801
802 ZEND_BEGIN_ARG_INFO(arginfo_unregister_tick_function, 0)
803 ZEND_ARG_INFO(0, function_name)
804 ZEND_END_ARG_INFO()
805
806 ZEND_BEGIN_ARG_INFO(arginfo_is_uploaded_file, 0)
807 ZEND_ARG_INFO(0, path)
808 ZEND_END_ARG_INFO()
809
810 ZEND_BEGIN_ARG_INFO(arginfo_move_uploaded_file, 0)
811 ZEND_ARG_INFO(0, path)
812 ZEND_ARG_INFO(0, new_path)
813 ZEND_END_ARG_INFO()
814
815 ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_file, 0, 0, 1)
816 ZEND_ARG_INFO(0, filename)
817 ZEND_ARG_INFO(0, process_sections)
818 ZEND_ARG_INFO(0, scanner_mode)
819 ZEND_END_ARG_INFO()
820
821 ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_string, 0, 0, 1)
822 ZEND_ARG_INFO(0, ini_string)
823 ZEND_ARG_INFO(0, process_sections)
824 ZEND_ARG_INFO(0, scanner_mode)
825 ZEND_END_ARG_INFO()
826
827 #if ZEND_DEBUG
828 ZEND_BEGIN_ARG_INFO(arginfo_config_get_hash, 0)
829 ZEND_END_ARG_INFO()
830 #endif
831
832 #ifdef HAVE_GETLOADAVG
833 ZEND_BEGIN_ARG_INFO(arginfo_sys_getloadavg, 0)
834 ZEND_END_ARG_INFO()
835 #endif
836 /* }}} */
837 /* {{{ assert.c */
838 ZEND_BEGIN_ARG_INFO_EX(arginfo_assert, 0, 0, 1)
839 ZEND_ARG_INFO(0, assertion)
840 ZEND_ARG_INFO(0, description)
841 ZEND_END_ARG_INFO()
842
843 ZEND_BEGIN_ARG_INFO_EX(arginfo_assert_options, 0, 0, 1)
844 ZEND_ARG_INFO(0, what)
845 ZEND_ARG_INFO(0, value)
846 ZEND_END_ARG_INFO()
847 /* }}} */
848 /* {{{ base64.c */
849 ZEND_BEGIN_ARG_INFO(arginfo_base64_encode, 0)
850 ZEND_ARG_INFO(0, str)
851 ZEND_END_ARG_INFO()
852
853 ZEND_BEGIN_ARG_INFO_EX(arginfo_base64_decode, 0, 0, 1)
854 ZEND_ARG_INFO(0, str)
855 ZEND_ARG_INFO(0, strict)
856 ZEND_END_ARG_INFO()
857
858 /* }}} */
859 /* {{{ browscap.c */
860 ZEND_BEGIN_ARG_INFO_EX(arginfo_get_browser, 0, 0, 0)
861 ZEND_ARG_INFO(0, browser_name)
862 ZEND_ARG_INFO(0, return_array)
863 ZEND_END_ARG_INFO()
864 /* }}} */
865 /* {{{ crc32.c */
866 ZEND_BEGIN_ARG_INFO(arginfo_crc32, 0)
867 ZEND_ARG_INFO(0, str)
868 ZEND_END_ARG_INFO()
869
870 /* }}} */
871 /* {{{ crypt.c */
872 ZEND_BEGIN_ARG_INFO_EX(arginfo_crypt, 0, 0, 1)
873 ZEND_ARG_INFO(0, str)
874 ZEND_ARG_INFO(0, salt)
875 ZEND_END_ARG_INFO()
876 /* }}} */
877 /* {{{ cyr_convert.c */
878 ZEND_BEGIN_ARG_INFO(arginfo_convert_cyr_string, 0)
879 ZEND_ARG_INFO(0, str)
880 ZEND_ARG_INFO(0, from)
881 ZEND_ARG_INFO(0, to)
882 ZEND_END_ARG_INFO()
883
884 /* }}} */
885 /* {{{ datetime.c */
886 #if HAVE_STRPTIME
887 ZEND_BEGIN_ARG_INFO(arginfo_strptime, 0)
888 ZEND_ARG_INFO(0, timestamp)
889 ZEND_ARG_INFO(0, format)
890 ZEND_END_ARG_INFO()
891 #endif
892 /* }}} */
893 /* {{{ dir.c */
894 ZEND_BEGIN_ARG_INFO_EX(arginfo_opendir, 0, 0, 1)
895 ZEND_ARG_INFO(0, path)
896 ZEND_ARG_INFO(0, context)
897 ZEND_END_ARG_INFO()
898
899 ZEND_BEGIN_ARG_INFO_EX(arginfo_dir, 0, 0, 1)
900 ZEND_ARG_INFO(0, directory)
901 ZEND_ARG_INFO(0, context)
902 ZEND_END_ARG_INFO()
903
904 ZEND_BEGIN_ARG_INFO_EX(arginfo_closedir, 0, 0, 0)
905 ZEND_ARG_INFO(0, dir_handle)
906 ZEND_END_ARG_INFO()
907
908 #if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
909 ZEND_BEGIN_ARG_INFO(arginfo_chroot, 0)
910 ZEND_ARG_INFO(0, directory)
911 ZEND_END_ARG_INFO()
912 #endif
913
914 ZEND_BEGIN_ARG_INFO(arginfo_chdir, 0)
915 ZEND_ARG_INFO(0, directory)
916 ZEND_END_ARG_INFO()
917
918 ZEND_BEGIN_ARG_INFO(arginfo_getcwd, 0)
919 ZEND_END_ARG_INFO()
920
921 ZEND_BEGIN_ARG_INFO_EX(arginfo_rewinddir, 0, 0, 0)
922 ZEND_ARG_INFO(0, dir_handle)
923 ZEND_END_ARG_INFO()
924
925 ZEND_BEGIN_ARG_INFO_EX(arginfo_readdir, 0, 0, 0)
926 ZEND_ARG_INFO(0, dir_handle)
927 ZEND_END_ARG_INFO()
928
929 #ifdef HAVE_GLOB
930 ZEND_BEGIN_ARG_INFO_EX(arginfo_glob, 0, 0, 1)
931 ZEND_ARG_INFO(0, pattern)
932 ZEND_ARG_INFO(0, flags)
933 ZEND_END_ARG_INFO()
934 #endif
935
936 ZEND_BEGIN_ARG_INFO_EX(arginfo_scandir, 0, 0, 1)
937 ZEND_ARG_INFO(0, dir)
938 ZEND_ARG_INFO(0, sorting_order)
939 ZEND_ARG_INFO(0, context)
940 ZEND_END_ARG_INFO()
941 /* }}} */
942 /* {{{ dns.c */
943 ZEND_BEGIN_ARG_INFO(arginfo_gethostbyaddr, 0)
944 ZEND_ARG_INFO(0, ip_address)
945 ZEND_END_ARG_INFO()
946
947 ZEND_BEGIN_ARG_INFO(arginfo_gethostbyname, 0)
948 ZEND_ARG_INFO(0, hostname)
949 ZEND_END_ARG_INFO()
950
951 ZEND_BEGIN_ARG_INFO(arginfo_gethostbynamel, 0)
952 ZEND_ARG_INFO(0, hostname)
953 ZEND_END_ARG_INFO()
954
955 #ifdef HAVE_GETHOSTNAME
956 ZEND_BEGIN_ARG_INFO(arginfo_gethostname, 0)
957 ZEND_END_ARG_INFO()
958 #endif
959
960 ZEND_BEGIN_ARG_INFO(arginfo_net_get_interfaces, 0)
961 ZEND_END_ARG_INFO()
962
963 #if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
964 ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1)
965 ZEND_ARG_INFO(0, host)
966 ZEND_ARG_INFO(0, type)
967 ZEND_END_ARG_INFO()
968
969 # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
970 ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_record, 0, 0, 1)
971 ZEND_ARG_INFO(0, hostname)
972 ZEND_ARG_INFO(0, type)
973 ZEND_ARG_ARRAY_INFO(1, authns, 1)
974 ZEND_ARG_ARRAY_INFO(1, addtl, 1)
975 ZEND_ARG_INFO(0, raw)
976 ZEND_END_ARG_INFO()
977
978 ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2)
979 ZEND_ARG_INFO(0, hostname)
980 ZEND_ARG_INFO(1, mxhosts) /* ARRAY_INFO(1, mxhosts, 1) */
981 ZEND_ARG_INFO(1, weight) /* ARRAY_INFO(1, weight, 1) */
982 ZEND_END_ARG_INFO()
983 # endif
984
985 #endif /* defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC */
986 /* }}} */
987
988 /* {{{ exec.c */
989 ZEND_BEGIN_ARG_INFO_EX(arginfo_exec, 0, 0, 1)
990 ZEND_ARG_INFO(0, command)
991 ZEND_ARG_INFO(1, output) /* ARRAY_INFO(1, output, 1) */
992 ZEND_ARG_INFO(1, return_value)
993 ZEND_END_ARG_INFO()
994
995 ZEND_BEGIN_ARG_INFO_EX(arginfo_system, 0, 0, 1)
996 ZEND_ARG_INFO(0, command)
997 ZEND_ARG_INFO(1, return_value)
998 ZEND_END_ARG_INFO()
999
1000 ZEND_BEGIN_ARG_INFO_EX(arginfo_passthru, 0, 0, 1)
1001 ZEND_ARG_INFO(0, command)
1002 ZEND_ARG_INFO(1, return_value)
1003 ZEND_END_ARG_INFO()
1004
1005 ZEND_BEGIN_ARG_INFO(arginfo_escapeshellcmd, 0)
1006 ZEND_ARG_INFO(0, command)
1007 ZEND_END_ARG_INFO()
1008
1009 ZEND_BEGIN_ARG_INFO(arginfo_escapeshellarg, 0)
1010 ZEND_ARG_INFO(0, arg)
1011 ZEND_END_ARG_INFO()
1012
1013 ZEND_BEGIN_ARG_INFO(arginfo_shell_exec, 0)
1014 ZEND_ARG_INFO(0, cmd)
1015 ZEND_END_ARG_INFO()
1016
1017 #ifdef HAVE_NICE
1018 ZEND_BEGIN_ARG_INFO(arginfo_proc_nice, 0)
1019 ZEND_ARG_INFO(0, priority)
1020 ZEND_END_ARG_INFO()
1021 #endif
1022 /* }}} */
1023 /* {{{ file.c */
1024 ZEND_BEGIN_ARG_INFO_EX(arginfo_flock, 0, 0, 2)
1025 ZEND_ARG_INFO(0, fp)
1026 ZEND_ARG_INFO(0, operation)
1027 ZEND_ARG_INFO(1, wouldblock)
1028 ZEND_END_ARG_INFO()
1029
1030 ZEND_BEGIN_ARG_INFO_EX(arginfo_get_meta_tags, 0, 0, 1)
1031 ZEND_ARG_INFO(0, filename)
1032 ZEND_ARG_INFO(0, use_include_path)
1033 ZEND_END_ARG_INFO()
1034
1035 ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1)
1036 ZEND_ARG_INFO(0, filename)
1037 ZEND_ARG_INFO(0, flags)
1038 ZEND_ARG_INFO(0, context)
1039 ZEND_ARG_INFO(0, offset)
1040 ZEND_ARG_INFO(0, maxlen)
1041 ZEND_END_ARG_INFO()
1042
1043 ZEND_BEGIN_ARG_INFO_EX(arginfo_file_put_contents, 0, 0, 2)
1044 ZEND_ARG_INFO(0, filename)
1045 ZEND_ARG_INFO(0, data)
1046 ZEND_ARG_INFO(0, flags)
1047 ZEND_ARG_INFO(0, context)
1048 ZEND_END_ARG_INFO()
1049
1050 ZEND_BEGIN_ARG_INFO_EX(arginfo_file, 0, 0, 1)
1051 ZEND_ARG_INFO(0, filename)
1052 ZEND_ARG_INFO(0, flags)
1053 ZEND_ARG_INFO(0, context)
1054 ZEND_END_ARG_INFO()
1055
1056 ZEND_BEGIN_ARG_INFO(arginfo_tempnam, 0)
1057 ZEND_ARG_INFO(0, dir)
1058 ZEND_ARG_INFO(0, prefix)
1059 ZEND_END_ARG_INFO()
1060
1061 ZEND_BEGIN_ARG_INFO(arginfo_tmpfile, 0)
1062 ZEND_END_ARG_INFO()
1063
1064 ZEND_BEGIN_ARG_INFO_EX(arginfo_fopen, 0, 0, 2)
1065 ZEND_ARG_INFO(0, filename)
1066 ZEND_ARG_INFO(0, mode)
1067 ZEND_ARG_INFO(0, use_include_path)
1068 ZEND_ARG_INFO(0, context)
1069 ZEND_END_ARG_INFO()
1070
1071 ZEND_BEGIN_ARG_INFO(arginfo_fclose, 0)
1072 ZEND_ARG_INFO(0, fp)
1073 ZEND_END_ARG_INFO()
1074
1075 ZEND_BEGIN_ARG_INFO(arginfo_popen, 0)
1076 ZEND_ARG_INFO(0, command)
1077 ZEND_ARG_INFO(0, mode)
1078 ZEND_END_ARG_INFO()
1079
1080 ZEND_BEGIN_ARG_INFO(arginfo_pclose, 0)
1081 ZEND_ARG_INFO(0, fp)
1082 ZEND_END_ARG_INFO()
1083
1084 ZEND_BEGIN_ARG_INFO(arginfo_feof, 0)
1085 ZEND_ARG_INFO(0, fp)
1086 ZEND_END_ARG_INFO()
1087
1088 ZEND_BEGIN_ARG_INFO_EX(arginfo_fgets, 0, 0, 1)
1089 ZEND_ARG_INFO(0, fp)
1090 ZEND_ARG_INFO(0, length)
1091 ZEND_END_ARG_INFO()
1092
1093 ZEND_BEGIN_ARG_INFO(arginfo_fgetc, 0)
1094 ZEND_ARG_INFO(0, fp)
1095 ZEND_END_ARG_INFO()
1096
1097 ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetss, 0, 0, 1)
1098 ZEND_ARG_INFO(0, fp)
1099 ZEND_ARG_INFO(0, length)
1100 ZEND_ARG_INFO(0, allowable_tags)
1101 ZEND_END_ARG_INFO()
1102
1103 ZEND_BEGIN_ARG_INFO_EX(arginfo_fscanf, 0, 0, 2)
1104 ZEND_ARG_INFO(0, stream)
1105 ZEND_ARG_INFO(0, format)
1106 ZEND_ARG_VARIADIC_INFO(1, vars)
1107 ZEND_END_ARG_INFO()
1108
1109 ZEND_BEGIN_ARG_INFO_EX(arginfo_fwrite, 0, 0, 2)
1110 ZEND_ARG_INFO(0, fp)
1111 ZEND_ARG_INFO(0, str)
1112 ZEND_ARG_INFO(0, length)
1113 ZEND_END_ARG_INFO()
1114
1115 ZEND_BEGIN_ARG_INFO(arginfo_fflush, 0)
1116 ZEND_ARG_INFO(0, fp)
1117 ZEND_END_ARG_INFO()
1118
1119 ZEND_BEGIN_ARG_INFO(arginfo_rewind, 0)
1120 ZEND_ARG_INFO(0, fp)
1121 ZEND_END_ARG_INFO()
1122
1123 ZEND_BEGIN_ARG_INFO(arginfo_ftell, 0)
1124 ZEND_ARG_INFO(0, fp)
1125 ZEND_END_ARG_INFO()
1126
1127 ZEND_BEGIN_ARG_INFO_EX(arginfo_fseek, 0, 0, 2)
1128 ZEND_ARG_INFO(0, fp)
1129 ZEND_ARG_INFO(0, offset)
1130 ZEND_ARG_INFO(0, whence)
1131 ZEND_END_ARG_INFO()
1132
1133 ZEND_BEGIN_ARG_INFO_EX(arginfo_mkdir, 0, 0, 1)
1134 ZEND_ARG_INFO(0, pathname)
1135 ZEND_ARG_INFO(0, mode)
1136 ZEND_ARG_INFO(0, recursive)
1137 ZEND_ARG_INFO(0, context)
1138 ZEND_END_ARG_INFO()
1139
1140 ZEND_BEGIN_ARG_INFO_EX(arginfo_rmdir, 0, 0, 1)
1141 ZEND_ARG_INFO(0, dirname)
1142 ZEND_ARG_INFO(0, context)
1143 ZEND_END_ARG_INFO()
1144
1145 ZEND_BEGIN_ARG_INFO_EX(arginfo_readfile, 0, 0, 1)
1146 ZEND_ARG_INFO(0, filename)
1147 ZEND_ARG_INFO(0, flags)
1148 ZEND_ARG_INFO(0, context)
1149 ZEND_END_ARG_INFO()
1150
1151 ZEND_BEGIN_ARG_INFO_EX(arginfo_umask, 0, 0, 0)
1152 ZEND_ARG_INFO(0, mask)
1153 ZEND_END_ARG_INFO()
1154
1155 ZEND_BEGIN_ARG_INFO(arginfo_fpassthru, 0)
1156 ZEND_ARG_INFO(0, fp)
1157 ZEND_END_ARG_INFO()
1158
1159 ZEND_BEGIN_ARG_INFO_EX(arginfo_rename, 0, 0, 2)
1160 ZEND_ARG_INFO(0, old_name)
1161 ZEND_ARG_INFO(0, new_name)
1162 ZEND_ARG_INFO(0, context)
1163 ZEND_END_ARG_INFO()
1164
1165 ZEND_BEGIN_ARG_INFO_EX(arginfo_unlink, 0, 0, 1)
1166 ZEND_ARG_INFO(0, filename)
1167 ZEND_ARG_INFO(0, context)
1168 ZEND_END_ARG_INFO()
1169
1170 ZEND_BEGIN_ARG_INFO(arginfo_ftruncate, 0)
1171 ZEND_ARG_INFO(0, fp)
1172 ZEND_ARG_INFO(0, size)
1173 ZEND_END_ARG_INFO()
1174
1175 ZEND_BEGIN_ARG_INFO(arginfo_fstat, 0)
1176 ZEND_ARG_INFO(0, fp)
1177 ZEND_END_ARG_INFO()
1178 ZEND_BEGIN_ARG_INFO_EX(arginfo_copy, 0, 0, 2)
1179 ZEND_ARG_INFO(0, source_file)
1180 ZEND_ARG_INFO(0, destination_file)
1181 ZEND_ARG_INFO(0, context)
1182 ZEND_END_ARG_INFO()
1183
1184 ZEND_BEGIN_ARG_INFO(arginfo_fread, 0)
1185 ZEND_ARG_INFO(0, fp)
1186 ZEND_ARG_INFO(0, length)
1187 ZEND_END_ARG_INFO()
1188
1189 ZEND_BEGIN_ARG_INFO_EX(arginfo_fputcsv, 0, 0, 2)
1190 ZEND_ARG_INFO(0, fp)
1191 ZEND_ARG_INFO(0, fields) /* ARRAY_INFO(0, fields, 1) */
1192 ZEND_ARG_INFO(0, delimiter)
1193 ZEND_ARG_INFO(0, enclosure)
1194 ZEND_ARG_INFO(0, escape_char)
1195 ZEND_END_ARG_INFO()
1196
1197 ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetcsv, 0, 0, 1)
1198 ZEND_ARG_INFO(0, fp)
1199 ZEND_ARG_INFO(0, length)
1200 ZEND_ARG_INFO(0, delimiter)
1201 ZEND_ARG_INFO(0, enclosure)
1202 ZEND_ARG_INFO(0, escape)
1203 ZEND_END_ARG_INFO()
1204
1205 #if HAVE_REALPATH || defined(ZTS)
1206 ZEND_BEGIN_ARG_INFO(arginfo_realpath, 0)
1207 ZEND_ARG_INFO(0, path)
1208 ZEND_END_ARG_INFO()
1209 #endif
1210
1211 #ifdef HAVE_FNMATCH
1212 ZEND_BEGIN_ARG_INFO_EX(arginfo_fnmatch, 0, 0, 2)
1213 ZEND_ARG_INFO(0, pattern)
1214 ZEND_ARG_INFO(0, filename)
1215 ZEND_ARG_INFO(0, flags)
1216 ZEND_END_ARG_INFO()
1217 #endif
1218
1219 ZEND_BEGIN_ARG_INFO(arginfo_sys_get_temp_dir, 0)
1220 ZEND_END_ARG_INFO()
1221 /* }}} */
1222 /* {{{ filestat.c */
1223 ZEND_BEGIN_ARG_INFO(arginfo_disk_total_space, 0)
1224 ZEND_ARG_INFO(0, path)
1225 ZEND_END_ARG_INFO()
1226
1227 ZEND_BEGIN_ARG_INFO(arginfo_disk_free_space, 0)
1228 ZEND_ARG_INFO(0, path)
1229 ZEND_END_ARG_INFO()
1230
1231 ZEND_BEGIN_ARG_INFO(arginfo_chgrp, 0)
1232 ZEND_ARG_INFO(0, filename)
1233 ZEND_ARG_INFO(0, group)
1234 ZEND_END_ARG_INFO()
1235
1236 ZEND_BEGIN_ARG_INFO(arginfo_chown, 0)
1237 ZEND_ARG_INFO(0, filename)
1238 ZEND_ARG_INFO(0, user)
1239 ZEND_END_ARG_INFO()
1240
1241 #if HAVE_LCHOWN
1242 ZEND_BEGIN_ARG_INFO(arginfo_lchgrp, 0)
1243 ZEND_ARG_INFO(0, filename)
1244 ZEND_ARG_INFO(0, group)
1245 ZEND_END_ARG_INFO()
1246
1247 ZEND_BEGIN_ARG_INFO(arginfo_lchown, 0)
1248 ZEND_ARG_INFO(0, filename)
1249 ZEND_ARG_INFO(0, user)
1250 ZEND_END_ARG_INFO()
1251 #endif
1252
1253 ZEND_BEGIN_ARG_INFO(arginfo_chmod, 0)
1254 ZEND_ARG_INFO(0, filename)
1255 ZEND_ARG_INFO(0, mode)
1256 ZEND_END_ARG_INFO()
1257
1258 #if HAVE_UTIME
1259 ZEND_BEGIN_ARG_INFO_EX(arginfo_touch, 0, 0, 1)
1260 ZEND_ARG_INFO(0, filename)
1261 ZEND_ARG_INFO(0, time)
1262 ZEND_ARG_INFO(0, atime)
1263 ZEND_END_ARG_INFO()
1264 #endif
1265
1266 ZEND_BEGIN_ARG_INFO_EX(arginfo_clearstatcache, 0, 0, 0)
1267 ZEND_ARG_INFO(0, clear_realpath_cache)
1268 ZEND_ARG_INFO(0, filename)
1269 ZEND_END_ARG_INFO()
1270
1271 ZEND_BEGIN_ARG_INFO(arginfo_realpath_cache_size, 0)
1272 ZEND_END_ARG_INFO()
1273
1274 ZEND_BEGIN_ARG_INFO(arginfo_realpath_cache_get, 0)
1275 ZEND_END_ARG_INFO()
1276
1277 ZEND_BEGIN_ARG_INFO(arginfo_fileperms, 0)
1278 ZEND_ARG_INFO(0, filename)
1279 ZEND_END_ARG_INFO()
1280
1281 ZEND_BEGIN_ARG_INFO(arginfo_fileinode, 0)
1282 ZEND_ARG_INFO(0, filename)
1283 ZEND_END_ARG_INFO()
1284
1285 ZEND_BEGIN_ARG_INFO(arginfo_filesize, 0)
1286 ZEND_ARG_INFO(0, filename)
1287 ZEND_END_ARG_INFO()
1288
1289 ZEND_BEGIN_ARG_INFO(arginfo_fileowner, 0)
1290 ZEND_ARG_INFO(0, filename)
1291 ZEND_END_ARG_INFO()
1292
1293 ZEND_BEGIN_ARG_INFO(arginfo_filegroup, 0)
1294 ZEND_ARG_INFO(0, filename)
1295 ZEND_END_ARG_INFO()
1296
1297 ZEND_BEGIN_ARG_INFO(arginfo_fileatime, 0)
1298 ZEND_ARG_INFO(0, filename)
1299 ZEND_END_ARG_INFO()
1300
1301 ZEND_BEGIN_ARG_INFO(arginfo_filemtime, 0)
1302 ZEND_ARG_INFO(0, filename)
1303 ZEND_END_ARG_INFO()
1304
1305 ZEND_BEGIN_ARG_INFO(arginfo_filectime, 0)
1306 ZEND_ARG_INFO(0, filename)
1307 ZEND_END_ARG_INFO()
1308
1309 ZEND_BEGIN_ARG_INFO(arginfo_filetype, 0)
1310 ZEND_ARG_INFO(0, filename)
1311 ZEND_END_ARG_INFO()
1312
1313 ZEND_BEGIN_ARG_INFO(arginfo_is_writable, 0)
1314 ZEND_ARG_INFO(0, filename)
1315 ZEND_END_ARG_INFO()
1316
1317 ZEND_BEGIN_ARG_INFO(arginfo_is_readable, 0)
1318 ZEND_ARG_INFO(0, filename)
1319 ZEND_END_ARG_INFO()
1320
1321 ZEND_BEGIN_ARG_INFO(arginfo_is_executable, 0)
1322 ZEND_ARG_INFO(0, filename)
1323 ZEND_END_ARG_INFO()
1324
1325 ZEND_BEGIN_ARG_INFO(arginfo_is_file, 0)
1326 ZEND_ARG_INFO(0, filename)
1327 ZEND_END_ARG_INFO()
1328
1329 ZEND_BEGIN_ARG_INFO(arginfo_is_dir, 0)
1330 ZEND_ARG_INFO(0, filename)
1331 ZEND_END_ARG_INFO()
1332
1333 ZEND_BEGIN_ARG_INFO(arginfo_is_link, 0)
1334 ZEND_ARG_INFO(0, filename)
1335 ZEND_END_ARG_INFO()
1336
1337 ZEND_BEGIN_ARG_INFO(arginfo_file_exists, 0)
1338 ZEND_ARG_INFO(0, filename)
1339 ZEND_END_ARG_INFO()
1340
1341 ZEND_BEGIN_ARG_INFO(arginfo_lstat, 0)
1342 ZEND_ARG_INFO(0, filename)
1343 ZEND_END_ARG_INFO()
1344
1345 ZEND_BEGIN_ARG_INFO(arginfo_stat, 0)
1346 ZEND_ARG_INFO(0, filename)
1347 ZEND_END_ARG_INFO()
1348 /* }}} */
1349 /* {{{ formatted_print.c */
1350 ZEND_BEGIN_ARG_INFO_EX(arginfo_sprintf, 0, 0, 1)
1351 ZEND_ARG_INFO(0, format)
1352 ZEND_ARG_VARIADIC_INFO(0, args)
1353 ZEND_END_ARG_INFO()
1354
1355 ZEND_BEGIN_ARG_INFO(arginfo_vsprintf, 0)
1356 ZEND_ARG_INFO(0, format)
1357 ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
1358 ZEND_END_ARG_INFO()
1359
1360 ZEND_BEGIN_ARG_INFO_EX(arginfo_printf, 0, 0, 1)
1361 ZEND_ARG_INFO(0, format)
1362 ZEND_ARG_VARIADIC_INFO(0, args)
1363 ZEND_END_ARG_INFO()
1364
1365 ZEND_BEGIN_ARG_INFO(arginfo_vprintf, 0)
1366 ZEND_ARG_INFO(0, format)
1367 ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
1368 ZEND_END_ARG_INFO()
1369
1370 ZEND_BEGIN_ARG_INFO_EX(arginfo_fprintf, 0, 0, 2)
1371 ZEND_ARG_INFO(0, stream)
1372 ZEND_ARG_INFO(0, format)
1373 ZEND_ARG_VARIADIC_INFO(0, args)
1374 ZEND_END_ARG_INFO()
1375
1376 ZEND_BEGIN_ARG_INFO(arginfo_vfprintf, 0)
1377 ZEND_ARG_INFO(0, stream)
1378 ZEND_ARG_INFO(0, format)
1379 ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
1380 ZEND_END_ARG_INFO()
1381 /* }}} */
1382 /* {{{ fsock.c */
1383 ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 1)
1384 ZEND_ARG_INFO(0, hostname)
1385 ZEND_ARG_INFO(0, port)
1386 ZEND_ARG_INFO(1, errno)
1387 ZEND_ARG_INFO(1, errstr)
1388 ZEND_ARG_INFO(0, timeout)
1389 ZEND_END_ARG_INFO()
1390
1391 ZEND_BEGIN_ARG_INFO_EX(arginfo_pfsockopen, 0, 0, 1)
1392 ZEND_ARG_INFO(0, hostname)
1393 ZEND_ARG_INFO(0, port)
1394 ZEND_ARG_INFO(1, errno)
1395 ZEND_ARG_INFO(1, errstr)
1396 ZEND_ARG_INFO(0, timeout)
1397 ZEND_END_ARG_INFO()
1398 /* }}} */
1399 /* {{{ ftok.c */
1400 #if HAVE_FTOK
1401 ZEND_BEGIN_ARG_INFO(arginfo_ftok, 0)
1402 ZEND_ARG_INFO(0, pathname)
1403 ZEND_ARG_INFO(0, proj)
1404 ZEND_END_ARG_INFO()
1405 #endif
1406 /* }}} */
1407 /* {{{ head.c */
1408 ZEND_BEGIN_ARG_INFO_EX(arginfo_header, 0, 0, 1)
1409 ZEND_ARG_INFO(0, header)
1410 ZEND_ARG_INFO(0, replace)
1411 ZEND_ARG_INFO(0, http_response_code)
1412 ZEND_END_ARG_INFO()
1413
1414 ZEND_BEGIN_ARG_INFO_EX(arginfo_header_remove, 0, 0, 0)
1415 ZEND_ARG_INFO(0, name)
1416 ZEND_END_ARG_INFO()
1417
1418 ZEND_BEGIN_ARG_INFO_EX(arginfo_setcookie, 0, 0, 1)
1419 ZEND_ARG_INFO(0, name)
1420 ZEND_ARG_INFO(0, value)
1421 ZEND_ARG_INFO(0, expires_or_options)
1422 ZEND_ARG_INFO(0, path)
1423 ZEND_ARG_INFO(0, domain)
1424 ZEND_ARG_INFO(0, secure)
1425 ZEND_ARG_INFO(0, httponly)
1426 ZEND_END_ARG_INFO()
1427
1428 ZEND_BEGIN_ARG_INFO_EX(arginfo_setrawcookie, 0, 0, 1)
1429 ZEND_ARG_INFO(0, name)
1430 ZEND_ARG_INFO(0, value)
1431 ZEND_ARG_INFO(0, expires_or_options)
1432 ZEND_ARG_INFO(0, path)
1433 ZEND_ARG_INFO(0, domain)
1434 ZEND_ARG_INFO(0, secure)
1435 ZEND_ARG_INFO(0, httponly)
1436 ZEND_END_ARG_INFO()
1437
1438 ZEND_BEGIN_ARG_INFO_EX(arginfo_headers_sent, 0, 0, 0)
1439 ZEND_ARG_INFO(1, file)
1440 ZEND_ARG_INFO(1, line)
1441 ZEND_END_ARG_INFO()
1442
1443 ZEND_BEGIN_ARG_INFO(arginfo_headers_list, 0)
1444 ZEND_END_ARG_INFO()
1445
1446 ZEND_BEGIN_ARG_INFO_EX(arginfo_http_response_code, 0, 0, 0)
1447 ZEND_ARG_INFO(0, response_code)
1448 ZEND_END_ARG_INFO()
1449 /* }}} */
1450 /* {{{ hrtime.c */
1451 ZEND_BEGIN_ARG_INFO(arginfo_hrtime, 0)
1452 ZEND_ARG_INFO(0, get_as_number)
1453 ZEND_END_ARG_INFO()
1454 /* }}} */
1455 /* {{{ html.c */
1456 ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars, 0, 0, 1)
1457 ZEND_ARG_INFO(0, string)
1458 ZEND_ARG_INFO(0, quote_style)
1459 ZEND_ARG_INFO(0, encoding)
1460 ZEND_ARG_INFO(0, double_encode)
1461 ZEND_END_ARG_INFO()
1462
1463 ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars_decode, 0, 0, 1)
1464 ZEND_ARG_INFO(0, string)
1465 ZEND_ARG_INFO(0, quote_style)
1466 ZEND_END_ARG_INFO()
1467
1468 ZEND_BEGIN_ARG_INFO_EX(arginfo_html_entity_decode, 0, 0, 1)
1469 ZEND_ARG_INFO(0, string)
1470 ZEND_ARG_INFO(0, quote_style)
1471 ZEND_ARG_INFO(0, encoding)
1472 ZEND_END_ARG_INFO()
1473
1474 ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlentities, 0, 0, 1)
1475 ZEND_ARG_INFO(0, string)
1476 ZEND_ARG_INFO(0, quote_style)
1477 ZEND_ARG_INFO(0, encoding)
1478 ZEND_ARG_INFO(0, double_encode)
1479 ZEND_END_ARG_INFO()
1480
1481 ZEND_BEGIN_ARG_INFO_EX(arginfo_get_html_translation_table, 0, 0, 0)
1482 ZEND_ARG_INFO(0, table)
1483 ZEND_ARG_INFO(0, quote_style)
1484 ZEND_ARG_INFO(0, encoding)
1485 ZEND_END_ARG_INFO()
1486
1487 /* }}} */
1488 /* {{{ http.c */
1489 ZEND_BEGIN_ARG_INFO_EX(arginfo_http_build_query, 0, 0, 1)
1490 ZEND_ARG_INFO(0, formdata)
1491 ZEND_ARG_INFO(0, prefix)
1492 ZEND_ARG_INFO(0, arg_separator)
1493 ZEND_ARG_INFO(0, enc_type)
1494 ZEND_END_ARG_INFO()
1495 /* }}} */
1496 /* {{{ image.c */
1497 ZEND_BEGIN_ARG_INFO(arginfo_image_type_to_mime_type, 0)
1498 ZEND_ARG_INFO(0, imagetype)
1499 ZEND_END_ARG_INFO()
1500
1501 ZEND_BEGIN_ARG_INFO_EX(arginfo_image_type_to_extension, 0, 0, 1)
1502 ZEND_ARG_INFO(0, imagetype)
1503 ZEND_ARG_INFO(0, include_dot)
1504 ZEND_END_ARG_INFO()
1505
1506 ZEND_BEGIN_ARG_INFO_EX(arginfo_getimagesize, 0, 0, 1)
1507 ZEND_ARG_INFO(0, imagefile)
1508 ZEND_ARG_INFO(1, info) /* ARRAY_INFO(1, info, 1) */
1509 ZEND_END_ARG_INFO()
1510 /* }}} */
1511 /* {{{ info.c */
1512 ZEND_BEGIN_ARG_INFO_EX(arginfo_phpinfo, 0, 0, 0)
1513 ZEND_ARG_INFO(0, what)
1514 ZEND_END_ARG_INFO()
1515
1516 ZEND_BEGIN_ARG_INFO_EX(arginfo_phpversion, 0, 0, 0)
1517 ZEND_ARG_INFO(0, extension)
1518 ZEND_END_ARG_INFO()
1519
1520 ZEND_BEGIN_ARG_INFO_EX(arginfo_phpcredits, 0, 0, 0)
1521 ZEND_ARG_INFO(0, flag)
1522 ZEND_END_ARG_INFO()
1523
1524 ZEND_BEGIN_ARG_INFO(arginfo_php_sapi_name, 0)
1525 ZEND_END_ARG_INFO()
1526
1527 ZEND_BEGIN_ARG_INFO_EX(arginfo_php_uname, 0, 0, 0)
1528 ZEND_ARG_INFO(0, mode)
1529 ZEND_END_ARG_INFO()
1530
1531 ZEND_BEGIN_ARG_INFO(arginfo_php_ini_scanned_files, 0)
1532 ZEND_END_ARG_INFO()
1533
1534 ZEND_BEGIN_ARG_INFO(arginfo_php_ini_loaded_file, 0)
1535 ZEND_END_ARG_INFO()
1536 /* }}} */
1537 /* {{{ iptc.c */
1538 ZEND_BEGIN_ARG_INFO_EX(arginfo_iptcembed, 0, 0, 2)
1539 ZEND_ARG_INFO(0, iptcdata)
1540 ZEND_ARG_INFO(0, jpeg_file_name)
1541 ZEND_ARG_INFO(0, spool)
1542 ZEND_END_ARG_INFO()
1543
1544 ZEND_BEGIN_ARG_INFO(arginfo_iptcparse, 0)
1545 ZEND_ARG_INFO(0, iptcdata)
1546 ZEND_END_ARG_INFO()
1547 /* }}} */
1548
1549 /* {{{ lcg.c */
1550 ZEND_BEGIN_ARG_INFO(arginfo_lcg_value, 0)
1551 ZEND_END_ARG_INFO()
1552 /* }}} */
1553
1554 /* {{{ levenshtein.c */
1555 ZEND_BEGIN_ARG_INFO_EX(arginfo_levenshtein, 0, 0, 2)
1556 ZEND_ARG_INFO(0, str1)
1557 ZEND_ARG_INFO(0, str2)
1558 ZEND_ARG_INFO(0, cost_ins)
1559 ZEND_ARG_INFO(0, cost_rep)
1560 ZEND_ARG_INFO(0, cost_del)
1561 ZEND_END_ARG_INFO()
1562 /* }}} */
1563 /* {{{ link.c */
1564 #if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
1565 ZEND_BEGIN_ARG_INFO(arginfo_readlink, 0)
1566 ZEND_ARG_INFO(0, filename)
1567 ZEND_END_ARG_INFO()
1568
1569 ZEND_BEGIN_ARG_INFO(arginfo_linkinfo, 0)
1570 ZEND_ARG_INFO(0, filename)
1571 ZEND_END_ARG_INFO()
1572
1573 ZEND_BEGIN_ARG_INFO(arginfo_symlink, 0)
1574 ZEND_ARG_INFO(0, target)
1575 ZEND_ARG_INFO(0, link)
1576 ZEND_END_ARG_INFO()
1577
1578 ZEND_BEGIN_ARG_INFO(arginfo_link, 0)
1579 ZEND_ARG_INFO(0, target)
1580 ZEND_ARG_INFO(0, link)
1581 ZEND_END_ARG_INFO()
1582 #endif
1583 /* }}} */
1584 /* {{{ mail.c */
1585 ZEND_BEGIN_ARG_INFO(arginfo_ezmlm_hash, 0)
1586 ZEND_ARG_INFO(0, addr)
1587 ZEND_END_ARG_INFO()
1588
1589 ZEND_BEGIN_ARG_INFO_EX(arginfo_mail, 0, 0, 3)
1590 ZEND_ARG_INFO(0, to)
1591 ZEND_ARG_INFO(0, subject)
1592 ZEND_ARG_INFO(0, message)
1593 ZEND_ARG_INFO(0, additional_headers)
1594 ZEND_ARG_INFO(0, additional_parameters)
1595 ZEND_END_ARG_INFO()
1596 /* }}} */
1597 /* {{{ math.c */
1598 ZEND_BEGIN_ARG_INFO(arginfo_abs, 0)
1599 ZEND_ARG_INFO(0, number)
1600 ZEND_END_ARG_INFO()
1601
1602 ZEND_BEGIN_ARG_INFO(arginfo_ceil, 0)
1603 ZEND_ARG_INFO(0, number)
1604 ZEND_END_ARG_INFO()
1605
1606 ZEND_BEGIN_ARG_INFO(arginfo_floor, 0)
1607 ZEND_ARG_INFO(0, number)
1608 ZEND_END_ARG_INFO()
1609
1610 ZEND_BEGIN_ARG_INFO_EX(arginfo_round, 0, 0, 1)
1611 ZEND_ARG_INFO(0, number)
1612 ZEND_ARG_INFO(0, precision)
1613 ZEND_ARG_INFO(0, mode)
1614 ZEND_END_ARG_INFO()
1615
1616 ZEND_BEGIN_ARG_INFO(arginfo_sin, 0)
1617 ZEND_ARG_INFO(0, number)
1618 ZEND_END_ARG_INFO()
1619
1620 ZEND_BEGIN_ARG_INFO(arginfo_cos, 0)
1621 ZEND_ARG_INFO(0, number)
1622 ZEND_END_ARG_INFO()
1623
1624 ZEND_BEGIN_ARG_INFO(arginfo_tan, 0)
1625 ZEND_ARG_INFO(0, number)
1626 ZEND_END_ARG_INFO()
1627
1628 ZEND_BEGIN_ARG_INFO(arginfo_asin, 0)
1629 ZEND_ARG_INFO(0, number)
1630 ZEND_END_ARG_INFO()
1631
1632 ZEND_BEGIN_ARG_INFO(arginfo_acos, 0)
1633 ZEND_ARG_INFO(0, number)
1634 ZEND_END_ARG_INFO()
1635
1636 ZEND_BEGIN_ARG_INFO(arginfo_atan, 0)
1637 ZEND_ARG_INFO(0, number)
1638 ZEND_END_ARG_INFO()
1639
1640 ZEND_BEGIN_ARG_INFO(arginfo_atan2, 0)
1641 ZEND_ARG_INFO(0, y)
1642 ZEND_ARG_INFO(0, x)
1643 ZEND_END_ARG_INFO()
1644
1645 ZEND_BEGIN_ARG_INFO(arginfo_sinh, 0)
1646 ZEND_ARG_INFO(0, number)
1647 ZEND_END_ARG_INFO()
1648
1649 ZEND_BEGIN_ARG_INFO(arginfo_cosh, 0)
1650 ZEND_ARG_INFO(0, number)
1651 ZEND_END_ARG_INFO()
1652
1653 ZEND_BEGIN_ARG_INFO(arginfo_tanh, 0)
1654 ZEND_ARG_INFO(0, number)
1655 ZEND_END_ARG_INFO()
1656
1657 ZEND_BEGIN_ARG_INFO(arginfo_asinh, 0)
1658 ZEND_ARG_INFO(0, number)
1659 ZEND_END_ARG_INFO()
1660
1661 ZEND_BEGIN_ARG_INFO(arginfo_acosh, 0)
1662 ZEND_ARG_INFO(0, number)
1663 ZEND_END_ARG_INFO()
1664
1665 ZEND_BEGIN_ARG_INFO(arginfo_atanh, 0)
1666 ZEND_ARG_INFO(0, number)
1667 ZEND_END_ARG_INFO()
1668
1669 ZEND_BEGIN_ARG_INFO(arginfo_pi, 0)
1670 ZEND_END_ARG_INFO()
1671
1672 ZEND_BEGIN_ARG_INFO(arginfo_is_finite, 0)
1673 ZEND_ARG_INFO(0, val)
1674 ZEND_END_ARG_INFO()
1675
1676 ZEND_BEGIN_ARG_INFO(arginfo_is_infinite, 0)
1677 ZEND_ARG_INFO(0, val)
1678 ZEND_END_ARG_INFO()
1679
1680 ZEND_BEGIN_ARG_INFO(arginfo_is_nan, 0)
1681 ZEND_ARG_INFO(0, val)
1682 ZEND_END_ARG_INFO()
1683
1684 ZEND_BEGIN_ARG_INFO(arginfo_pow, 0)
1685 ZEND_ARG_INFO(0, base)
1686 ZEND_ARG_INFO(0, exponent)
1687 ZEND_END_ARG_INFO()
1688
1689 ZEND_BEGIN_ARG_INFO(arginfo_exp, 0)
1690 ZEND_ARG_INFO(0, number)
1691 ZEND_END_ARG_INFO()
1692
1693 ZEND_BEGIN_ARG_INFO(arginfo_expm1, 0)
1694 ZEND_ARG_INFO(0, number)
1695 ZEND_END_ARG_INFO()
1696
1697 ZEND_BEGIN_ARG_INFO(arginfo_log1p, 0)
1698 ZEND_ARG_INFO(0, number)
1699 ZEND_END_ARG_INFO()
1700
1701 ZEND_BEGIN_ARG_INFO_EX(arginfo_log, 0, 0, 1)
1702 ZEND_ARG_INFO(0, number)
1703 ZEND_ARG_INFO(0, base)
1704 ZEND_END_ARG_INFO()
1705
1706 ZEND_BEGIN_ARG_INFO(arginfo_log10, 0)
1707 ZEND_ARG_INFO(0, number)
1708 ZEND_END_ARG_INFO()
1709
1710 ZEND_BEGIN_ARG_INFO(arginfo_sqrt, 0)
1711 ZEND_ARG_INFO(0, number)
1712 ZEND_END_ARG_INFO()
1713
1714 ZEND_BEGIN_ARG_INFO(arginfo_hypot, 0)
1715 ZEND_ARG_INFO(0, num1)
1716 ZEND_ARG_INFO(0, num2)
1717 ZEND_END_ARG_INFO()
1718
1719 ZEND_BEGIN_ARG_INFO(arginfo_deg2rad, 0)
1720 ZEND_ARG_INFO(0, number)
1721 ZEND_END_ARG_INFO()
1722
1723 ZEND_BEGIN_ARG_INFO(arginfo_rad2deg, 0)
1724 ZEND_ARG_INFO(0, number)
1725 ZEND_END_ARG_INFO()
1726
1727 ZEND_BEGIN_ARG_INFO(arginfo_bindec, 0)
1728 ZEND_ARG_INFO(0, binary_number)
1729 ZEND_END_ARG_INFO()
1730
1731 ZEND_BEGIN_ARG_INFO(arginfo_hexdec, 0)
1732 ZEND_ARG_INFO(0, hexadecimal_number)
1733 ZEND_END_ARG_INFO()
1734
1735 ZEND_BEGIN_ARG_INFO(arginfo_octdec, 0)
1736 ZEND_ARG_INFO(0, octal_number)
1737 ZEND_END_ARG_INFO()
1738
1739 ZEND_BEGIN_ARG_INFO(arginfo_decbin, 0)
1740 ZEND_ARG_INFO(0, decimal_number)
1741 ZEND_END_ARG_INFO()
1742
1743 ZEND_BEGIN_ARG_INFO(arginfo_decoct, 0)
1744 ZEND_ARG_INFO(0, decimal_number)
1745 ZEND_END_ARG_INFO()
1746
1747 ZEND_BEGIN_ARG_INFO(arginfo_dechex, 0)
1748 ZEND_ARG_INFO(0, decimal_number)
1749 ZEND_END_ARG_INFO()
1750
1751 ZEND_BEGIN_ARG_INFO(arginfo_base_convert, 0)
1752 ZEND_ARG_INFO(0, number)
1753 ZEND_ARG_INFO(0, frombase)
1754 ZEND_ARG_INFO(0, tobase)
1755 ZEND_END_ARG_INFO()
1756
1757 ZEND_BEGIN_ARG_INFO_EX(arginfo_number_format, 0, 0, 1)
1758 ZEND_ARG_INFO(0, number)
1759 ZEND_ARG_INFO(0, num_decimal_places)
1760 ZEND_ARG_INFO(0, dec_separator)
1761 ZEND_ARG_INFO(0, thousands_separator)
1762 ZEND_END_ARG_INFO()
1763
1764 ZEND_BEGIN_ARG_INFO(arginfo_fmod, 0)
1765 ZEND_ARG_INFO(0, x)
1766 ZEND_ARG_INFO(0, y)
1767 ZEND_END_ARG_INFO()
1768
1769 ZEND_BEGIN_ARG_INFO(arginfo_intdiv, 0)
1770 ZEND_ARG_INFO(0, dividend)
1771 ZEND_ARG_INFO(0, divisor)
1772 ZEND_END_ARG_INFO()
1773 /* }}} */
1774 /* {{{ md5.c */
1775 ZEND_BEGIN_ARG_INFO_EX(arginfo_md5, 0, 0, 1)
1776 ZEND_ARG_INFO(0, str)
1777 ZEND_ARG_INFO(0, raw_output)
1778 ZEND_END_ARG_INFO()
1779
1780 ZEND_BEGIN_ARG_INFO_EX(arginfo_md5_file, 0, 0, 1)
1781 ZEND_ARG_INFO(0, filename)
1782 ZEND_ARG_INFO(0, raw_output)
1783 ZEND_END_ARG_INFO()
1784 /* }}} */
1785 /* {{{ metaphone.c */
1786 ZEND_BEGIN_ARG_INFO_EX(arginfo_metaphone, 0, 0, 1)
1787 ZEND_ARG_INFO(0, text)
1788 ZEND_ARG_INFO(0, phones)
1789 ZEND_END_ARG_INFO()
1790 /* }}} */
1791 /* {{{ microtime.c */
1792 #ifdef HAVE_GETTIMEOFDAY
1793 ZEND_BEGIN_ARG_INFO_EX(arginfo_microtime, 0, 0, 0)
1794 ZEND_ARG_INFO(0, get_as_float)
1795 ZEND_END_ARG_INFO()
1796
1797 ZEND_BEGIN_ARG_INFO_EX(arginfo_gettimeofday, 0, 0, 0)
1798 ZEND_ARG_INFO(0, get_as_float)
1799 ZEND_END_ARG_INFO()
1800 #endif
1801
1802 #ifdef HAVE_GETRUSAGE
1803 ZEND_BEGIN_ARG_INFO_EX(arginfo_getrusage, 0, 0, 0)
1804 ZEND_ARG_INFO(0, who)
1805 ZEND_END_ARG_INFO()
1806 #endif
1807 /* }}} */
1808 /* {{{ pack.c */
1809 ZEND_BEGIN_ARG_INFO_EX(arginfo_pack, 0, 0, 1)
1810 ZEND_ARG_INFO(0, format)
1811 ZEND_ARG_VARIADIC_INFO(0, args)
1812 ZEND_END_ARG_INFO()
1813
1814 ZEND_BEGIN_ARG_INFO_EX(arginfo_unpack, 0, 0, 2)
1815 ZEND_ARG_INFO(0, format)
1816 ZEND_ARG_INFO(0, input)
1817 ZEND_ARG_INFO(0, offset)
1818 ZEND_END_ARG_INFO()
1819 /* }}} */
1820 /* {{{ pageinfo.c */
1821 ZEND_BEGIN_ARG_INFO(arginfo_getmyuid, 0)
1822 ZEND_END_ARG_INFO()
1823
1824 ZEND_BEGIN_ARG_INFO(arginfo_getmygid, 0)
1825 ZEND_END_ARG_INFO()
1826
1827 ZEND_BEGIN_ARG_INFO(arginfo_getmypid, 0)
1828 ZEND_END_ARG_INFO()
1829
1830 ZEND_BEGIN_ARG_INFO(arginfo_getmyinode, 0)
1831 ZEND_END_ARG_INFO()
1832
1833 ZEND_BEGIN_ARG_INFO(arginfo_getlastmod, 0)
1834 ZEND_END_ARG_INFO()
1835 /* }}} */
1836 /* {{{ password.c */
1837 ZEND_BEGIN_ARG_INFO_EX(arginfo_password_hash, 0, 0, 2)
1838 ZEND_ARG_INFO(0, password)
1839 ZEND_ARG_INFO(0, algo)
1840 ZEND_ARG_INFO(0, options)
1841 ZEND_END_ARG_INFO()
1842 ZEND_BEGIN_ARG_INFO_EX(arginfo_password_get_info, 0, 0, 1)
1843 ZEND_ARG_INFO(0, hash)
1844 ZEND_END_ARG_INFO()
1845 ZEND_BEGIN_ARG_INFO_EX(arginfo_password_needs_rehash, 0, 0, 2)
1846 ZEND_ARG_INFO(0, hash)
1847 ZEND_ARG_INFO(0, algo)
1848 ZEND_ARG_INFO(0, options)
1849 ZEND_END_ARG_INFO()
1850 ZEND_BEGIN_ARG_INFO_EX(arginfo_password_verify, 0, 0, 2)
1851 ZEND_ARG_INFO(0, password)
1852 ZEND_ARG_INFO(0, hash)
1853 ZEND_END_ARG_INFO()
1854 ZEND_BEGIN_ARG_INFO(arginfo_password_algos, 0)
1855 ZEND_END_ARG_INFO();
1856 /* }}} */
1857 /* {{{ proc_open.c */
1858 #ifdef PHP_CAN_SUPPORT_PROC_OPEN
1859 ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_terminate, 0, 0, 1)
1860 ZEND_ARG_INFO(0, process)
1861 ZEND_ARG_INFO(0, signal)
1862 ZEND_END_ARG_INFO()
1863
1864 ZEND_BEGIN_ARG_INFO(arginfo_proc_close, 0)
1865 ZEND_ARG_INFO(0, process)
1866 ZEND_END_ARG_INFO()
1867
1868 ZEND_BEGIN_ARG_INFO(arginfo_proc_get_status, 0)
1869 ZEND_ARG_INFO(0, process)
1870 ZEND_END_ARG_INFO()
1871
1872 ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_open, 0, 0, 3)
1873 ZEND_ARG_INFO(0, command)
1874 ZEND_ARG_INFO(0, descriptorspec) /* ARRAY_INFO(0, descriptorspec, 1) */
1875 ZEND_ARG_INFO(1, pipes) /* ARRAY_INFO(1, pipes, 1) */
1876 ZEND_ARG_INFO(0, cwd)
1877 ZEND_ARG_INFO(0, env) /* ARRAY_INFO(0, env, 1) */
1878 ZEND_ARG_INFO(0, other_options) /* ARRAY_INFO(0, other_options, 1) */
1879 ZEND_END_ARG_INFO()
1880 #endif
1881 /* }}} */
1882 /* {{{ quot_print.c */
1883 ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_decode, 0)
1884 ZEND_ARG_INFO(0, str)
1885 ZEND_END_ARG_INFO()
1886 /* }}} */
1887 /* {{{ quot_print.c */
1888 ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_encode, 0)
1889 ZEND_ARG_INFO(0, str)
1890 ZEND_END_ARG_INFO()
1891 /* }}} */
1892 /* {{{ mt_rand.c */
1893 ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_srand, 0, 0, 0)
1894 ZEND_ARG_INFO(0, seed)
1895 ZEND_ARG_INFO(0, mode)
1896 ZEND_END_ARG_INFO()
1897
1898 ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_rand, 0, 0, 0)
1899 ZEND_ARG_INFO(0, min)
1900 ZEND_ARG_INFO(0, max)
1901 ZEND_END_ARG_INFO()
1902
1903 ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0)
1904 ZEND_END_ARG_INFO()
1905 /* }}} */
1906 /* {{{ random.c */
1907 ZEND_BEGIN_ARG_INFO_EX(arginfo_random_bytes, 0, 0, 1)
1908 ZEND_ARG_INFO(0, length)
1909 ZEND_END_ARG_INFO()
1910
1911 ZEND_BEGIN_ARG_INFO_EX(arginfo_random_int, 0, 0, 2)
1912 ZEND_ARG_INFO(0, min)
1913 ZEND_ARG_INFO(0, max)
1914 ZEND_END_ARG_INFO()
1915 /* }}} */
1916 /* {{{ sha1.c */
1917 ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1, 0, 0, 1)
1918 ZEND_ARG_INFO(0, str)
1919 ZEND_ARG_INFO(0, raw_output)
1920 ZEND_END_ARG_INFO()
1921
1922 ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1_file, 0, 0, 1)
1923 ZEND_ARG_INFO(0, filename)
1924 ZEND_ARG_INFO(0, raw_output)
1925 ZEND_END_ARG_INFO()
1926 /* }}} */
1927 /* {{{ soundex.c */
1928 ZEND_BEGIN_ARG_INFO(arginfo_soundex, 0)
1929 ZEND_ARG_INFO(0, str)
1930 ZEND_END_ARG_INFO()
1931 /* }}} */
1932 /* {{{ streamsfuncs.c */
1933 #if HAVE_SOCKETPAIR
1934 ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_pair, 0)
1935 ZEND_ARG_INFO(0, domain)
1936 ZEND_ARG_INFO(0, type)
1937 ZEND_ARG_INFO(0, protocol)
1938 ZEND_END_ARG_INFO()
1939 #endif
1940
1941 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_client, 0, 0, 1)
1942 ZEND_ARG_INFO(0, remoteaddress)
1943 ZEND_ARG_INFO(1, errcode)
1944 ZEND_ARG_INFO(1, errstring)
1945 ZEND_ARG_INFO(0, timeout)
1946 ZEND_ARG_INFO(0, flags)
1947 ZEND_ARG_INFO(0, context)
1948 ZEND_END_ARG_INFO()
1949
1950 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_server, 0, 0, 1)
1951 ZEND_ARG_INFO(0, localaddress)
1952 ZEND_ARG_INFO(1, errcode)
1953 ZEND_ARG_INFO(1, errstring)
1954 ZEND_ARG_INFO(0, flags)
1955 ZEND_ARG_INFO(0, context)
1956 ZEND_END_ARG_INFO()
1957
1958 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_accept, 0, 0, 1)
1959 ZEND_ARG_INFO(0, serverstream)
1960 ZEND_ARG_INFO(0, timeout)
1961 ZEND_ARG_INFO(1, peername)
1962 ZEND_END_ARG_INFO()
1963
1964 ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_get_name, 0)
1965 ZEND_ARG_INFO(0, stream)
1966 ZEND_ARG_INFO(0, want_peer)
1967 ZEND_END_ARG_INFO()
1968
1969 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_sendto, 0, 0, 2)
1970 ZEND_ARG_INFO(0, stream)
1971 ZEND_ARG_INFO(0, data)
1972 ZEND_ARG_INFO(0, flags)
1973 ZEND_ARG_INFO(0, target_addr)
1974 ZEND_END_ARG_INFO()
1975
1976 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_recvfrom, 0, 0, 2)
1977 ZEND_ARG_INFO(0, stream)
1978 ZEND_ARG_INFO(0, amount)
1979 ZEND_ARG_INFO(0, flags)
1980 ZEND_ARG_INFO(1, remote_addr)
1981 ZEND_END_ARG_INFO()
1982
1983 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_contents, 0, 0, 1)
1984 ZEND_ARG_INFO(0, source)
1985 ZEND_ARG_INFO(0, maxlen)
1986 ZEND_ARG_INFO(0, offset)
1987 ZEND_END_ARG_INFO()
1988
1989 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_copy_to_stream, 0, 0, 2)
1990 ZEND_ARG_INFO(0, source)
1991 ZEND_ARG_INFO(0, dest)
1992 ZEND_ARG_INFO(0, maxlen)
1993 ZEND_ARG_INFO(0, pos)
1994 ZEND_END_ARG_INFO()
1995
1996 ZEND_BEGIN_ARG_INFO(arginfo_stream_get_meta_data, 0)
1997 ZEND_ARG_INFO(0, fp)
1998 ZEND_END_ARG_INFO()
1999
2000 ZEND_BEGIN_ARG_INFO(arginfo_stream_get_transports, 0)
2001 ZEND_END_ARG_INFO()
2002
2003 ZEND_BEGIN_ARG_INFO(arginfo_stream_get_wrappers, 0)
2004 ZEND_END_ARG_INFO()
2005
2006 ZEND_BEGIN_ARG_INFO(arginfo_stream_resolve_include_path, 0)
2007 ZEND_ARG_INFO(0, filename)
2008 ZEND_END_ARG_INFO()
2009
2010 ZEND_BEGIN_ARG_INFO(arginfo_stream_is_local, 0)
2011 ZEND_ARG_INFO(0, stream)
2012 ZEND_END_ARG_INFO()
2013
2014 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_supports_lock, 0, 0, 1)
2015 ZEND_ARG_INFO(0, stream)
2016 ZEND_END_ARG_INFO()
2017
2018 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_isatty, 0, 0, 1)
2019 ZEND_ARG_INFO(0, stream)
2020 ZEND_END_ARG_INFO()
2021
2022 #ifdef PHP_WIN32
2023 ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_vt100_support, 0, 0, 1)
2024 ZEND_ARG_INFO(0, stream)
2025 ZEND_ARG_INFO(0, enable)
2026 ZEND_END_ARG_INFO()
2027 #endif
2028
2029 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_select, 0, 0, 4)
2030 ZEND_ARG_INFO(1, read_streams) /* ARRAY_INFO(1, read_streams, 1) */
2031 ZEND_ARG_INFO(1, write_streams) /* ARRAY_INFO(1, write_streams, 1) */
2032 ZEND_ARG_INFO(1, except_streams) /* ARRAY_INFO(1, except_streams, 1) */
2033 ZEND_ARG_INFO(0, tv_sec)
2034 ZEND_ARG_INFO(0, tv_usec)
2035 ZEND_END_ARG_INFO()
2036
2037 ZEND_BEGIN_ARG_INFO(arginfo_stream_context_get_options, 0)
2038 ZEND_ARG_INFO(0, stream_or_context)
2039 ZEND_END_ARG_INFO()
2040
2041 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_set_option, 0, 0, 2)
2042 ZEND_ARG_INFO(0, stream_or_context)
2043 ZEND_ARG_INFO(0, wrappername)
2044 ZEND_ARG_INFO(0, optionname)
2045 ZEND_ARG_INFO(0, value)
2046 ZEND_END_ARG_INFO()
2047
2048 ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_params, 0)
2049 ZEND_ARG_INFO(0, stream_or_context)
2050 ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
2051 ZEND_END_ARG_INFO()
2052
2053 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_params, 0, ZEND_RETURN_VALUE, 1)
2054 ZEND_ARG_INFO(0, stream_or_context)
2055 ZEND_END_ARG_INFO()
2056
2057 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_default, 0, 0, 0)
2058 ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
2059 ZEND_END_ARG_INFO()
2060
2061 ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_default, 0)
2062 ZEND_ARG_INFO(0, options)
2063 ZEND_END_ARG_INFO()
2064
2065 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_create, 0, 0, 0)
2066 ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
2067 ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */
2068 ZEND_END_ARG_INFO()
2069
2070 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_prepend, 0, 0, 2)
2071 ZEND_ARG_INFO(0, stream)
2072 ZEND_ARG_INFO(0, filtername)
2073 ZEND_ARG_INFO(0, read_write)
2074 ZEND_ARG_INFO(0, filterparams)
2075 ZEND_END_ARG_INFO()
2076
2077 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_append, 0, 0, 2)
2078 ZEND_ARG_INFO(0, stream)
2079 ZEND_ARG_INFO(0, filtername)
2080 ZEND_ARG_INFO(0, read_write)
2081 ZEND_ARG_INFO(0, filterparams)
2082 ZEND_END_ARG_INFO()
2083
2084 ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_remove, 0)
2085 ZEND_ARG_INFO(0, stream_filter)
2086 ZEND_END_ARG_INFO()
2087
2088 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_line, 0, 0, 2)
2089 ZEND_ARG_INFO(0, stream)
2090 ZEND_ARG_INFO(0, maxlen)
2091 ZEND_ARG_INFO(0, ending)
2092 ZEND_END_ARG_INFO()
2093
2094 ZEND_BEGIN_ARG_INFO(arginfo_stream_set_blocking, 0)
2095 ZEND_ARG_INFO(0, socket)
2096 ZEND_ARG_INFO(0, mode)
2097 ZEND_END_ARG_INFO()
2098
2099 #if HAVE_SYS_TIME_H || defined(PHP_WIN32)
2100 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_set_timeout, 0, 0, 2)
2101 ZEND_ARG_INFO(0, stream)
2102 ZEND_ARG_INFO(0, seconds)
2103 ZEND_ARG_INFO(0, microseconds)
2104 ZEND_END_ARG_INFO()
2105 #endif
2106
2107 ZEND_BEGIN_ARG_INFO(arginfo_stream_set_read_buffer, 0)
2108 ZEND_ARG_INFO(0, fp)
2109 ZEND_ARG_INFO(0, buffer)
2110 ZEND_END_ARG_INFO()
2111
2112 ZEND_BEGIN_ARG_INFO(arginfo_stream_set_write_buffer, 0)
2113 ZEND_ARG_INFO(0, fp)
2114 ZEND_ARG_INFO(0, buffer)
2115 ZEND_END_ARG_INFO()
2116
2117 ZEND_BEGIN_ARG_INFO(arginfo_stream_set_chunk_size, 0)
2118 ZEND_ARG_INFO(0, fp)
2119 ZEND_ARG_INFO(0, chunk_size)
2120 ZEND_END_ARG_INFO()
2121
2122 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_enable_crypto, 0, 0, 2)
2123 ZEND_ARG_INFO(0, stream)
2124 ZEND_ARG_INFO(0, enable)
2125 ZEND_ARG_INFO(0, cryptokind)
2126 ZEND_ARG_INFO(0, sessionstream)
2127 ZEND_END_ARG_INFO()
2128
2129 #ifdef HAVE_SHUTDOWN
2130 ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_shutdown, 0)
2131 ZEND_ARG_INFO(0, stream)
2132 ZEND_ARG_INFO(0, how)
2133 ZEND_END_ARG_INFO()
2134 #endif
2135 /* }}} */
2136 /* {{{ string.c */
2137 ZEND_BEGIN_ARG_INFO(arginfo_bin2hex, 0)
2138 ZEND_ARG_INFO(0, data)
2139 ZEND_END_ARG_INFO()
2140
2141 ZEND_BEGIN_ARG_INFO(arginfo_hex2bin, 0)
2142 ZEND_ARG_INFO(0, data)
2143 ZEND_END_ARG_INFO()
2144
2145 ZEND_BEGIN_ARG_INFO_EX(arginfo_strspn, 0, 0, 2)
2146 ZEND_ARG_INFO(0, str)
2147 ZEND_ARG_INFO(0, mask)
2148 ZEND_ARG_INFO(0, start)
2149 ZEND_ARG_INFO(0, len)
2150 ZEND_END_ARG_INFO()
2151
2152 ZEND_BEGIN_ARG_INFO_EX(arginfo_strcspn, 0, 0, 2)
2153 ZEND_ARG_INFO(0, str)
2154 ZEND_ARG_INFO(0, mask)
2155 ZEND_ARG_INFO(0, start)
2156 ZEND_ARG_INFO(0, len)
2157 ZEND_END_ARG_INFO()
2158
2159 #if HAVE_NL_LANGINFO
2160 ZEND_BEGIN_ARG_INFO(arginfo_nl_langinfo, 0)
2161 ZEND_ARG_INFO(0, item)
2162 ZEND_END_ARG_INFO()
2163 #endif
2164
2165 ZEND_BEGIN_ARG_INFO(arginfo_strcoll, 0)
2166 ZEND_ARG_INFO(0, str1)
2167 ZEND_ARG_INFO(0, str2)
2168 ZEND_END_ARG_INFO()
2169
2170 ZEND_BEGIN_ARG_INFO_EX(arginfo_trim, 0, 0, 1)
2171 ZEND_ARG_INFO(0, str)
2172 ZEND_ARG_INFO(0, character_mask)
2173 ZEND_END_ARG_INFO()
2174
2175 ZEND_BEGIN_ARG_INFO_EX(arginfo_rtrim, 0, 0, 1)
2176 ZEND_ARG_INFO(0, str)
2177 ZEND_ARG_INFO(0, character_mask)
2178 ZEND_END_ARG_INFO()
2179
2180 ZEND_BEGIN_ARG_INFO_EX(arginfo_ltrim, 0, 0, 1)
2181 ZEND_ARG_INFO(0, str)
2182 ZEND_ARG_INFO(0, character_mask)
2183 ZEND_END_ARG_INFO()
2184
2185 ZEND_BEGIN_ARG_INFO_EX(arginfo_wordwrap, 0, 0, 1)
2186 ZEND_ARG_INFO(0, str)
2187 ZEND_ARG_INFO(0, width)
2188 ZEND_ARG_INFO(0, break)
2189 ZEND_ARG_INFO(0, cut)
2190 ZEND_END_ARG_INFO()
2191
2192 ZEND_BEGIN_ARG_INFO_EX(arginfo_explode, 0, 0, 2)
2193 ZEND_ARG_INFO(0, separator)
2194 ZEND_ARG_INFO(0, str)
2195 ZEND_ARG_INFO(0, limit)
2196 ZEND_END_ARG_INFO()
2197
2198 ZEND_BEGIN_ARG_INFO(arginfo_implode, 0)
2199 ZEND_ARG_INFO(0, glue)
2200 ZEND_ARG_INFO(0, pieces)
2201 ZEND_END_ARG_INFO()
2202
2203 ZEND_BEGIN_ARG_INFO_EX(arginfo_strtok, 0, 0, 1)
2204 ZEND_ARG_INFO(0, str)
2205 ZEND_ARG_INFO(0, token)
2206 ZEND_END_ARG_INFO()
2207
2208 ZEND_BEGIN_ARG_INFO(arginfo_strtoupper, 0)
2209 ZEND_ARG_INFO(0, str)
2210 ZEND_END_ARG_INFO()
2211
2212 ZEND_BEGIN_ARG_INFO(arginfo_strtolower, 0)
2213 ZEND_ARG_INFO(0, str)
2214 ZEND_END_ARG_INFO()
2215
2216 ZEND_BEGIN_ARG_INFO_EX(arginfo_basename, 0, 0, 1)
2217 ZEND_ARG_INFO(0, path)
2218 ZEND_ARG_INFO(0, suffix)
2219 ZEND_END_ARG_INFO()
2220
2221 ZEND_BEGIN_ARG_INFO_EX(arginfo_dirname, 0, 0, 1)
2222 ZEND_ARG_INFO(0, path)
2223 ZEND_ARG_INFO(0, levels)
2224 ZEND_END_ARG_INFO()
2225
2226 ZEND_BEGIN_ARG_INFO_EX(arginfo_pathinfo, 0, 0, 1)
2227 ZEND_ARG_INFO(0, path)
2228 ZEND_ARG_INFO(0, options)
2229 ZEND_END_ARG_INFO()
2230
2231 ZEND_BEGIN_ARG_INFO_EX(arginfo_stristr, 0, 0, 2)
2232 ZEND_ARG_INFO(0, haystack)
2233 ZEND_ARG_INFO(0, needle)
2234 ZEND_ARG_INFO(0, part)
2235 ZEND_END_ARG_INFO()
2236
2237 ZEND_BEGIN_ARG_INFO_EX(arginfo_strstr, 0, 0, 2)
2238 ZEND_ARG_INFO(0, haystack)
2239 ZEND_ARG_INFO(0, needle)
2240 ZEND_ARG_INFO(0, part)
2241 ZEND_END_ARG_INFO()
2242
2243 ZEND_BEGIN_ARG_INFO_EX(arginfo_strpos, 0, 0, 2)
2244 ZEND_ARG_INFO(0, haystack)
2245 ZEND_ARG_INFO(0, needle)
2246 ZEND_ARG_INFO(0, offset)
2247 ZEND_END_ARG_INFO()
2248
2249 ZEND_BEGIN_ARG_INFO_EX(arginfo_stripos, 0, 0, 2)
2250 ZEND_ARG_INFO(0, haystack)
2251 ZEND_ARG_INFO(0, needle)
2252 ZEND_ARG_INFO(0, offset)
2253 ZEND_END_ARG_INFO()
2254
2255 ZEND_BEGIN_ARG_INFO_EX(arginfo_strrpos, 0, 0, 2)
2256 ZEND_ARG_INFO(0, haystack)
2257 ZEND_ARG_INFO(0, needle)
2258 ZEND_ARG_INFO(0, offset)
2259 ZEND_END_ARG_INFO()
2260
2261 ZEND_BEGIN_ARG_INFO_EX(arginfo_strripos, 0, 0, 2)
2262 ZEND_ARG_INFO(0, haystack)
2263 ZEND_ARG_INFO(0, needle)
2264 ZEND_ARG_INFO(0, offset)
2265 ZEND_END_ARG_INFO()
2266
2267 ZEND_BEGIN_ARG_INFO(arginfo_strrchr, 0)
2268 ZEND_ARG_INFO(0, haystack)
2269 ZEND_ARG_INFO(0, needle)
2270 ZEND_END_ARG_INFO()
2271
2272 ZEND_BEGIN_ARG_INFO_EX(arginfo_chunk_split, 0, 0, 1)
2273 ZEND_ARG_INFO(0, str)
2274 ZEND_ARG_INFO(0, chunklen)
2275 ZEND_ARG_INFO(0, ending)
2276 ZEND_END_ARG_INFO()
2277
2278 ZEND_BEGIN_ARG_INFO_EX(arginfo_substr, 0, 0, 2)
2279 ZEND_ARG_INFO(0, str)
2280 ZEND_ARG_INFO(0, start)
2281 ZEND_ARG_INFO(0, length)
2282 ZEND_END_ARG_INFO()
2283
2284 ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_replace, 0, 0, 3)
2285 ZEND_ARG_INFO(0, str)
2286 ZEND_ARG_INFO(0, replace)
2287 ZEND_ARG_INFO(0, start)
2288 ZEND_ARG_INFO(0, length)
2289 ZEND_END_ARG_INFO()
2290
2291 ZEND_BEGIN_ARG_INFO(arginfo_quotemeta, 0)
2292 ZEND_ARG_INFO(0, str)
2293 ZEND_END_ARG_INFO()
2294
2295 ZEND_BEGIN_ARG_INFO(arginfo_ord, 0)
2296 ZEND_ARG_INFO(0, character)
2297 ZEND_END_ARG_INFO()
2298
2299 ZEND_BEGIN_ARG_INFO(arginfo_chr, 0)
2300 ZEND_ARG_INFO(0, codepoint)
2301 ZEND_END_ARG_INFO()
2302
2303 ZEND_BEGIN_ARG_INFO(arginfo_ucfirst, 0)
2304 ZEND_ARG_INFO(0, str)
2305 ZEND_END_ARG_INFO()
2306
2307 ZEND_BEGIN_ARG_INFO(arginfo_lcfirst, 0)
2308 ZEND_ARG_INFO(0, str)
2309 ZEND_END_ARG_INFO()
2310
2311 ZEND_BEGIN_ARG_INFO_EX(arginfo_ucwords, 0, 0, 1)
2312 ZEND_ARG_INFO(0, str)
2313 ZEND_ARG_INFO(0, delimiters)
2314 ZEND_END_ARG_INFO()
2315
2316 ZEND_BEGIN_ARG_INFO_EX(arginfo_strtr, 0, 0, 2)
2317 ZEND_ARG_INFO(0, str)
2318 ZEND_ARG_INFO(0, from)
2319 ZEND_ARG_INFO(0, to)
2320 ZEND_END_ARG_INFO()
2321
2322 ZEND_BEGIN_ARG_INFO(arginfo_strrev, 0)
2323 ZEND_ARG_INFO(0, str)
2324 ZEND_END_ARG_INFO()
2325
2326 ZEND_BEGIN_ARG_INFO_EX(arginfo_similar_text, 0, 0, 2)
2327 ZEND_ARG_INFO(0, str1)
2328 ZEND_ARG_INFO(0, str2)
2329 ZEND_ARG_INFO(1, percent)
2330 ZEND_END_ARG_INFO()
2331
2332 ZEND_BEGIN_ARG_INFO(arginfo_addcslashes, 0)
2333 ZEND_ARG_INFO(0, str)
2334 ZEND_ARG_INFO(0, charlist)
2335 ZEND_END_ARG_INFO()
2336
2337 ZEND_BEGIN_ARG_INFO(arginfo_addslashes, 0)
2338 ZEND_ARG_INFO(0, str)
2339 ZEND_END_ARG_INFO()
2340
2341 ZEND_BEGIN_ARG_INFO(arginfo_stripcslashes, 0)
2342 ZEND_ARG_INFO(0, str)
2343 ZEND_END_ARG_INFO()
2344
2345 ZEND_BEGIN_ARG_INFO(arginfo_stripslashes, 0)
2346 ZEND_ARG_INFO(0, str)
2347 ZEND_END_ARG_INFO()
2348
2349 ZEND_BEGIN_ARG_INFO_EX(arginfo_str_replace, 0, 0, 3)
2350 ZEND_ARG_INFO(0, search)
2351 ZEND_ARG_INFO(0, replace)
2352 ZEND_ARG_INFO(0, subject)
2353 ZEND_ARG_INFO(1, replace_count)
2354 ZEND_END_ARG_INFO()
2355
2356 ZEND_BEGIN_ARG_INFO_EX(arginfo_str_ireplace, 0, 0, 3)
2357 ZEND_ARG_INFO(0, search)
2358 ZEND_ARG_INFO(0, replace)
2359 ZEND_ARG_INFO(0, subject)
2360 ZEND_ARG_INFO(1, replace_count)
2361 ZEND_END_ARG_INFO()
2362
2363 ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrev, 0, 0, 1)
2364 ZEND_ARG_INFO(0, str)
2365 ZEND_ARG_INFO(0, max_chars_per_line)
2366 ZEND_END_ARG_INFO()
2367
2368 ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrevc, 0, 0, 1)
2369 ZEND_ARG_INFO(0, str)
2370 ZEND_ARG_INFO(0, max_chars_per_line)
2371 ZEND_END_ARG_INFO()
2372
2373 ZEND_BEGIN_ARG_INFO_EX(arginfo_nl2br, 0, 0, 1)
2374 ZEND_ARG_INFO(0, str)
2375 ZEND_ARG_INFO(0, is_xhtml)
2376 ZEND_END_ARG_INFO()
2377
2378 ZEND_BEGIN_ARG_INFO_EX(arginfo_strip_tags, 0, 0, 1)
2379 ZEND_ARG_INFO(0, str)
2380 ZEND_ARG_INFO(0, allowable_tags)
2381 ZEND_END_ARG_INFO()
2382
2383 ZEND_BEGIN_ARG_INFO_EX(arginfo_setlocale, 0, 0, 2)
2384 ZEND_ARG_INFO(0, category)
2385 ZEND_ARG_VARIADIC_INFO(0, locales)
2386 ZEND_END_ARG_INFO()
2387
2388 ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_str, 0, 0, 1)
2389 ZEND_ARG_INFO(0, encoded_string)
2390 ZEND_ARG_INFO(1, result)
2391 ZEND_END_ARG_INFO()
2392
2393 ZEND_BEGIN_ARG_INFO_EX(arginfo_str_getcsv, 0, 0, 1)
2394 ZEND_ARG_INFO(0, string)
2395 ZEND_ARG_INFO(0, delimiter)
2396 ZEND_ARG_INFO(0, enclosure)
2397 ZEND_ARG_INFO(0, escape)
2398 ZEND_END_ARG_INFO()
2399
2400 ZEND_BEGIN_ARG_INFO(arginfo_str_repeat, 0)
2401 ZEND_ARG_INFO(0, input)
2402 ZEND_ARG_INFO(0, mult)
2403 ZEND_END_ARG_INFO()
2404
2405 ZEND_BEGIN_ARG_INFO_EX(arginfo_count_chars, 0, 0, 1)
2406 ZEND_ARG_INFO(0, input)
2407 ZEND_ARG_INFO(0, mode)
2408 ZEND_END_ARG_INFO()
2409
2410 ZEND_BEGIN_ARG_INFO(arginfo_strnatcmp, 0)
2411 ZEND_ARG_INFO(0, s1)
2412 ZEND_ARG_INFO(0, s2)
2413 ZEND_END_ARG_INFO()
2414
2415 ZEND_BEGIN_ARG_INFO(arginfo_localeconv, 0)
2416 ZEND_END_ARG_INFO()
2417
2418 ZEND_BEGIN_ARG_INFO(arginfo_strnatcasecmp, 0)
2419 ZEND_ARG_INFO(0, s1)
2420 ZEND_ARG_INFO(0, s2)
2421 ZEND_END_ARG_INFO()
2422
2423 ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_count, 0, 0, 2)
2424 ZEND_ARG_INFO(0, haystack)
2425 ZEND_ARG_INFO(0, needle)
2426 ZEND_ARG_INFO(0, offset)
2427 ZEND_ARG_INFO(0, length)
2428 ZEND_END_ARG_INFO()
2429
2430 ZEND_BEGIN_ARG_INFO_EX(arginfo_str_pad, 0, 0, 2)
2431 ZEND_ARG_INFO(0, input)
2432 ZEND_ARG_INFO(0, pad_length)
2433 ZEND_ARG_INFO(0, pad_string)
2434 ZEND_ARG_INFO(0, pad_type)
2435 ZEND_END_ARG_INFO()
2436
2437 ZEND_BEGIN_ARG_INFO_EX(arginfo_sscanf, 0, 0, 2)
2438 ZEND_ARG_INFO(0, str)
2439 ZEND_ARG_INFO(0, format)
2440 ZEND_ARG_VARIADIC_INFO(1, vars)
2441 ZEND_END_ARG_INFO()
2442
2443 ZEND_BEGIN_ARG_INFO(arginfo_str_rot13, 0)
2444 ZEND_ARG_INFO(0, str)
2445 ZEND_END_ARG_INFO()
2446
2447 ZEND_BEGIN_ARG_INFO(arginfo_str_shuffle, 0)
2448 ZEND_ARG_INFO(0, str)
2449 ZEND_END_ARG_INFO()
2450
2451 ZEND_BEGIN_ARG_INFO_EX(arginfo_str_word_count, 0, 0, 1)
2452 ZEND_ARG_INFO(0, str)
2453 ZEND_ARG_INFO(0, format)
2454 ZEND_ARG_INFO(0, charlist)
2455 ZEND_END_ARG_INFO()
2456
2457 #ifdef HAVE_STRFMON
2458 ZEND_BEGIN_ARG_INFO(arginfo_money_format, 0)
2459 ZEND_ARG_INFO(0, format)
2460 ZEND_ARG_INFO(0, value)
2461 ZEND_END_ARG_INFO()
2462 #endif
2463
2464 ZEND_BEGIN_ARG_INFO_EX(arginfo_str_split, 0, 0, 1)
2465 ZEND_ARG_INFO(0, str)
2466 ZEND_ARG_INFO(0, split_length)
2467 ZEND_END_ARG_INFO()
2468
2469 ZEND_BEGIN_ARG_INFO_EX(arginfo_strpbrk, 0, 0, 2)
2470 ZEND_ARG_INFO(0, haystack)
2471 ZEND_ARG_INFO(0, char_list)
2472 ZEND_END_ARG_INFO()
2473
2474 ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_compare, 0, 0, 3)
2475 ZEND_ARG_INFO(0, main_str)
2476 ZEND_ARG_INFO(0, str)
2477 ZEND_ARG_INFO(0, offset)
2478 ZEND_ARG_INFO(0, length)
2479 ZEND_ARG_INFO(0, case_sensitivity)
2480 ZEND_END_ARG_INFO()
2481
2482 ZEND_BEGIN_ARG_INFO_EX(arginfo_utf8_encode, 0, 0, 1)
2483 ZEND_ARG_INFO(0, data)
2484 ZEND_END_ARG_INFO()
2485
2486 ZEND_BEGIN_ARG_INFO_EX(arginfo_utf8_decode, 0, 0, 1)
2487 ZEND_ARG_INFO(0, data)
2488 ZEND_END_ARG_INFO()
2489 /* }}} */
2490 /* {{{ syslog.c */
2491 #ifdef HAVE_SYSLOG_H
2492 ZEND_BEGIN_ARG_INFO(arginfo_openlog, 0)
2493 ZEND_ARG_INFO(0, ident)
2494 ZEND_ARG_INFO(0, option)
2495 ZEND_ARG_INFO(0, facility)
2496 ZEND_END_ARG_INFO()
2497
2498 ZEND_BEGIN_ARG_INFO(arginfo_closelog, 0)
2499 ZEND_END_ARG_INFO()
2500
2501 ZEND_BEGIN_ARG_INFO(arginfo_syslog, 0)
2502 ZEND_ARG_INFO(0, priority)
2503 ZEND_ARG_INFO(0, message)
2504 ZEND_END_ARG_INFO()
2505 #endif
2506 /* }}} */
2507 /* {{{ type.c */
2508 ZEND_BEGIN_ARG_INFO(arginfo_gettype, 0)
2509 ZEND_ARG_INFO(0, var)
2510 ZEND_END_ARG_INFO()
2511
2512 ZEND_BEGIN_ARG_INFO(arginfo_settype, 0)
2513 ZEND_ARG_INFO(1, var)
2514 ZEND_ARG_INFO(0, type)
2515 ZEND_END_ARG_INFO()
2516
2517 ZEND_BEGIN_ARG_INFO_EX(arginfo_intval, 0, 0, 1)
2518 ZEND_ARG_INFO(0, var)
2519 ZEND_ARG_INFO(0, base)
2520 ZEND_END_ARG_INFO()
2521
2522 ZEND_BEGIN_ARG_INFO(arginfo_floatval, 0)
2523 ZEND_ARG_INFO(0, var)
2524 ZEND_END_ARG_INFO()
2525
2526 ZEND_BEGIN_ARG_INFO(arginfo_strval, 0)
2527 ZEND_ARG_INFO(0, var)
2528 ZEND_END_ARG_INFO()
2529
2530 ZEND_BEGIN_ARG_INFO(arginfo_boolval, 0)
2531 ZEND_ARG_INFO(0, var)
2532 ZEND_END_ARG_INFO()
2533
2534 ZEND_BEGIN_ARG_INFO(arginfo_is_null, 0)
2535 ZEND_ARG_INFO(0, var)
2536 ZEND_END_ARG_INFO()
2537
2538 ZEND_BEGIN_ARG_INFO(arginfo_is_resource, 0)
2539 ZEND_ARG_INFO(0, var)
2540 ZEND_END_ARG_INFO()
2541
2542 ZEND_BEGIN_ARG_INFO(arginfo_is_bool, 0)
2543 ZEND_ARG_INFO(0, var)
2544 ZEND_END_ARG_INFO()
2545
2546 ZEND_BEGIN_ARG_INFO(arginfo_is_int, 0)
2547 ZEND_ARG_INFO(0, var)
2548 ZEND_END_ARG_INFO()
2549
2550 ZEND_BEGIN_ARG_INFO(arginfo_is_float, 0)
2551 ZEND_ARG_INFO(0, var)
2552 ZEND_END_ARG_INFO()
2553
2554 ZEND_BEGIN_ARG_INFO(arginfo_is_string, 0)
2555 ZEND_ARG_INFO(0, var)
2556 ZEND_END_ARG_INFO()
2557
2558 ZEND_BEGIN_ARG_INFO(arginfo_is_array, 0)
2559 ZEND_ARG_INFO(0, var)
2560 ZEND_END_ARG_INFO()
2561
2562 ZEND_BEGIN_ARG_INFO(arginfo_is_object, 0)
2563 ZEND_ARG_INFO(0, var)
2564 ZEND_END_ARG_INFO()
2565
2566 ZEND_BEGIN_ARG_INFO(arginfo_is_numeric, 0)
2567 ZEND_ARG_INFO(0, value)
2568 ZEND_END_ARG_INFO()
2569
2570 ZEND_BEGIN_ARG_INFO(arginfo_is_scalar, 0)
2571 ZEND_ARG_INFO(0, value)
2572 ZEND_END_ARG_INFO()
2573
2574 ZEND_BEGIN_ARG_INFO_EX(arginfo_is_callable, 0, 0, 1)
2575 ZEND_ARG_INFO(0, var)
2576 ZEND_ARG_INFO(0, syntax_only)
2577 ZEND_ARG_INFO(1, callable_name)
2578 ZEND_END_ARG_INFO()
2579
2580 ZEND_BEGIN_ARG_INFO_EX(arginfo_is_iterable, 0, 0, 1)
2581 ZEND_ARG_INFO(0, var)
2582 ZEND_END_ARG_INFO()
2583
2584 ZEND_BEGIN_ARG_INFO(arginfo_is_countable, 0)
2585 ZEND_ARG_INFO(0, var)
2586 ZEND_END_ARG_INFO()
2587 /* }}} */
2588 /* {{{ uniqid.c */
2589 #ifdef HAVE_GETTIMEOFDAY
2590 ZEND_BEGIN_ARG_INFO_EX(arginfo_uniqid, 0, 0, 0)
2591 ZEND_ARG_INFO(0, prefix)
2592 ZEND_ARG_INFO(0, more_entropy)
2593 ZEND_END_ARG_INFO()
2594 #endif
2595 /* }}} */
2596 /* {{{ url.c */
2597 ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_url, 0, 0, 1)
2598 ZEND_ARG_INFO(0, url)
2599 ZEND_ARG_INFO(0, component)
2600 ZEND_END_ARG_INFO()
2601
2602 ZEND_BEGIN_ARG_INFO(arginfo_urlencode, 0)
2603 ZEND_ARG_INFO(0, str)
2604 ZEND_END_ARG_INFO()
2605
2606 ZEND_BEGIN_ARG_INFO(arginfo_urldecode, 0)
2607 ZEND_ARG_INFO(0, str)
2608 ZEND_END_ARG_INFO()
2609
2610 ZEND_BEGIN_ARG_INFO(arginfo_rawurlencode, 0)
2611 ZEND_ARG_INFO(0, str)
2612 ZEND_END_ARG_INFO()
2613
2614 ZEND_BEGIN_ARG_INFO(arginfo_rawurldecode, 0)
2615 ZEND_ARG_INFO(0, str)
2616 ZEND_END_ARG_INFO()
2617
2618 ZEND_BEGIN_ARG_INFO_EX(arginfo_get_headers, 0, 0, 1)
2619 ZEND_ARG_INFO(0, url)
2620 ZEND_ARG_INFO(0, format)
2621 ZEND_ARG_INFO(0, context)
2622 ZEND_END_ARG_INFO()
2623 /* }}} */
2624 /* {{{ user_filters.c */
2625 ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_make_writeable, 0)
2626 ZEND_ARG_INFO(0, brigade)
2627 ZEND_END_ARG_INFO()
2628
2629 ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_prepend, 0)
2630 ZEND_ARG_INFO(0, brigade)
2631 ZEND_ARG_INFO(0, bucket)
2632 ZEND_END_ARG_INFO()
2633
2634 ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_append, 0)
2635 ZEND_ARG_INFO(0, brigade)
2636 ZEND_ARG_INFO(0, bucket)
2637 ZEND_END_ARG_INFO()
2638
2639 ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_new, 0)
2640 ZEND_ARG_INFO(0, stream)
2641 ZEND_ARG_INFO(0, buffer)
2642 ZEND_END_ARG_INFO()
2643
2644 ZEND_BEGIN_ARG_INFO(arginfo_stream_get_filters, 0)
2645 ZEND_END_ARG_INFO()
2646
2647 ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_register, 0)
2648 ZEND_ARG_INFO(0, filtername)
2649 ZEND_ARG_INFO(0, classname)
2650 ZEND_END_ARG_INFO()
2651 /* }}} */
2652 /* {{{ uuencode.c */
2653 ZEND_BEGIN_ARG_INFO(arginfo_convert_uuencode, 0)
2654 ZEND_ARG_INFO(0, data)
2655 ZEND_END_ARG_INFO()
2656
2657 ZEND_BEGIN_ARG_INFO(arginfo_convert_uudecode, 0)
2658 ZEND_ARG_INFO(0, data)
2659 ZEND_END_ARG_INFO()
2660 /* }}} */
2661 /* {{{ var.c */
2662 ZEND_BEGIN_ARG_INFO_EX(arginfo_var_dump, 0, 0, 1)
2663 ZEND_ARG_VARIADIC_INFO(0, vars)
2664 ZEND_END_ARG_INFO()
2665
2666 ZEND_BEGIN_ARG_INFO_EX(arginfo_debug_zval_dump, 0, 0, 1)
2667 ZEND_ARG_VARIADIC_INFO(0, vars)
2668 ZEND_END_ARG_INFO()
2669
2670 ZEND_BEGIN_ARG_INFO_EX(arginfo_var_export, 0, 0, 1)
2671 ZEND_ARG_INFO(0, var)
2672 ZEND_ARG_INFO(0, return)
2673 ZEND_END_ARG_INFO()
2674
2675 ZEND_BEGIN_ARG_INFO(arginfo_serialize, 0)
2676 ZEND_ARG_INFO(0, var)
2677 ZEND_END_ARG_INFO()
2678
2679 ZEND_BEGIN_ARG_INFO_EX(arginfo_unserialize, 0, 0, 1)
2680 ZEND_ARG_INFO(0, variable_representation)
2681 ZEND_ARG_INFO(0, allowed_classes)
2682 ZEND_END_ARG_INFO()
2683
2684 ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_usage, 0, 0, 0)
2685 ZEND_ARG_INFO(0, real_usage)
2686 ZEND_END_ARG_INFO()
2687
2688 ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_peak_usage, 0, 0, 0)
2689 ZEND_ARG_INFO(0, real_usage)
2690 ZEND_END_ARG_INFO()
2691 /* }}} */
2692 /* {{{ versioning.c */
2693 ZEND_BEGIN_ARG_INFO_EX(arginfo_version_compare, 0, 0, 2)
2694 ZEND_ARG_INFO(0, ver1)
2695 ZEND_ARG_INFO(0, ver2)
2696 ZEND_ARG_INFO(0, oper)
2697 ZEND_END_ARG_INFO()
2698 /* }}} */
2699 /* {{{ win32/codepage.c */
2700 #ifdef PHP_WIN32
2701 ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_set, 0, 0, 1)
2702 ZEND_ARG_TYPE_INFO(0, code_page, IS_LONG, 0)
2703 ZEND_END_ARG_INFO()
2704
2705 ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_get, 0, 0, 0)
2706 ZEND_END_ARG_INFO()
2707
2708 ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_is_utf8, 0, 0, 0)
2709 ZEND_END_ARG_INFO()
2710
2711 ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_conv, 0, 0, 3)
2712 ZEND_ARG_INFO(0, in_codepage)
2713 ZEND_ARG_INFO(0, out_codepage)
2714 ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0)
2715 ZEND_END_ARG_INFO()
2716
2717 ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_set_ctrl_handler, 0, 0, 1)
2718 ZEND_ARG_INFO(0, callable)
2719 ZEND_ARG_INFO(0, add)
2720 ZEND_END_ARG_INFO()
2721
2722 ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_generate_ctrl_event, 0, 0, 1)
2723 ZEND_ARG_INFO(0, event)
2724 ZEND_ARG_INFO(0, pid)
2725 ZEND_END_ARG_INFO()
2726 #endif
2727 /* }}} */
2728 /* }}} */
2729
2730 static const zend_function_entry basic_functions[] = { /* {{{ */
2731 PHP_FE(constant, arginfo_constant)
2732 PHP_FE(bin2hex, arginfo_bin2hex)
2733 PHP_FE(hex2bin, arginfo_hex2bin)
2734 PHP_FE(sleep, arginfo_sleep)
2735 PHP_FE(usleep, arginfo_usleep)
2736 #if HAVE_NANOSLEEP
2737 PHP_FE(time_nanosleep, arginfo_time_nanosleep)
2738 PHP_FE(time_sleep_until, arginfo_time_sleep_until)
2739 #endif
2740
2741 #if HAVE_STRPTIME
2742 PHP_FE(strptime, arginfo_strptime)
2743 #endif
2744
2745 PHP_FE(flush, arginfo_flush)
2746 PHP_FE(wordwrap, arginfo_wordwrap)
2747 PHP_FE(htmlspecialchars, arginfo_htmlspecialchars)
2748 PHP_FE(htmlentities, arginfo_htmlentities)
2749 PHP_FE(html_entity_decode, arginfo_html_entity_decode)
2750 PHP_FE(htmlspecialchars_decode, arginfo_htmlspecialchars_decode)
2751 PHP_FE(get_html_translation_table, arginfo_get_html_translation_table)
2752 PHP_FE(sha1, arginfo_sha1)
2753 PHP_FE(sha1_file, arginfo_sha1_file)
2754 PHP_NAMED_FE(md5,php_if_md5, arginfo_md5)
2755 PHP_NAMED_FE(md5_file,php_if_md5_file, arginfo_md5_file)
2756 PHP_NAMED_FE(crc32,php_if_crc32, arginfo_crc32)
2757
2758 PHP_FE(iptcparse, arginfo_iptcparse)
2759 PHP_FE(iptcembed, arginfo_iptcembed)
2760 PHP_FE(getimagesize, arginfo_getimagesize)
2761 PHP_FE(getimagesizefromstring, arginfo_getimagesize)
2762 PHP_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type)
2763 PHP_FE(image_type_to_extension, arginfo_image_type_to_extension)
2764
2765 PHP_FE(phpinfo, arginfo_phpinfo)
2766 PHP_FE(phpversion, arginfo_phpversion)
2767 PHP_FE(phpcredits, arginfo_phpcredits)
2768 PHP_FE(php_sapi_name, arginfo_php_sapi_name)
2769 PHP_FE(php_uname, arginfo_php_uname)
2770 PHP_FE(php_ini_scanned_files, arginfo_php_ini_scanned_files)
2771 PHP_FE(php_ini_loaded_file, arginfo_php_ini_loaded_file)
2772
2773 PHP_FE(strnatcmp, arginfo_strnatcmp)
2774 PHP_FE(strnatcasecmp, arginfo_strnatcasecmp)
2775 PHP_FE(substr_count, arginfo_substr_count)
2776 PHP_FE(strspn, arginfo_strspn)
2777 PHP_FE(strcspn, arginfo_strcspn)
2778 PHP_FE(strtok, arginfo_strtok)
2779 PHP_FE(strtoupper, arginfo_strtoupper)
2780 PHP_FE(strtolower, arginfo_strtolower)
2781 PHP_FE(strpos, arginfo_strpos)
2782 PHP_FE(stripos, arginfo_stripos)
2783 PHP_FE(strrpos, arginfo_strrpos)
2784 PHP_FE(strripos, arginfo_strripos)
2785 PHP_FE(strrev, arginfo_strrev)
2786 PHP_FE(hebrev, arginfo_hebrev)
2787 PHP_DEP_FE(hebrevc, arginfo_hebrevc)
2788 PHP_FE(nl2br, arginfo_nl2br)
2789 PHP_FE(basename, arginfo_basename)
2790 PHP_FE(dirname, arginfo_dirname)
2791 PHP_FE(pathinfo, arginfo_pathinfo)
2792 PHP_FE(stripslashes, arginfo_stripslashes)
2793 PHP_FE(stripcslashes, arginfo_stripcslashes)
2794 PHP_FE(strstr, arginfo_strstr)
2795 PHP_FE(stristr, arginfo_stristr)
2796 PHP_FE(strrchr, arginfo_strrchr)
2797 PHP_FE(str_shuffle, arginfo_str_shuffle)
2798 PHP_FE(str_word_count, arginfo_str_word_count)
2799 PHP_FE(str_split, arginfo_str_split)
2800 PHP_FE(strpbrk, arginfo_strpbrk)
2801 PHP_FE(substr_compare, arginfo_substr_compare)
2802 PHP_FE(utf8_encode, arginfo_utf8_encode)
2803 PHP_FE(utf8_decode, arginfo_utf8_decode)
2804 PHP_FE(strcoll, arginfo_strcoll)
2805
2806 #ifdef HAVE_STRFMON
2807 PHP_DEP_FE(money_format, arginfo_money_format)
2808 #endif
2809
2810 PHP_FE(substr, arginfo_substr)
2811 PHP_FE(substr_replace, arginfo_substr_replace)
2812 PHP_FE(quotemeta, arginfo_quotemeta)
2813 PHP_FE(ucfirst, arginfo_ucfirst)
2814 PHP_FE(lcfirst, arginfo_lcfirst)
2815 PHP_FE(ucwords, arginfo_ucwords)
2816 PHP_FE(strtr, arginfo_strtr)
2817 PHP_FE(addslashes, arginfo_addslashes)
2818 PHP_FE(addcslashes, arginfo_addcslashes)
2819 PHP_FE(rtrim, arginfo_rtrim)
2820 PHP_FE(str_replace, arginfo_str_replace)
2821 PHP_FE(str_ireplace, arginfo_str_ireplace)
2822 PHP_FE(str_repeat, arginfo_str_repeat)
2823 PHP_FE(count_chars, arginfo_count_chars)
2824 PHP_FE(chunk_split, arginfo_chunk_split)
2825 PHP_FE(trim, arginfo_trim)
2826 PHP_FE(ltrim, arginfo_ltrim)
2827 PHP_FE(strip_tags, arginfo_strip_tags)
2828 PHP_FE(similar_text, arginfo_similar_text)
2829 PHP_FE(explode, arginfo_explode)
2830 PHP_FE(implode, arginfo_implode)
2831 PHP_FALIAS(join, implode, arginfo_implode)
2832 PHP_FE(setlocale, arginfo_setlocale)
2833 PHP_FE(localeconv, arginfo_localeconv)
2834
2835 #if HAVE_NL_LANGINFO
2836 PHP_FE(nl_langinfo, arginfo_nl_langinfo)
2837 #endif
2838
2839 PHP_FE(soundex, arginfo_soundex)
2840 PHP_FE(levenshtein, arginfo_levenshtein)
2841 PHP_FE(chr, arginfo_chr)
2842 PHP_FE(ord, arginfo_ord)
2843 PHP_FE(parse_str, arginfo_parse_str)
2844 PHP_FE(str_getcsv, arginfo_str_getcsv)
2845 PHP_FE(str_pad, arginfo_str_pad)
2846 PHP_FALIAS(chop, rtrim, arginfo_rtrim)
2847 PHP_FALIAS(strchr, strstr, arginfo_strstr)
2848 PHP_NAMED_FE(sprintf, PHP_FN(user_sprintf), arginfo_sprintf)
2849 PHP_NAMED_FE(printf, PHP_FN(user_printf), arginfo_printf)
2850 PHP_FE(vprintf, arginfo_vprintf)
2851 PHP_FE(vsprintf, arginfo_vsprintf)
2852 PHP_FE(fprintf, arginfo_fprintf)
2853 PHP_FE(vfprintf, arginfo_vfprintf)
2854 PHP_FE(sscanf, arginfo_sscanf)
2855 PHP_FE(fscanf, arginfo_fscanf)
2856 PHP_FE(parse_url, arginfo_parse_url)
2857 PHP_FE(urlencode, arginfo_urlencode)
2858 PHP_FE(urldecode, arginfo_urldecode)
2859 PHP_FE(rawurlencode, arginfo_rawurlencode)
2860 PHP_FE(rawurldecode, arginfo_rawurldecode)
2861 PHP_FE(http_build_query, arginfo_http_build_query)
2862
2863 #if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
2864 PHP_FE(readlink, arginfo_readlink)
2865 PHP_FE(linkinfo, arginfo_linkinfo)
2866 PHP_FE(symlink, arginfo_symlink)
2867 PHP_FE(link, arginfo_link)
2868 #endif
2869
2870 PHP_FE(unlink, arginfo_unlink)
2871 PHP_FE(exec, arginfo_exec)
2872 PHP_FE(system, arginfo_system)
2873 PHP_FE(escapeshellcmd, arginfo_escapeshellcmd)
2874 PHP_FE(escapeshellarg, arginfo_escapeshellarg)
2875 PHP_FE(passthru, arginfo_passthru)
2876 PHP_FE(shell_exec, arginfo_shell_exec)
2877 #ifdef PHP_CAN_SUPPORT_PROC_OPEN
2878 PHP_FE(proc_open, arginfo_proc_open)
2879 PHP_FE(proc_close, arginfo_proc_close)
2880 PHP_FE(proc_terminate, arginfo_proc_terminate)
2881 PHP_FE(proc_get_status, arginfo_proc_get_status)
2882 #endif
2883
2884 #ifdef HAVE_NICE
2885 PHP_FE(proc_nice, arginfo_proc_nice)
2886 #endif
2887
2888 PHP_FE(rand, arginfo_mt_rand)
2889 PHP_FALIAS(srand, mt_srand, arginfo_mt_srand)
2890 PHP_FALIAS(getrandmax, mt_getrandmax, arginfo_mt_getrandmax)
2891 PHP_FE(mt_rand, arginfo_mt_rand)
2892 PHP_FE(mt_srand, arginfo_mt_srand)
2893 PHP_FE(mt_getrandmax, arginfo_mt_getrandmax)
2894
2895 PHP_FE(random_bytes, arginfo_random_bytes)
2896 PHP_FE(random_int, arginfo_random_int)
2897
2898 #if HAVE_GETSERVBYNAME
2899 PHP_FE(getservbyname, arginfo_getservbyname)
2900 #endif
2901
2902 #if HAVE_GETSERVBYPORT
2903 PHP_FE(getservbyport, arginfo_getservbyport)
2904 #endif
2905
2906 #if HAVE_GETPROTOBYNAME
2907 PHP_FE(getprotobyname, arginfo_getprotobyname)
2908 #endif
2909
2910 #if HAVE_GETPROTOBYNUMBER
2911 PHP_FE(getprotobynumber, arginfo_getprotobynumber)
2912 #endif
2913
2914 PHP_FE(getmyuid, arginfo_getmyuid)
2915 PHP_FE(getmygid, arginfo_getmygid)
2916 PHP_FE(getmypid, arginfo_getmypid)
2917 PHP_FE(getmyinode, arginfo_getmyinode)
2918 PHP_FE(getlastmod, arginfo_getlastmod)
2919
2920 PHP_FE(base64_decode, arginfo_base64_decode)
2921 PHP_FE(base64_encode, arginfo_base64_encode)
2922
2923 PHP_FE(password_hash, arginfo_password_hash)
2924 PHP_FE(password_get_info, arginfo_password_get_info)
2925 PHP_FE(password_needs_rehash, arginfo_password_needs_rehash)
2926 PHP_FE(password_verify, arginfo_password_verify)
2927 PHP_FE(password_algos, arginfo_password_algos)
2928 PHP_FE(convert_uuencode, arginfo_convert_uuencode)
2929 PHP_FE(convert_uudecode, arginfo_convert_uudecode)
2930
2931 PHP_FE(abs, arginfo_abs)
2932 PHP_FE(ceil, arginfo_ceil)
2933 PHP_FE(floor, arginfo_floor)
2934 PHP_FE(round, arginfo_round)
2935 PHP_FE(sin, arginfo_sin)
2936 PHP_FE(cos, arginfo_cos)
2937 PHP_FE(tan, arginfo_tan)
2938 PHP_FE(asin, arginfo_asin)
2939 PHP_FE(acos, arginfo_acos)
2940 PHP_FE(atan, arginfo_atan)
2941 PHP_FE(atanh, arginfo_atanh)
2942 PHP_FE(atan2, arginfo_atan2)
2943 PHP_FE(sinh, arginfo_sinh)
2944 PHP_FE(cosh, arginfo_cosh)
2945 PHP_FE(tanh, arginfo_tanh)
2946 PHP_FE(asinh, arginfo_asinh)
2947 PHP_FE(acosh, arginfo_acosh)
2948 PHP_FE(expm1, arginfo_expm1)
2949 PHP_FE(log1p, arginfo_log1p)
2950 PHP_FE(pi, arginfo_pi)
2951 PHP_FE(is_finite, arginfo_is_finite)
2952 PHP_FE(is_nan, arginfo_is_nan)
2953 PHP_FE(is_infinite, arginfo_is_infinite)
2954 PHP_FE(pow, arginfo_pow)
2955 PHP_FE(exp, arginfo_exp)
2956 PHP_FE(log, arginfo_log)
2957 PHP_FE(log10, arginfo_log10)
2958 PHP_FE(sqrt, arginfo_sqrt)
2959 PHP_FE(hypot, arginfo_hypot)
2960 PHP_FE(deg2rad, arginfo_deg2rad)
2961 PHP_FE(rad2deg, arginfo_rad2deg)
2962 PHP_FE(bindec, arginfo_bindec)
2963 PHP_FE(hexdec, arginfo_hexdec)
2964 PHP_FE(octdec, arginfo_octdec)
2965 PHP_FE(decbin, arginfo_decbin)
2966 PHP_FE(decoct, arginfo_decoct)
2967 PHP_FE(dechex, arginfo_dechex)
2968 PHP_FE(base_convert, arginfo_base_convert)
2969 PHP_FE(number_format, arginfo_number_format)
2970 PHP_FE(fmod, arginfo_fmod)
2971 PHP_FE(intdiv, arginfo_intdiv)
2972 #ifdef HAVE_INET_NTOP
2973 PHP_RAW_NAMED_FE(inet_ntop, zif_inet_ntop, arginfo_inet_ntop)
2974 #endif
2975 #ifdef HAVE_INET_PTON
2976 PHP_RAW_NAMED_FE(inet_pton, php_inet_pton, arginfo_inet_pton)
2977 #endif
2978 PHP_FE(ip2long, arginfo_ip2long)
2979 PHP_FE(long2ip, arginfo_long2ip)
2980
2981 PHP_FE(getenv, arginfo_getenv)
2982 #ifdef HAVE_PUTENV
2983 PHP_FE(putenv, arginfo_putenv)
2984 #endif
2985
2986 PHP_FE(getopt, arginfo_getopt)
2987
2988 #ifdef HAVE_GETLOADAVG
2989 PHP_FE(sys_getloadavg, arginfo_sys_getloadavg)
2990 #endif
2991 #ifdef HAVE_GETTIMEOFDAY
2992 PHP_FE(microtime, arginfo_microtime)
2993 PHP_FE(gettimeofday, arginfo_gettimeofday)
2994 #endif
2995
2996 #ifdef HAVE_GETRUSAGE
2997 PHP_FE(getrusage, arginfo_getrusage)
2998 #endif
2999
3000 PHP_FE(hrtime, arginfo_hrtime)
3001
3002 #ifdef HAVE_GETTIMEOFDAY
3003 PHP_FE(uniqid, arginfo_uniqid)
3004 #endif
3005
3006 PHP_FE(quoted_printable_decode, arginfo_quoted_printable_decode)
3007 PHP_FE(quoted_printable_encode, arginfo_quoted_printable_encode)
3008 PHP_DEP_FE(convert_cyr_string, arginfo_convert_cyr_string)
3009 PHP_FE(get_current_user, arginfo_get_current_user)
3010 PHP_FE(set_time_limit, arginfo_set_time_limit)
3011 PHP_FE(header_register_callback, arginfo_header_register_callback)
3012 PHP_FE(get_cfg_var, arginfo_get_cfg_var)
3013
3014 PHP_DEP_FE(get_magic_quotes_gpc, arginfo_get_magic_quotes_gpc)
3015 PHP_DEP_FE(get_magic_quotes_runtime, arginfo_get_magic_quotes_runtime)
3016
3017 PHP_FE(error_log, arginfo_error_log)
3018 PHP_FE(error_get_last, arginfo_error_get_last)
3019 PHP_FE(error_clear_last, arginfo_error_clear_last)
3020 PHP_FE(call_user_func, arginfo_call_user_func)
3021 PHP_FE(call_user_func_array, arginfo_call_user_func_array)
3022 PHP_FE(forward_static_call, arginfo_forward_static_call)
3023 PHP_FE(forward_static_call_array, arginfo_forward_static_call_array)
3024 PHP_FE(serialize, arginfo_serialize)
3025 PHP_FE(unserialize, arginfo_unserialize)
3026
3027 PHP_FE(var_dump, arginfo_var_dump)
3028 PHP_FE(var_export, arginfo_var_export)
3029 PHP_FE(debug_zval_dump, arginfo_debug_zval_dump)
3030 PHP_FE(print_r, arginfo_print_r)
3031 PHP_FE(memory_get_usage, arginfo_memory_get_usage)
3032 PHP_FE(memory_get_peak_usage, arginfo_memory_get_peak_usage)
3033
3034 PHP_FE(register_shutdown_function, arginfo_register_shutdown_function)
3035 PHP_FE(register_tick_function, arginfo_register_tick_function)
3036 PHP_FE(unregister_tick_function, arginfo_unregister_tick_function)
3037
3038 PHP_FE(highlight_file, arginfo_highlight_file)
3039 PHP_FALIAS(show_source, highlight_file, arginfo_highlight_file)
3040 PHP_FE(highlight_string, arginfo_highlight_string)
3041 PHP_FE(php_strip_whitespace, arginfo_php_strip_whitespace)
3042
3043 PHP_FE(ini_get, arginfo_ini_get)
3044 PHP_FE(ini_get_all, arginfo_ini_get_all)
3045 PHP_FE(ini_set, arginfo_ini_set)
3046 PHP_FALIAS(ini_alter, ini_set, arginfo_ini_set)
3047 PHP_FE(ini_restore, arginfo_ini_restore)
3048 PHP_FE(get_include_path, arginfo_get_include_path)
3049 PHP_FE(set_include_path, arginfo_set_include_path)
3050 PHP_DEP_FE(restore_include_path, arginfo_restore_include_path)
3051
3052 PHP_FE(setcookie, arginfo_setcookie)
3053 PHP_FE(setrawcookie, arginfo_setrawcookie)
3054 PHP_FE(header, arginfo_header)
3055 PHP_FE(header_remove, arginfo_header_remove)
3056 PHP_FE(headers_sent, arginfo_headers_sent)
3057 PHP_FE(headers_list, arginfo_headers_list)
3058 PHP_FE(http_response_code, arginfo_http_response_code)
3059
3060 PHP_FE(connection_aborted, arginfo_connection_aborted)
3061 PHP_FE(connection_status, arginfo_connection_status)
3062 PHP_FE(ignore_user_abort, arginfo_ignore_user_abort)
3063 PHP_FE(parse_ini_file, arginfo_parse_ini_file)
3064 PHP_FE(parse_ini_string, arginfo_parse_ini_string)
3065 #if ZEND_DEBUG
3066 PHP_FE(config_get_hash, arginfo_config_get_hash)
3067 #endif
3068 PHP_FE(is_uploaded_file, arginfo_is_uploaded_file)
3069 PHP_FE(move_uploaded_file, arginfo_move_uploaded_file)
3070
3071 /* functions from dns.c */
3072 PHP_FE(gethostbyaddr, arginfo_gethostbyaddr)
3073 PHP_FE(gethostbyname, arginfo_gethostbyname)
3074 PHP_FE(gethostbynamel, arginfo_gethostbynamel)
3075
3076 #ifdef HAVE_GETHOSTNAME
3077 PHP_FE(gethostname, arginfo_gethostname)
3078 #endif
3079
3080 #if defined(PHP_WIN32) || HAVE_GETIFADDRS
3081 PHP_FE(net_get_interfaces, arginfo_net_get_interfaces)
3082 #endif
3083
3084 #if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
3085
3086 PHP_FE(dns_check_record, arginfo_dns_check_record)
3087 PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record)
3088
3089 # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
3090 PHP_FE(dns_get_mx, arginfo_dns_get_mx)
3091 PHP_FALIAS(getmxrr, dns_get_mx, arginfo_dns_get_mx)
3092 PHP_FE(dns_get_record, arginfo_dns_get_record)
3093 # endif
3094 #endif
3095
3096 /* functions from type.c */
3097 PHP_FE(intval, arginfo_intval)
3098 PHP_FE(floatval, arginfo_floatval)
3099 PHP_FALIAS(doubleval, floatval, arginfo_floatval)
3100 PHP_FE(strval, arginfo_strval)
3101 PHP_FE(boolval, arginfo_boolval)
3102 PHP_FE(gettype, arginfo_gettype)
3103 PHP_FE(settype, arginfo_settype)
3104 PHP_FE(is_null, arginfo_is_null)
3105 PHP_FE(is_resource, arginfo_is_resource)
3106 PHP_FE(is_bool, arginfo_is_bool)
3107 PHP_FE(is_int, arginfo_is_int)
3108 PHP_FE(is_float, arginfo_is_float)
3109 PHP_FALIAS(is_integer, is_int, arginfo_is_int)
3110 PHP_FALIAS(is_long, is_int, arginfo_is_int)
3111 PHP_FALIAS(is_double, is_float, arginfo_is_float)
3112 PHP_DEP_FALIAS(is_real, is_float, arginfo_is_float)
3113 PHP_FE(is_numeric, arginfo_is_numeric)
3114 PHP_FE(is_string, arginfo_is_string)
3115 PHP_FE(is_array, arginfo_is_array)
3116 PHP_FE(is_object, arginfo_is_object)
3117 PHP_FE(is_scalar, arginfo_is_scalar)
3118 PHP_FE(is_callable, arginfo_is_callable)
3119 PHP_FE(is_iterable, arginfo_is_iterable)
3120 PHP_FE(is_countable, arginfo_is_countable)
3121
3122 /* functions from file.c */
3123 PHP_FE(pclose, arginfo_pclose)
3124 PHP_FE(popen, arginfo_popen)
3125 PHP_FE(readfile, arginfo_readfile)
3126 PHP_FE(rewind, arginfo_rewind)
3127 PHP_FE(rmdir, arginfo_rmdir)
3128 PHP_FE(umask, arginfo_umask)
3129 PHP_FE(fclose, arginfo_fclose)
3130 PHP_FE(feof, arginfo_feof)
3131 PHP_FE(fgetc, arginfo_fgetc)
3132 PHP_FE(fgets, arginfo_fgets)
3133 PHP_DEP_FE(fgetss, arginfo_fgetss)
3134 PHP_FE(fread, arginfo_fread)
3135 PHP_NAMED_FE(fopen, php_if_fopen, arginfo_fopen)
3136 PHP_FE(fpassthru, arginfo_fpassthru)
3137 PHP_NAMED_FE(ftruncate, php_if_ftruncate, arginfo_ftruncate)
3138 PHP_NAMED_FE(fstat, php_if_fstat, arginfo_fstat)
3139 PHP_FE(fseek, arginfo_fseek)
3140 PHP_FE(ftell, arginfo_ftell)
3141 PHP_FE(fflush, arginfo_fflush)
3142 PHP_FE(fwrite, arginfo_fwrite)
3143 PHP_FALIAS(fputs, fwrite, arginfo_fwrite)
3144 PHP_FE(mkdir, arginfo_mkdir)
3145 PHP_FE(rename, arginfo_rename)
3146 PHP_FE(copy, arginfo_copy)
3147 PHP_FE(tempnam, arginfo_tempnam)
3148 PHP_NAMED_FE(tmpfile, php_if_tmpfile, arginfo_tmpfile)
3149 PHP_FE(file, arginfo_file)
3150 PHP_FE(file_get_contents, arginfo_file_get_contents)
3151 PHP_FE(file_put_contents, arginfo_file_put_contents)
3152 PHP_FE(stream_select, arginfo_stream_select)
3153 PHP_FE(stream_context_create, arginfo_stream_context_create)
3154 PHP_FE(stream_context_set_params, arginfo_stream_context_set_params)
3155 PHP_FE(stream_context_get_params, arginfo_stream_context_get_params)
3156 PHP_FE(stream_context_set_option, arginfo_stream_context_set_option)
3157 PHP_FE(stream_context_get_options, arginfo_stream_context_get_options)
3158 PHP_FE(stream_context_get_default, arginfo_stream_context_get_default)
3159 PHP_FE(stream_context_set_default, arginfo_stream_context_set_default)
3160 PHP_FE(stream_filter_prepend, arginfo_stream_filter_prepend)
3161 PHP_FE(stream_filter_append, arginfo_stream_filter_append)
3162 PHP_FE(stream_filter_remove, arginfo_stream_filter_remove)
3163 PHP_FE(stream_socket_client, arginfo_stream_socket_client)
3164 PHP_FE(stream_socket_server, arginfo_stream_socket_server)
3165 PHP_FE(stream_socket_accept, arginfo_stream_socket_accept)
3166 PHP_FE(stream_socket_get_name, arginfo_stream_socket_get_name)
3167 PHP_FE(stream_socket_recvfrom, arginfo_stream_socket_recvfrom)
3168 PHP_FE(stream_socket_sendto, arginfo_stream_socket_sendto)
3169 PHP_FE(stream_socket_enable_crypto, arginfo_stream_socket_enable_crypto)
3170 #ifdef HAVE_SHUTDOWN
3171 PHP_FE(stream_socket_shutdown, arginfo_stream_socket_shutdown)
3172 #endif
3173 #if HAVE_SOCKETPAIR
3174 PHP_FE(stream_socket_pair, arginfo_stream_socket_pair)
3175 #endif
3176 PHP_FE(stream_copy_to_stream, arginfo_stream_copy_to_stream)
3177 PHP_FE(stream_get_contents, arginfo_stream_get_contents)
3178 PHP_FE(stream_supports_lock, arginfo_stream_supports_lock)
3179 PHP_FE(stream_isatty, arginfo_stream_isatty)
3180 #ifdef PHP_WIN32
3181 PHP_FE(sapi_windows_vt100_support, arginfo_sapi_windows_vt100_support)
3182 #endif
3183 PHP_FE(fgetcsv, arginfo_fgetcsv)
3184 PHP_FE(fputcsv, arginfo_fputcsv)
3185 PHP_FE(flock, arginfo_flock)
3186 PHP_FE(get_meta_tags, arginfo_get_meta_tags)
3187 PHP_FE(stream_set_read_buffer, arginfo_stream_set_read_buffer)
3188 PHP_FE(stream_set_write_buffer, arginfo_stream_set_write_buffer)
3189 PHP_FALIAS(set_file_buffer, stream_set_write_buffer, arginfo_stream_set_write_buffer)
3190 PHP_FE(stream_set_chunk_size, arginfo_stream_set_chunk_size)
3191
3192 PHP_FE(stream_set_blocking, arginfo_stream_set_blocking)
3193 PHP_FALIAS(socket_set_blocking, stream_set_blocking, arginfo_stream_set_blocking)
3194
3195 PHP_FE(stream_get_meta_data, arginfo_stream_get_meta_data)
3196 PHP_FE(stream_get_line, arginfo_stream_get_line)
3197 PHP_FE(stream_wrapper_register, arginfo_stream_wrapper_register)
3198 PHP_FALIAS(stream_register_wrapper, stream_wrapper_register, arginfo_stream_wrapper_register)
3199 PHP_FE(stream_wrapper_unregister, arginfo_stream_wrapper_unregister)
3200 PHP_FE(stream_wrapper_restore, arginfo_stream_wrapper_restore)
3201 PHP_FE(stream_get_wrappers, arginfo_stream_get_wrappers)
3202 PHP_FE(stream_get_transports, arginfo_stream_get_transports)
3203 PHP_FE(stream_resolve_include_path, arginfo_stream_resolve_include_path)
3204 PHP_FE(stream_is_local, arginfo_stream_is_local)
3205 PHP_FE(get_headers, arginfo_get_headers)
3206
3207 #if HAVE_SYS_TIME_H || defined(PHP_WIN32)
3208 PHP_FE(stream_set_timeout, arginfo_stream_set_timeout)
3209 PHP_FALIAS(socket_set_timeout, stream_set_timeout, arginfo_stream_set_timeout)
3210 #endif
3211
3212 PHP_FALIAS(socket_get_status, stream_get_meta_data, arginfo_stream_get_meta_data)
3213
3214 #if HAVE_REALPATH || defined(ZTS)
3215 PHP_FE(realpath, arginfo_realpath)
3216 #endif
3217
3218 #ifdef HAVE_FNMATCH
3219 PHP_FE(fnmatch, arginfo_fnmatch)
3220 #endif
3221
3222 /* functions from fsock.c */
3223 PHP_FE(fsockopen, arginfo_fsockopen)
3224 PHP_FE(pfsockopen, arginfo_pfsockopen)
3225
3226 /* functions from pack.c */
3227 PHP_FE(pack, arginfo_pack)
3228 PHP_FE(unpack, arginfo_unpack)
3229
3230 /* functions from browscap.c */
3231 PHP_FE(get_browser, arginfo_get_browser)
3232
3233 /* functions from crypt.c */
3234 PHP_FE(crypt, arginfo_crypt)
3235
3236 /* functions from dir.c */
3237 PHP_FE(opendir, arginfo_opendir)
3238 PHP_FE(closedir, arginfo_closedir)
3239 PHP_FE(chdir, arginfo_chdir)
3240
3241 #if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
3242 PHP_FE(chroot, arginfo_chroot)
3243 #endif
3244
3245 PHP_FE(getcwd, arginfo_getcwd)
3246 PHP_FE(rewinddir, arginfo_rewinddir)
3247 PHP_NAMED_FE(readdir, php_if_readdir, arginfo_readdir)
3248 PHP_FALIAS(dir, getdir, arginfo_dir)
3249 PHP_FE(scandir, arginfo_scandir)
3250 #ifdef HAVE_GLOB
3251 PHP_FE(glob, arginfo_glob)
3252 #endif
3253 /* functions from filestat.c */
3254 PHP_FE(fileatime, arginfo_fileatime)
3255 PHP_FE(filectime, arginfo_filectime)
3256 PHP_FE(filegroup, arginfo_filegroup)
3257 PHP_FE(fileinode, arginfo_fileinode)
3258 PHP_FE(filemtime, arginfo_filemtime)
3259 PHP_FE(fileowner, arginfo_fileowner)
3260 PHP_FE(fileperms, arginfo_fileperms)
3261 PHP_FE(filesize, arginfo_filesize)
3262 PHP_FE(filetype, arginfo_filetype)
3263 PHP_FE(file_exists, arginfo_file_exists)
3264 PHP_FE(is_writable, arginfo_is_writable)
3265 PHP_FALIAS(is_writeable, is_writable, arginfo_is_writable)
3266 PHP_FE(is_readable, arginfo_is_readable)
3267 PHP_FE(is_executable, arginfo_is_executable)
3268 PHP_FE(is_file, arginfo_is_file)
3269 PHP_FE(is_dir, arginfo_is_dir)
3270 PHP_FE(is_link, arginfo_is_link)
3271 PHP_NAMED_FE(stat, php_if_stat, arginfo_stat)
3272 PHP_NAMED_FE(lstat, php_if_lstat, arginfo_lstat)
3273 PHP_FE(chown, arginfo_chown)
3274 PHP_FE(chgrp, arginfo_chgrp)
3275 #if HAVE_LCHOWN
3276 PHP_FE(lchown, arginfo_lchown)
3277 #endif
3278 #if HAVE_LCHOWN
3279 PHP_FE(lchgrp, arginfo_lchgrp)
3280 #endif
3281 PHP_FE(chmod, arginfo_chmod)
3282 #if HAVE_UTIME
3283 PHP_FE(touch, arginfo_touch)
3284 #endif
3285 PHP_FE(clearstatcache, arginfo_clearstatcache)
3286 PHP_FE(disk_total_space, arginfo_disk_total_space)
3287 PHP_FE(disk_free_space, arginfo_disk_free_space)
3288 PHP_FALIAS(diskfreespace, disk_free_space, arginfo_disk_free_space)
3289 PHP_FE(realpath_cache_size, arginfo_realpath_cache_size)
3290 PHP_FE(realpath_cache_get, arginfo_realpath_cache_get)
3291
3292 /* functions from mail.c */
3293 PHP_FE(mail, arginfo_mail)
3294 PHP_DEP_FE(ezmlm_hash, arginfo_ezmlm_hash)
3295
3296 /* functions from syslog.c */
3297 #ifdef HAVE_SYSLOG_H
3298 PHP_FE(openlog, arginfo_openlog)
3299 PHP_FE(syslog, arginfo_syslog)
3300 PHP_FE(closelog, arginfo_closelog)
3301 #endif
3302
3303 /* functions from lcg.c */
3304 PHP_FE(lcg_value, arginfo_lcg_value)
3305
3306 /* functions from metaphone.c */
3307 PHP_FE(metaphone, arginfo_metaphone)
3308
3309 /* functions from output.c */
3310 PHP_FE(ob_start, arginfo_ob_start)
3311 PHP_FE(ob_flush, arginfo_ob_flush)
3312 PHP_FE(ob_clean, arginfo_ob_clean)
3313 PHP_FE(ob_end_flush, arginfo_ob_end_flush)
3314 PHP_FE(ob_end_clean, arginfo_ob_end_clean)
3315 PHP_FE(ob_get_flush, arginfo_ob_get_flush)
3316 PHP_FE(ob_get_clean, arginfo_ob_get_clean)
3317 PHP_FE(ob_get_length, arginfo_ob_get_length)
3318 PHP_FE(ob_get_level, arginfo_ob_get_level)
3319 PHP_FE(ob_get_status, arginfo_ob_get_status)
3320 PHP_FE(ob_get_contents, arginfo_ob_get_contents)
3321 PHP_FE(ob_implicit_flush, arginfo_ob_implicit_flush)
3322 PHP_FE(ob_list_handlers, arginfo_ob_list_handlers)
3323
3324 /* functions from array.c */
3325 PHP_FE(ksort, arginfo_ksort)
3326 PHP_FE(krsort, arginfo_krsort)
3327 PHP_FE(natsort, arginfo_natsort)
3328 PHP_FE(natcasesort, arginfo_natcasesort)
3329 PHP_FE(asort, arginfo_asort)
3330 PHP_FE(arsort, arginfo_arsort)
3331 PHP_FE(sort, arginfo_sort)
3332 PHP_FE(rsort, arginfo_rsort)
3333 PHP_FE(usort, arginfo_usort)
3334 PHP_FE(uasort, arginfo_uasort)
3335 PHP_FE(uksort, arginfo_uksort)
3336 PHP_FE(shuffle, arginfo_shuffle)
3337 PHP_FE(array_walk, arginfo_array_walk)
3338 PHP_FE(array_walk_recursive, arginfo_array_walk_recursive)
3339 PHP_FE(count, arginfo_count)
3340 PHP_FE(end, arginfo_end)
3341 PHP_FE(prev, arginfo_prev)
3342 PHP_FE(next, arginfo_next)
3343 PHP_FE(reset, arginfo_reset)
3344 PHP_FE(current, arginfo_current)
3345 PHP_FE(key, arginfo_key)
3346 PHP_FE(min, arginfo_min)
3347 PHP_FE(max, arginfo_max)
3348 PHP_FE(in_array, arginfo_in_array)
3349 PHP_FE(array_search, arginfo_array_search)
3350 PHP_FE(extract, arginfo_extract)
3351 PHP_FE(compact, arginfo_compact)
3352 PHP_FE(array_fill, arginfo_array_fill)
3353 PHP_FE(array_fill_keys, arginfo_array_fill_keys)
3354 PHP_FE(range, arginfo_range)
3355 PHP_FE(array_multisort, arginfo_array_multisort)
3356 PHP_FE(array_push, arginfo_array_push)
3357 PHP_FE(array_pop, arginfo_array_pop)
3358 PHP_FE(array_shift, arginfo_array_shift)
3359 PHP_FE(array_unshift, arginfo_array_unshift)
3360 PHP_FE(array_splice, arginfo_array_splice)
3361 PHP_FE(array_slice, arginfo_array_slice)
3362 PHP_FE(array_merge, arginfo_array_merge)
3363 PHP_FE(array_merge_recursive, arginfo_array_merge_recursive)
3364 PHP_FE(array_replace, arginfo_array_replace)
3365 PHP_FE(array_replace_recursive, arginfo_array_replace_recursive)
3366 PHP_FE(array_keys, arginfo_array_keys)
3367 PHP_FE(array_key_first, arginfo_array_key_first)
3368 PHP_FE(array_key_last, arginfo_array_key_last)
3369 PHP_FE(array_values, arginfo_array_values)
3370 PHP_FE(array_count_values, arginfo_array_count_values)
3371 PHP_FE(array_column, arginfo_array_column)
3372 PHP_FE(array_reverse, arginfo_array_reverse)
3373 PHP_FE(array_reduce, arginfo_array_reduce)
3374 PHP_FE(array_pad, arginfo_array_pad)
3375 PHP_FE(array_flip, arginfo_array_flip)
3376 PHP_FE(array_change_key_case, arginfo_array_change_key_case)
3377 PHP_FE(array_rand, arginfo_array_rand)
3378 PHP_FE(array_unique, arginfo_array_unique)
3379 PHP_FE(array_intersect, arginfo_array_intersect)
3380 PHP_FE(array_intersect_key, arginfo_array_intersect_key)
3381 PHP_FE(array_intersect_ukey, arginfo_array_intersect_ukey)
3382 PHP_FE(array_uintersect, arginfo_array_uintersect)
3383 PHP_FE(array_intersect_assoc, arginfo_array_intersect_assoc)
3384 PHP_FE(array_uintersect_assoc, arginfo_array_uintersect_assoc)
3385 PHP_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc)
3386 PHP_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc)
3387 PHP_FE(array_diff, arginfo_array_diff)
3388 PHP_FE(array_diff_key, arginfo_array_diff_key)
3389 PHP_FE(array_diff_ukey, arginfo_array_diff_ukey)
3390 PHP_FE(array_udiff, arginfo_array_udiff)
3391 PHP_FE(array_diff_assoc, arginfo_array_diff_assoc)
3392 PHP_FE(array_udiff_assoc, arginfo_array_udiff_assoc)
3393 PHP_FE(array_diff_uassoc, arginfo_array_diff_uassoc)
3394 PHP_FE(array_udiff_uassoc, arginfo_array_udiff_uassoc)
3395 PHP_FE(array_sum, arginfo_array_sum)
3396 PHP_FE(array_product, arginfo_array_product)
3397 PHP_FE(array_filter, arginfo_array_filter)
3398 PHP_FE(array_map, arginfo_array_map)
3399 PHP_FE(array_chunk, arginfo_array_chunk)
3400 PHP_FE(array_combine, arginfo_array_combine)
3401 PHP_FE(array_key_exists, arginfo_array_key_exists)
3402
3403 /* aliases from array.c */
3404 PHP_FALIAS(pos, current, arginfo_current)
3405 PHP_FALIAS(sizeof, count, arginfo_count)
3406 PHP_FALIAS(key_exists, array_key_exists, arginfo_array_key_exists)
3407
3408 /* functions from assert.c */
3409 PHP_FE(assert, arginfo_assert)
3410 PHP_FE(assert_options, arginfo_assert_options)
3411
3412 /* functions from versioning.c */
3413 PHP_FE(version_compare, arginfo_version_compare)
3414
3415 /* functions from ftok.c*/
3416 #if HAVE_FTOK
3417 PHP_FE(ftok, arginfo_ftok)
3418 #endif
3419
3420 PHP_FE(str_rot13, arginfo_str_rot13)
3421 PHP_FE(stream_get_filters, arginfo_stream_get_filters)
3422 PHP_FE(stream_filter_register, arginfo_stream_filter_register)
3423 PHP_FE(stream_bucket_make_writeable, arginfo_stream_bucket_make_writeable)
3424 PHP_FE(stream_bucket_prepend, arginfo_stream_bucket_prepend)
3425 PHP_FE(stream_bucket_append, arginfo_stream_bucket_append)
3426 PHP_FE(stream_bucket_new, arginfo_stream_bucket_new)
3427
3428 PHP_FE(output_add_rewrite_var, arginfo_output_add_rewrite_var)
3429 PHP_FE(output_reset_rewrite_vars, arginfo_output_reset_rewrite_vars)
3430
3431 PHP_FE(sys_get_temp_dir, arginfo_sys_get_temp_dir)
3432
3433 #ifdef PHP_WIN32
3434 PHP_FE(sapi_windows_cp_set, arginfo_sapi_windows_cp_set)
3435 PHP_FE(sapi_windows_cp_get, arginfo_sapi_windows_cp_get)
3436 PHP_FE(sapi_windows_cp_is_utf8, arginfo_sapi_windows_cp_is_utf8)
3437 PHP_FE(sapi_windows_cp_conv, arginfo_sapi_windows_cp_conv)
3438 PHP_FE(sapi_windows_set_ctrl_handler, arginfo_sapi_windows_set_ctrl_handler)
3439 PHP_FE(sapi_windows_generate_ctrl_event, arginfo_sapi_windows_generate_ctrl_event)
3440 #endif
3441 PHP_FE_END
3442 };
3443 /* }}} */
3444
3445 static const zend_module_dep standard_deps[] = { /* {{{ */
3446 ZEND_MOD_OPTIONAL("session")
3447 ZEND_MOD_END
3448 };
3449 /* }}} */
3450
3451 zend_module_entry basic_functions_module = { /* {{{ */
3452 STANDARD_MODULE_HEADER_EX,
3453 NULL,
3454 standard_deps,
3455 "standard", /* extension name */
3456 basic_functions, /* function list */
3457 PHP_MINIT(basic), /* process startup */
3458 PHP_MSHUTDOWN(basic), /* process shutdown */
3459 PHP_RINIT(basic), /* request startup */
3460 PHP_RSHUTDOWN(basic), /* request shutdown */
3461 PHP_MINFO(basic), /* extension info */
3462 PHP_STANDARD_VERSION, /* extension version */
3463 STANDARD_MODULE_PROPERTIES
3464 };
3465 /* }}} */
3466
3467 #if defined(HAVE_PUTENV)
php_putenv_destructor(zval * zv)3468 static void php_putenv_destructor(zval *zv) /* {{{ */
3469 {
3470 putenv_entry *pe = Z_PTR_P(zv);
3471
3472 if (pe->previous_value) {
3473 # if defined(PHP_WIN32)
3474 /* MSVCRT has a bug in putenv() when setting a variable that
3475 * is already set; if the SetEnvironmentVariable() API call
3476 * fails, the Crt will double free() a string.
3477 * We try to avoid this by setting our own value first */
3478 SetEnvironmentVariable(pe->key, "bugbug");
3479 # endif
3480 putenv(pe->previous_value);
3481 # if defined(PHP_WIN32)
3482 efree(pe->previous_value);
3483 # endif
3484 } else {
3485 # if HAVE_UNSETENV
3486 unsetenv(pe->key);
3487 # elif defined(PHP_WIN32)
3488 SetEnvironmentVariable(pe->key, NULL);
3489 # ifndef ZTS
3490 _putenv_s(pe->key, "");
3491 # endif
3492 # else
3493 char **env;
3494
3495 for (env = environ; env != NULL && *env != NULL; env++) {
3496 if (!strncmp(*env, pe->key, pe->key_len) && (*env)[pe->key_len] == '=') { /* found it */
3497 *env = "";
3498 break;
3499 }
3500 }
3501 # endif
3502 }
3503 #ifdef HAVE_TZSET
3504 /* don't forget to reset the various libc globals that
3505 * we might have changed by an earlier call to tzset(). */
3506 if (!strncmp(pe->key, "TZ", pe->key_len)) {
3507 tzset();
3508 }
3509 #endif
3510
3511 efree(pe->putenv_string);
3512 efree(pe->key);
3513 efree(pe);
3514 }
3515 /* }}} */
3516 #endif
3517
basic_globals_ctor(php_basic_globals * basic_globals_p)3518 static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */
3519 {
3520 BG(mt_rand_is_seeded) = 0;
3521 BG(mt_rand_mode) = MT_RAND_MT19937;
3522 BG(umask) = -1;
3523 BG(next) = NULL;
3524 BG(left) = -1;
3525 BG(user_tick_functions) = NULL;
3526 BG(user_filter_map) = NULL;
3527 BG(serialize_lock) = 0;
3528
3529 memset(&BG(serialize), 0, sizeof(BG(serialize)));
3530 memset(&BG(unserialize), 0, sizeof(BG(unserialize)));
3531
3532 memset(&BG(url_adapt_session_ex), 0, sizeof(BG(url_adapt_session_ex)));
3533 memset(&BG(url_adapt_output_ex), 0, sizeof(BG(url_adapt_output_ex)));
3534
3535 BG(url_adapt_session_ex).type = 1;
3536 BG(url_adapt_output_ex).type = 0;
3537
3538 zend_hash_init(&BG(url_adapt_session_hosts_ht), 0, NULL, NULL, 1);
3539 zend_hash_init(&BG(url_adapt_output_hosts_ht), 0, NULL, NULL, 1);
3540
3541 #if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
3542 memset(&BG(mblen_state), 0, sizeof(BG(mblen_state)));
3543 #endif
3544
3545 BG(incomplete_class) = incomplete_class_entry;
3546 BG(page_uid) = -1;
3547 BG(page_gid) = -1;
3548 }
3549 /* }}} */
3550
basic_globals_dtor(php_basic_globals * basic_globals_p)3551 static void basic_globals_dtor(php_basic_globals *basic_globals_p) /* {{{ */
3552 {
3553 if (basic_globals_p->url_adapt_session_ex.tags) {
3554 zend_hash_destroy(basic_globals_p->url_adapt_session_ex.tags);
3555 free(basic_globals_p->url_adapt_session_ex.tags);
3556 }
3557 if (basic_globals_p->url_adapt_output_ex.tags) {
3558 zend_hash_destroy(basic_globals_p->url_adapt_output_ex.tags);
3559 free(basic_globals_p->url_adapt_output_ex.tags);
3560 }
3561
3562 zend_hash_destroy(&basic_globals_p->url_adapt_session_hosts_ht);
3563 zend_hash_destroy(&basic_globals_p->url_adapt_output_hosts_ht);
3564 }
3565 /* }}} */
3566
php_get_nan(void)3567 PHPAPI double php_get_nan(void) /* {{{ */
3568 {
3569 return ZEND_NAN;
3570 }
3571 /* }}} */
3572
php_get_inf(void)3573 PHPAPI double php_get_inf(void) /* {{{ */
3574 {
3575 return ZEND_INFINITY;
3576 }
3577 /* }}} */
3578
3579 #define BASIC_MINIT_SUBMODULE(module) \
3580 if (PHP_MINIT(module)(INIT_FUNC_ARGS_PASSTHRU) != SUCCESS) {\
3581 return FAILURE; \
3582 }
3583
3584 #define BASIC_RINIT_SUBMODULE(module) \
3585 PHP_RINIT(module)(INIT_FUNC_ARGS_PASSTHRU);
3586
3587 #define BASIC_MINFO_SUBMODULE(module) \
3588 PHP_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU);
3589
3590 #define BASIC_RSHUTDOWN_SUBMODULE(module) \
3591 PHP_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3592
3593 #define BASIC_MSHUTDOWN_SUBMODULE(module) \
3594 PHP_MSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3595
PHP_MINIT_FUNCTION(basic)3596 PHP_MINIT_FUNCTION(basic) /* {{{ */
3597 {
3598 #ifdef ZTS
3599 ts_allocate_id(&basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
3600 #ifdef PHP_WIN32
3601 ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, (ts_allocate_dtor)php_win32_core_globals_dtor );
3602 #endif
3603 #else
3604 basic_globals_ctor(&basic_globals);
3605 #ifdef PHP_WIN32
3606 php_win32_core_globals_ctor(&the_php_win32_core_globals);
3607 #endif
3608 #endif
3609
3610 BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class();
3611
3612 REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
3613 REGISTER_LONG_CONSTANT("CONNECTION_NORMAL", PHP_CONNECTION_NORMAL, CONST_CS | CONST_PERSISTENT);
3614 REGISTER_LONG_CONSTANT("CONNECTION_TIMEOUT", PHP_CONNECTION_TIMEOUT, CONST_CS | CONST_PERSISTENT);
3615
3616 REGISTER_LONG_CONSTANT("INI_USER", ZEND_INI_USER, CONST_CS | CONST_PERSISTENT);
3617 REGISTER_LONG_CONSTANT("INI_PERDIR", ZEND_INI_PERDIR, CONST_CS | CONST_PERSISTENT);
3618 REGISTER_LONG_CONSTANT("INI_SYSTEM", ZEND_INI_SYSTEM, CONST_CS | CONST_PERSISTENT);
3619 REGISTER_LONG_CONSTANT("INI_ALL", ZEND_INI_ALL, CONST_CS | CONST_PERSISTENT);
3620
3621 REGISTER_LONG_CONSTANT("INI_SCANNER_NORMAL", ZEND_INI_SCANNER_NORMAL, CONST_CS | CONST_PERSISTENT);
3622 REGISTER_LONG_CONSTANT("INI_SCANNER_RAW", ZEND_INI_SCANNER_RAW, CONST_CS | CONST_PERSISTENT);
3623 REGISTER_LONG_CONSTANT("INI_SCANNER_TYPED", ZEND_INI_SCANNER_TYPED, CONST_CS | CONST_PERSISTENT);
3624
3625 REGISTER_LONG_CONSTANT("PHP_URL_SCHEME", PHP_URL_SCHEME, CONST_CS | CONST_PERSISTENT);
3626 REGISTER_LONG_CONSTANT("PHP_URL_HOST", PHP_URL_HOST, CONST_CS | CONST_PERSISTENT);
3627 REGISTER_LONG_CONSTANT("PHP_URL_PORT", PHP_URL_PORT, CONST_CS | CONST_PERSISTENT);
3628 REGISTER_LONG_CONSTANT("PHP_URL_USER", PHP_URL_USER, CONST_CS | CONST_PERSISTENT);
3629 REGISTER_LONG_CONSTANT("PHP_URL_PASS", PHP_URL_PASS, CONST_CS | CONST_PERSISTENT);
3630 REGISTER_LONG_CONSTANT("PHP_URL_PATH", PHP_URL_PATH, CONST_CS | CONST_PERSISTENT);
3631 REGISTER_LONG_CONSTANT("PHP_URL_QUERY", PHP_URL_QUERY, CONST_CS | CONST_PERSISTENT);
3632 REGISTER_LONG_CONSTANT("PHP_URL_FRAGMENT", PHP_URL_FRAGMENT, CONST_CS | CONST_PERSISTENT);
3633 REGISTER_LONG_CONSTANT("PHP_QUERY_RFC1738", PHP_QUERY_RFC1738, CONST_CS | CONST_PERSISTENT);
3634 REGISTER_LONG_CONSTANT("PHP_QUERY_RFC3986", PHP_QUERY_RFC3986, CONST_CS | CONST_PERSISTENT);
3635
3636 #define REGISTER_MATH_CONSTANT(x) REGISTER_DOUBLE_CONSTANT(#x, x, CONST_CS | CONST_PERSISTENT)
3637 REGISTER_MATH_CONSTANT(M_E);
3638 REGISTER_MATH_CONSTANT(M_LOG2E);
3639 REGISTER_MATH_CONSTANT(M_LOG10E);
3640 REGISTER_MATH_CONSTANT(M_LN2);
3641 REGISTER_MATH_CONSTANT(M_LN10);
3642 REGISTER_MATH_CONSTANT(M_PI);
3643 REGISTER_MATH_CONSTANT(M_PI_2);
3644 REGISTER_MATH_CONSTANT(M_PI_4);
3645 REGISTER_MATH_CONSTANT(M_1_PI);
3646 REGISTER_MATH_CONSTANT(M_2_PI);
3647 REGISTER_MATH_CONSTANT(M_SQRTPI);
3648 REGISTER_MATH_CONSTANT(M_2_SQRTPI);
3649 REGISTER_MATH_CONSTANT(M_LNPI);
3650 REGISTER_MATH_CONSTANT(M_EULER);
3651 REGISTER_MATH_CONSTANT(M_SQRT2);
3652 REGISTER_MATH_CONSTANT(M_SQRT1_2);
3653 REGISTER_MATH_CONSTANT(M_SQRT3);
3654 REGISTER_DOUBLE_CONSTANT("INF", ZEND_INFINITY, CONST_CS | CONST_PERSISTENT);
3655 REGISTER_DOUBLE_CONSTANT("NAN", ZEND_NAN, CONST_CS | CONST_PERSISTENT);
3656
3657 REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_UP", PHP_ROUND_HALF_UP, CONST_CS | CONST_PERSISTENT);
3658 REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_DOWN", PHP_ROUND_HALF_DOWN, CONST_CS | CONST_PERSISTENT);
3659 REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_EVEN", PHP_ROUND_HALF_EVEN, CONST_CS | CONST_PERSISTENT);
3660 REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_ODD", PHP_ROUND_HALF_ODD, CONST_CS | CONST_PERSISTENT);
3661
3662 #if ENABLE_TEST_CLASS
3663 test_class_startup();
3664 #endif
3665
3666 register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU);
3667 register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
3668 register_string_constants(INIT_FUNC_ARGS_PASSTHRU);
3669
3670 BASIC_MINIT_SUBMODULE(var)
3671 BASIC_MINIT_SUBMODULE(file)
3672 BASIC_MINIT_SUBMODULE(pack)
3673 BASIC_MINIT_SUBMODULE(browscap)
3674 BASIC_MINIT_SUBMODULE(standard_filters)
3675 BASIC_MINIT_SUBMODULE(user_filters)
3676 BASIC_MINIT_SUBMODULE(password)
3677 BASIC_MINIT_SUBMODULE(mt_rand)
3678
3679 #if defined(ZTS)
3680 BASIC_MINIT_SUBMODULE(localeconv)
3681 #endif
3682
3683 #if defined(HAVE_NL_LANGINFO)
3684 BASIC_MINIT_SUBMODULE(nl_langinfo)
3685 #endif
3686
3687 #if ZEND_INTRIN_SSE4_2_FUNC_PTR
3688 BASIC_MINIT_SUBMODULE(string_intrin)
3689 #endif
3690
3691 #if ZEND_INTRIN_AVX2_FUNC_PTR || ZEND_INTRIN_SSSE3_FUNC_PTR
3692 BASIC_MINIT_SUBMODULE(base64_intrin)
3693 #endif
3694
3695 BASIC_MINIT_SUBMODULE(crypt)
3696 BASIC_MINIT_SUBMODULE(lcg)
3697
3698 BASIC_MINIT_SUBMODULE(dir)
3699 #ifdef HAVE_SYSLOG_H
3700 BASIC_MINIT_SUBMODULE(syslog)
3701 #endif
3702 BASIC_MINIT_SUBMODULE(array)
3703 BASIC_MINIT_SUBMODULE(assert)
3704 BASIC_MINIT_SUBMODULE(url_scanner_ex)
3705 #ifdef PHP_CAN_SUPPORT_PROC_OPEN
3706 BASIC_MINIT_SUBMODULE(proc_open)
3707 #endif
3708 BASIC_MINIT_SUBMODULE(exec)
3709
3710 BASIC_MINIT_SUBMODULE(user_streams)
3711 BASIC_MINIT_SUBMODULE(imagetypes)
3712
3713 php_register_url_stream_wrapper("php", &php_stream_php_wrapper);
3714 php_register_url_stream_wrapper("file", &php_plain_files_wrapper);
3715 #ifdef HAVE_GLOB
3716 php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper);
3717 #endif
3718 php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper);
3719 php_register_url_stream_wrapper("http", &php_stream_http_wrapper);
3720 php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper);
3721
3722 #if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
3723 # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
3724 BASIC_MINIT_SUBMODULE(dns)
3725 # endif
3726 #endif
3727
3728 BASIC_MINIT_SUBMODULE(random)
3729
3730 BASIC_MINIT_SUBMODULE(hrtime)
3731
3732 return SUCCESS;
3733 }
3734 /* }}} */
3735
PHP_MSHUTDOWN_FUNCTION(basic)3736 PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */
3737 {
3738 #ifdef HAVE_SYSLOG_H
3739 PHP_MSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3740 #endif
3741 #ifdef ZTS
3742 ts_free_id(basic_globals_id);
3743 #ifdef PHP_WIN32
3744 ts_free_id(php_win32_core_globals_id);
3745 #endif
3746 #else
3747 basic_globals_dtor(&basic_globals);
3748 #ifdef PHP_WIN32
3749 php_win32_core_globals_dtor(&the_php_win32_core_globals);
3750 #endif
3751 #endif
3752
3753 php_unregister_url_stream_wrapper("php");
3754 php_unregister_url_stream_wrapper("http");
3755 php_unregister_url_stream_wrapper("ftp");
3756
3757 BASIC_MSHUTDOWN_SUBMODULE(browscap)
3758 BASIC_MSHUTDOWN_SUBMODULE(array)
3759 BASIC_MSHUTDOWN_SUBMODULE(assert)
3760 BASIC_MSHUTDOWN_SUBMODULE(url_scanner_ex)
3761 BASIC_MSHUTDOWN_SUBMODULE(file)
3762 BASIC_MSHUTDOWN_SUBMODULE(standard_filters)
3763 #if defined(ZTS)
3764 BASIC_MSHUTDOWN_SUBMODULE(localeconv)
3765 #endif
3766 BASIC_MSHUTDOWN_SUBMODULE(crypt)
3767 BASIC_MSHUTDOWN_SUBMODULE(random)
3768 BASIC_MSHUTDOWN_SUBMODULE(password)
3769
3770 return SUCCESS;
3771 }
3772 /* }}} */
3773
PHP_RINIT_FUNCTION(basic)3774 PHP_RINIT_FUNCTION(basic) /* {{{ */
3775 {
3776 memset(BG(strtok_table), 0, 256);
3777
3778 BG(serialize_lock) = 0;
3779 memset(&BG(serialize), 0, sizeof(BG(serialize)));
3780 memset(&BG(unserialize), 0, sizeof(BG(unserialize)));
3781
3782 BG(strtok_string) = NULL;
3783 ZVAL_UNDEF(&BG(strtok_zval));
3784 BG(strtok_last) = NULL;
3785 BG(locale_string) = NULL;
3786 BG(locale_changed) = 0;
3787 BG(array_walk_fci) = empty_fcall_info;
3788 BG(array_walk_fci_cache) = empty_fcall_info_cache;
3789 BG(user_compare_fci) = empty_fcall_info;
3790 BG(user_compare_fci_cache) = empty_fcall_info_cache;
3791 BG(page_uid) = -1;
3792 BG(page_gid) = -1;
3793 BG(page_inode) = -1;
3794 BG(page_mtime) = -1;
3795 #ifdef HAVE_PUTENV
3796 zend_hash_init(&BG(putenv_ht), 1, NULL, php_putenv_destructor, 0);
3797 #endif
3798 BG(user_shutdown_function_names) = NULL;
3799
3800 PHP_RINIT(filestat)(INIT_FUNC_ARGS_PASSTHRU);
3801 #ifdef HAVE_SYSLOG_H
3802 BASIC_RINIT_SUBMODULE(syslog)
3803 #endif
3804 BASIC_RINIT_SUBMODULE(dir)
3805 BASIC_RINIT_SUBMODULE(url_scanner_ex)
3806
3807 /* Setup default context */
3808 FG(default_context) = NULL;
3809
3810 /* Default to global wrappers only */
3811 FG(stream_wrappers) = NULL;
3812
3813 /* Default to global filters only */
3814 FG(stream_filters) = NULL;
3815
3816 return SUCCESS;
3817 }
3818 /* }}} */
3819
PHP_RSHUTDOWN_FUNCTION(basic)3820 PHP_RSHUTDOWN_FUNCTION(basic) /* {{{ */
3821 {
3822 zval_ptr_dtor(&BG(strtok_zval));
3823 ZVAL_UNDEF(&BG(strtok_zval));
3824 BG(strtok_string) = NULL;
3825 #ifdef HAVE_PUTENV
3826 tsrm_env_lock();
3827 zend_hash_destroy(&BG(putenv_ht));
3828 tsrm_env_unlock();
3829 #endif
3830
3831 BG(mt_rand_is_seeded) = 0;
3832
3833 if (BG(umask) != -1) {
3834 umask(BG(umask));
3835 }
3836
3837 /* Check if locale was changed and change it back
3838 * to the value in startup environment */
3839 if (BG(locale_changed)) {
3840 setlocale(LC_ALL, "C");
3841 setlocale(LC_CTYPE, "");
3842 zend_update_current_locale();
3843 if (BG(locale_string)) {
3844 zend_string_release_ex(BG(locale_string), 0);
3845 BG(locale_string) = NULL;
3846 }
3847 }
3848
3849 /* FG(stream_wrappers) and FG(stream_filters) are destroyed
3850 * during php_request_shutdown() */
3851
3852 PHP_RSHUTDOWN(filestat)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3853 #ifdef HAVE_SYSLOG_H
3854 #ifdef PHP_WIN32
3855 BASIC_RSHUTDOWN_SUBMODULE(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3856 #endif
3857 #endif
3858 BASIC_RSHUTDOWN_SUBMODULE(assert)
3859 BASIC_RSHUTDOWN_SUBMODULE(url_scanner_ex)
3860 BASIC_RSHUTDOWN_SUBMODULE(streams)
3861 #ifdef PHP_WIN32
3862 BASIC_RSHUTDOWN_SUBMODULE(win32_core_globals)
3863 #endif
3864
3865 if (BG(user_tick_functions)) {
3866 zend_llist_destroy(BG(user_tick_functions));
3867 efree(BG(user_tick_functions));
3868 BG(user_tick_functions) = NULL;
3869 }
3870
3871 BASIC_RSHUTDOWN_SUBMODULE(user_filters)
3872 BASIC_RSHUTDOWN_SUBMODULE(browscap)
3873
3874 BG(page_uid) = -1;
3875 BG(page_gid) = -1;
3876 return SUCCESS;
3877 }
3878 /* }}} */
3879
PHP_MINFO_FUNCTION(basic)3880 PHP_MINFO_FUNCTION(basic) /* {{{ */
3881 {
3882 php_info_print_table_start();
3883 BASIC_MINFO_SUBMODULE(dl)
3884 BASIC_MINFO_SUBMODULE(mail)
3885 php_info_print_table_end();
3886 BASIC_MINFO_SUBMODULE(assert)
3887 }
3888 /* }}} */
3889
3890 /* {{{ proto mixed constant(string const_name)
3891 Given the name of a constant this function will return the constant's associated value */
PHP_FUNCTION(constant)3892 PHP_FUNCTION(constant)
3893 {
3894 zend_string *const_name;
3895 zval *c;
3896 zend_class_entry *scope;
3897
3898 ZEND_PARSE_PARAMETERS_START(1, 1)
3899 Z_PARAM_STR(const_name)
3900 ZEND_PARSE_PARAMETERS_END();
3901
3902 scope = zend_get_executed_scope();
3903 c = zend_get_constant_ex(const_name, scope, ZEND_FETCH_CLASS_SILENT);
3904 if (c) {
3905 ZVAL_COPY_OR_DUP(return_value, c);
3906 if (Z_TYPE_P(return_value) == IS_CONSTANT_AST) {
3907 if (UNEXPECTED(zval_update_constant_ex(return_value, scope) != SUCCESS)) {
3908 return;
3909 }
3910 }
3911 } else {
3912 if (!EG(exception)) {
3913 php_error_docref(NULL, E_WARNING, "Couldn't find constant %s", ZSTR_VAL(const_name));
3914 }
3915 RETURN_NULL();
3916 }
3917 }
3918 /* }}} */
3919
3920 #ifdef HAVE_INET_NTOP
3921 /* {{{ proto string inet_ntop(string in_addr)
3922 Converts a packed inet address to a human readable IP address string */
PHP_NAMED_FUNCTION(zif_inet_ntop)3923 PHP_NAMED_FUNCTION(zif_inet_ntop)
3924 {
3925 char *address;
3926 size_t address_len;
3927 int af = AF_INET;
3928 char buffer[40];
3929
3930 ZEND_PARSE_PARAMETERS_START(1, 1)
3931 Z_PARAM_STRING(address, address_len)
3932 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
3933
3934 #ifdef HAVE_IPV6
3935 if (address_len == 16) {
3936 af = AF_INET6;
3937 } else
3938 #endif
3939 if (address_len != 4) {
3940 RETURN_FALSE;
3941 }
3942
3943 if (!inet_ntop(af, address, buffer, sizeof(buffer))) {
3944 RETURN_FALSE;
3945 }
3946
3947 RETURN_STRING(buffer);
3948 }
3949 /* }}} */
3950 #endif /* HAVE_INET_NTOP */
3951
3952 #ifdef HAVE_INET_PTON
3953 /* {{{ proto string inet_pton(string ip_address)
3954 Converts a human readable IP address to a packed binary string */
PHP_NAMED_FUNCTION(php_inet_pton)3955 PHP_NAMED_FUNCTION(php_inet_pton)
3956 {
3957 int ret, af = AF_INET;
3958 char *address;
3959 size_t address_len;
3960 char buffer[17];
3961
3962 ZEND_PARSE_PARAMETERS_START(1, 1)
3963 Z_PARAM_STRING(address, address_len)
3964 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
3965
3966 memset(buffer, 0, sizeof(buffer));
3967
3968 #ifdef HAVE_IPV6
3969 if (strchr(address, ':')) {
3970 af = AF_INET6;
3971 } else
3972 #endif
3973 if (!strchr(address, '.')) {
3974 RETURN_FALSE;
3975 }
3976
3977 ret = inet_pton(af, address, buffer);
3978
3979 if (ret <= 0) {
3980 RETURN_FALSE;
3981 }
3982
3983 RETURN_STRINGL(buffer, af == AF_INET ? 4 : 16);
3984 }
3985 /* }}} */
3986 #endif /* HAVE_INET_PTON */
3987
3988 /* {{{ proto int ip2long(string ip_address)
3989 Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address */
PHP_FUNCTION(ip2long)3990 PHP_FUNCTION(ip2long)
3991 {
3992 char *addr;
3993 size_t addr_len;
3994 #ifdef HAVE_INET_PTON
3995 struct in_addr ip;
3996 #else
3997 zend_ulong ip;
3998 #endif
3999
4000 ZEND_PARSE_PARAMETERS_START(1, 1)
4001 Z_PARAM_STRING(addr, addr_len)
4002 ZEND_PARSE_PARAMETERS_END();
4003
4004 #ifdef HAVE_INET_PTON
4005 if (addr_len == 0 || inet_pton(AF_INET, addr, &ip) != 1) {
4006 RETURN_FALSE;
4007 }
4008 RETURN_LONG(ntohl(ip.s_addr));
4009 #else
4010 if (addr_len == 0 || (ip = inet_addr(addr)) == INADDR_NONE) {
4011 /* The only special case when we should return -1 ourselves,
4012 * because inet_addr() considers it wrong. We return 0xFFFFFFFF and
4013 * not -1 or ~0 because of 32/64bit issues. */
4014 if (addr_len == sizeof("255.255.255.255") - 1 &&
4015 !memcmp(addr, "255.255.255.255", sizeof("255.255.255.255") - 1)
4016 ) {
4017 RETURN_LONG(0xFFFFFFFF);
4018 }
4019 RETURN_FALSE;
4020 }
4021 RETURN_LONG(ntohl(ip));
4022 #endif
4023 }
4024 /* }}} */
4025
4026 /* {{{ proto string long2ip(int proper_address)
4027 Converts an (IPv4) Internet network address into a string in Internet standard dotted format */
PHP_FUNCTION(long2ip)4028 PHP_FUNCTION(long2ip)
4029 {
4030 zend_ulong ip;
4031 zend_long sip;
4032 struct in_addr myaddr;
4033 #ifdef HAVE_INET_PTON
4034 char str[40];
4035 #endif
4036
4037 ZEND_PARSE_PARAMETERS_START(1, 1)
4038 Z_PARAM_LONG(sip)
4039 ZEND_PARSE_PARAMETERS_END();
4040
4041 /* autoboxes on 32bit platforms, but that's expected */
4042 ip = (zend_ulong)sip;
4043
4044 myaddr.s_addr = htonl(ip);
4045 #ifdef HAVE_INET_PTON
4046 if (inet_ntop(AF_INET, &myaddr, str, sizeof(str))) {
4047 RETURN_STRING(str);
4048 } else {
4049 RETURN_FALSE;
4050 }
4051 #else
4052 RETURN_STRING(inet_ntoa(myaddr));
4053 #endif
4054 }
4055 /* }}} */
4056
4057 /********************
4058 * System Functions *
4059 ********************/
4060
4061 /* {{{ proto string getenv(string varname[, bool local_only]
4062 Get the value of an environment variable or every available environment variable
4063 if no varname is present */
PHP_FUNCTION(getenv)4064 PHP_FUNCTION(getenv)
4065 {
4066 char *ptr, *str = NULL;
4067 size_t str_len;
4068 zend_bool local_only = 0;
4069
4070 ZEND_PARSE_PARAMETERS_START(0, 2)
4071 Z_PARAM_OPTIONAL
4072 Z_PARAM_STRING(str, str_len)
4073 Z_PARAM_BOOL(local_only)
4074 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
4075
4076 if (!str) {
4077 array_init(return_value);
4078 php_import_environment_variables(return_value);
4079 return;
4080 }
4081
4082 if (!local_only) {
4083 /* SAPI method returns an emalloc()'d string */
4084 ptr = sapi_getenv(str, str_len);
4085 if (ptr) {
4086 // TODO: avoid realocation ???
4087 RETVAL_STRING(ptr);
4088 efree(ptr);
4089 return;
4090 }
4091 }
4092 #ifdef PHP_WIN32
4093 {
4094 wchar_t dummybuf;
4095 DWORD size;
4096 wchar_t *keyw, *valw;
4097
4098 keyw = php_win32_cp_conv_any_to_w(str, str_len, PHP_WIN32_CP_IGNORE_LEN_P);
4099 if (!keyw) {
4100 RETURN_FALSE;
4101 }
4102
4103 SetLastError(0);
4104 /*If the given bugger is not large enough to hold the data, the return value is
4105 the buffer size, in characters, required to hold the string and its terminating
4106 null character. We use this return value to alloc the final buffer. */
4107 size = GetEnvironmentVariableW(keyw, &dummybuf, 0);
4108 if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
4109 /* The environment variable doesn't exist. */
4110 free(keyw);
4111 RETURN_FALSE;
4112 }
4113
4114 if (size == 0) {
4115 /* env exists, but it is empty */
4116 free(keyw);
4117 RETURN_EMPTY_STRING();
4118 }
4119
4120 valw = emalloc((size + 1) * sizeof(wchar_t));
4121 size = GetEnvironmentVariableW(keyw, valw, size);
4122 if (size == 0) {
4123 /* has been removed between the two calls */
4124 free(keyw);
4125 efree(valw);
4126 RETURN_EMPTY_STRING();
4127 } else {
4128 ptr = php_win32_cp_w_to_any(valw);
4129 RETVAL_STRING(ptr);
4130 free(ptr);
4131 free(keyw);
4132 efree(valw);
4133 return;
4134 }
4135 }
4136 #else
4137
4138 tsrm_env_lock();
4139
4140 /* system method returns a const */
4141 ptr = getenv(str);
4142
4143 if (ptr) {
4144 RETVAL_STRING(ptr);
4145 }
4146
4147 tsrm_env_unlock();
4148
4149 if (ptr) {
4150 return;
4151 }
4152
4153 #endif
4154 RETURN_FALSE;
4155 }
4156 /* }}} */
4157
4158 #ifdef HAVE_PUTENV
4159 /* {{{ proto bool putenv(string setting)
4160 Set the value of an environment variable */
PHP_FUNCTION(putenv)4161 PHP_FUNCTION(putenv)
4162 {
4163 char *setting;
4164 size_t setting_len;
4165 char *p, **env;
4166 putenv_entry pe;
4167 #ifdef PHP_WIN32
4168 char *value = NULL;
4169 int equals = 0;
4170 int error_code;
4171 #endif
4172
4173 ZEND_PARSE_PARAMETERS_START(1, 1)
4174 Z_PARAM_STRING(setting, setting_len)
4175 ZEND_PARSE_PARAMETERS_END();
4176
4177 if(setting_len == 0 || setting[0] == '=') {
4178 php_error_docref(NULL, E_WARNING, "Invalid parameter syntax");
4179 RETURN_FALSE;
4180 }
4181
4182 pe.putenv_string = estrndup(setting, setting_len);
4183 pe.key = estrndup(setting, setting_len);
4184 if ((p = strchr(pe.key, '='))) { /* nullify the '=' if there is one */
4185 *p = '\0';
4186 #ifdef PHP_WIN32
4187 equals = 1;
4188 #endif
4189 }
4190
4191 pe.key_len = strlen(pe.key);
4192 #ifdef PHP_WIN32
4193 if (equals) {
4194 if (pe.key_len < setting_len - 1) {
4195 value = p + 1;
4196 } else {
4197 /* empty string*/
4198 value = p;
4199 }
4200 }
4201 #endif
4202
4203 tsrm_env_lock();
4204 zend_hash_str_del(&BG(putenv_ht), pe.key, pe.key_len);
4205
4206 /* find previous value */
4207 pe.previous_value = NULL;
4208 for (env = environ; env != NULL && *env != NULL; env++) {
4209 if (!strncmp(*env, pe.key, pe.key_len) && (*env)[pe.key_len] == '=') { /* found it */
4210 #if defined(PHP_WIN32)
4211 /* must copy previous value because MSVCRT's putenv can free the string without notice */
4212 pe.previous_value = estrdup(*env);
4213 #else
4214 pe.previous_value = *env;
4215 #endif
4216 break;
4217 }
4218 }
4219
4220 #if HAVE_UNSETENV
4221 if (!p) { /* no '=' means we want to unset it */
4222 unsetenv(pe.putenv_string);
4223 }
4224 if (!p || putenv(pe.putenv_string) == 0) { /* success */
4225 #else
4226 # ifndef PHP_WIN32
4227 if (putenv(pe.putenv_string) == 0) { /* success */
4228 # else
4229 wchar_t *keyw, *valw = NULL;
4230
4231 keyw = php_win32_cp_any_to_w(pe.key);
4232 if (value) {
4233 valw = php_win32_cp_any_to_w(value);
4234 }
4235 /* valw may be NULL, but the failed conversion still needs to be checked. */
4236 if (!keyw || !valw && value) {
4237 tsrm_env_unlock();
4238 efree(pe.putenv_string);
4239 efree(pe.key);
4240 free(keyw);
4241 free(valw);
4242 RETURN_FALSE;
4243 }
4244
4245 error_code = SetEnvironmentVariableW(keyw, valw);
4246
4247 if (error_code != 0
4248 # ifndef ZTS
4249 /* We need both SetEnvironmentVariable and _putenv here as some
4250 dependency lib could use either way to read the environment.
4251 Obviously the CRT version will be useful more often. But
4252 generally, doing both brings us on the safe track at least
4253 in NTS build. */
4254 && _wputenv_s(keyw, valw ? valw : L"") == 0
4255 # endif
4256 ) { /* success */
4257 # endif
4258 #endif
4259 zend_hash_str_add_mem(&BG(putenv_ht), pe.key, pe.key_len, &pe, sizeof(putenv_entry));
4260 #ifdef HAVE_TZSET
4261 if (!strncmp(pe.key, "TZ", pe.key_len)) {
4262 tzset();
4263 }
4264 #endif
4265 tsrm_env_unlock();
4266 #if defined(PHP_WIN32)
4267 free(keyw);
4268 free(valw);
4269 #endif
4270 RETURN_TRUE;
4271 } else {
4272 efree(pe.putenv_string);
4273 efree(pe.key);
4274 #if defined(PHP_WIN32)
4275 free(keyw);
4276 free(valw);
4277 #endif
4278 RETURN_FALSE;
4279 }
4280 }
4281 /* }}} */
4282 #endif
4283
4284 /* {{{ free_argv()
4285 Free the memory allocated to an argv array. */
4286 static void free_argv(char **argv, int argc)
4287 {
4288 int i;
4289
4290 if (argv) {
4291 for (i = 0; i < argc; i++) {
4292 if (argv[i]) {
4293 efree(argv[i]);
4294 }
4295 }
4296 efree(argv);
4297 }
4298 }
4299 /* }}} */
4300
4301 /* {{{ free_longopts()
4302 Free the memory allocated to an longopt array. */
4303 static void free_longopts(opt_struct *longopts)
4304 {
4305 opt_struct *p;
4306
4307 if (longopts) {
4308 for (p = longopts; p && p->opt_char != '-'; p++) {
4309 if (p->opt_name != NULL) {
4310 efree((char *)(p->opt_name));
4311 }
4312 }
4313 }
4314 }
4315 /* }}} */
4316
4317 /* {{{ parse_opts()
4318 Convert the typical getopt input characters to the php_getopt struct array */
4319 static int parse_opts(char * opts, opt_struct ** result)
4320 {
4321 opt_struct * paras = NULL;
4322 unsigned int i, count = 0;
4323 unsigned int opts_len = (unsigned int)strlen(opts);
4324
4325 for (i = 0; i < opts_len; i++) {
4326 if ((opts[i] >= 48 && opts[i] <= 57) ||
4327 (opts[i] >= 65 && opts[i] <= 90) ||
4328 (opts[i] >= 97 && opts[i] <= 122)
4329 ) {
4330 count++;
4331 }
4332 }
4333
4334 paras = safe_emalloc(sizeof(opt_struct), count, 0);
4335 memset(paras, 0, sizeof(opt_struct) * count);
4336 *result = paras;
4337 while ( (*opts >= 48 && *opts <= 57) || /* 0 - 9 */
4338 (*opts >= 65 && *opts <= 90) || /* A - Z */
4339 (*opts >= 97 && *opts <= 122) /* a - z */
4340 ) {
4341 paras->opt_char = *opts;
4342 paras->need_param = *(++opts) == ':';
4343 paras->opt_name = NULL;
4344 if (paras->need_param == 1) {
4345 opts++;
4346 if (*opts == ':') {
4347 paras->need_param++;
4348 opts++;
4349 }
4350 }
4351 paras++;
4352 }
4353 return count;
4354 }
4355 /* }}} */
4356
4357 /* {{{ proto array getopt(string options [, array longopts [, int &optind]])
4358 Get options from the command line argument list */
4359 PHP_FUNCTION(getopt)
4360 {
4361 char *options = NULL, **argv = NULL;
4362 char opt[2] = { '\0' };
4363 char *optname;
4364 int argc = 0, o;
4365 size_t options_len = 0, len;
4366 char *php_optarg = NULL;
4367 int php_optind = 1;
4368 zval val, *args = NULL, *p_longopts = NULL;
4369 zval *zoptind = NULL;
4370 size_t optname_len = 0;
4371 opt_struct *opts, *orig_opts;
4372
4373 ZEND_PARSE_PARAMETERS_START(1, 3)
4374 Z_PARAM_STRING(options, options_len)
4375 Z_PARAM_OPTIONAL
4376 Z_PARAM_ARRAY(p_longopts)
4377 Z_PARAM_ZVAL(zoptind)
4378 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
4379
4380 /* Init zoptind to 1 */
4381 if (zoptind) {
4382 ZEND_TRY_ASSIGN_REF_LONG(zoptind, 1);
4383 }
4384
4385 /* Get argv from the global symbol table. We calculate argc ourselves
4386 * in order to be on the safe side, even though it is also available
4387 * from the symbol table. */
4388 if ((Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY || zend_is_auto_global_str(ZEND_STRL("_SERVER"))) &&
4389 ((args = zend_hash_find_ex_ind(Z_ARRVAL_P(&PG(http_globals)[TRACK_VARS_SERVER]), ZSTR_KNOWN(ZEND_STR_ARGV), 1)) != NULL ||
4390 (args = zend_hash_find_ex_ind(&EG(symbol_table), ZSTR_KNOWN(ZEND_STR_ARGV), 1)) != NULL)
4391 ) {
4392 int pos = 0;
4393 zval *entry;
4394
4395 if (Z_TYPE_P(args) != IS_ARRAY) {
4396 RETURN_FALSE;
4397 }
4398 argc = zend_hash_num_elements(Z_ARRVAL_P(args));
4399
4400 /* Attempt to allocate enough memory to hold all of the arguments
4401 * and a trailing NULL */
4402 argv = (char **) safe_emalloc(sizeof(char *), (argc + 1), 0);
4403
4404 /* Iterate over the hash to construct the argv array. */
4405 ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(args), entry) {
4406 zend_string *tmp_arg_str;
4407 zend_string *arg_str = zval_get_tmp_string(entry, &tmp_arg_str);
4408
4409 argv[pos++] = estrdup(ZSTR_VAL(arg_str));
4410
4411 zend_tmp_string_release(tmp_arg_str);
4412 } ZEND_HASH_FOREACH_END();
4413
4414 /* The C Standard requires argv[argc] to be NULL - this might
4415 * keep some getopt implementations happy. */
4416 argv[argc] = NULL;
4417 } else {
4418 /* Return false if we can't find argv. */
4419 RETURN_FALSE;
4420 }
4421
4422 len = parse_opts(options, &opts);
4423
4424 if (p_longopts) {
4425 int count;
4426 zval *entry;
4427
4428 count = zend_hash_num_elements(Z_ARRVAL_P(p_longopts));
4429
4430 /* the first <len> slots are filled by the one short ops
4431 * we now extend our array and jump to the new added structs */
4432 opts = (opt_struct *) erealloc(opts, sizeof(opt_struct) * (len + count + 1));
4433 orig_opts = opts;
4434 opts += len;
4435
4436 memset(opts, 0, count * sizeof(opt_struct));
4437
4438 /* Iterate over the hash to construct the argv array. */
4439 ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(p_longopts), entry) {
4440 zend_string *tmp_arg_str;
4441 zend_string *arg_str = zval_get_tmp_string(entry, &tmp_arg_str);
4442
4443 opts->need_param = 0;
4444 opts->opt_name = estrdup(ZSTR_VAL(arg_str));
4445 len = strlen(opts->opt_name);
4446 if ((len > 0) && (opts->opt_name[len - 1] == ':')) {
4447 opts->need_param++;
4448 opts->opt_name[len - 1] = '\0';
4449 if ((len > 1) && (opts->opt_name[len - 2] == ':')) {
4450 opts->need_param++;
4451 opts->opt_name[len - 2] = '\0';
4452 }
4453 }
4454 opts->opt_char = 0;
4455 opts++;
4456
4457 zend_tmp_string_release(tmp_arg_str);
4458 } ZEND_HASH_FOREACH_END();
4459 } else {
4460 opts = (opt_struct*) erealloc(opts, sizeof(opt_struct) * (len + 1));
4461 orig_opts = opts;
4462 opts += len;
4463 }
4464
4465 /* php_getopt want to identify the last param */
4466 opts->opt_char = '-';
4467 opts->need_param = 0;
4468 opts->opt_name = NULL;
4469
4470 /* Initialize the return value as an array. */
4471 array_init(return_value);
4472
4473 /* after our pointer arithmetic jump back to the first element */
4474 opts = orig_opts;
4475
4476 while ((o = php_getopt(argc, argv, opts, &php_optarg, &php_optind, 0, 1)) != -1) {
4477 /* Skip unknown arguments. */
4478 if (o == PHP_GETOPT_INVALID_ARG) {
4479 continue;
4480 }
4481
4482 /* Prepare the option character and the argument string. */
4483 if (o == 0) {
4484 optname = opts[php_optidx].opt_name;
4485 } else {
4486 if (o == 1) {
4487 o = '-';
4488 }
4489 opt[0] = o;
4490 optname = opt;
4491 }
4492
4493 if (php_optarg != NULL) {
4494 /* keep the arg as binary, since the encoding is not known */
4495 ZVAL_STRING(&val, php_optarg);
4496 } else {
4497 ZVAL_FALSE(&val);
4498 }
4499
4500 /* Add this option / argument pair to the result hash. */
4501 optname_len = strlen(optname);
4502 if (!(optname_len > 1 && optname[0] == '0') && is_numeric_string(optname, optname_len, NULL, NULL, 0) == IS_LONG) {
4503 /* numeric string */
4504 int optname_int = atoi(optname);
4505 if ((args = zend_hash_index_find(Z_ARRVAL_P(return_value), optname_int)) != NULL) {
4506 if (Z_TYPE_P(args) != IS_ARRAY) {
4507 convert_to_array_ex(args);
4508 }
4509 zend_hash_next_index_insert(Z_ARRVAL_P(args), &val);
4510 } else {
4511 zend_hash_index_update(Z_ARRVAL_P(return_value), optname_int, &val);
4512 }
4513 } else {
4514 /* other strings */
4515 if ((args = zend_hash_str_find(Z_ARRVAL_P(return_value), optname, strlen(optname))) != NULL) {
4516 if (Z_TYPE_P(args) != IS_ARRAY) {
4517 convert_to_array_ex(args);
4518 }
4519 zend_hash_next_index_insert(Z_ARRVAL_P(args), &val);
4520 } else {
4521 zend_hash_str_add(Z_ARRVAL_P(return_value), optname, strlen(optname), &val);
4522 }
4523 }
4524
4525 php_optarg = NULL;
4526 }
4527
4528 /* Set zoptind to php_optind */
4529 if (zoptind) {
4530 ZEND_TRY_ASSIGN_REF_LONG(zoptind, php_optind);
4531 }
4532
4533 free_longopts(orig_opts);
4534 efree(orig_opts);
4535 free_argv(argv, argc);
4536 }
4537 /* }}} */
4538
4539 /* {{{ proto void flush(void)
4540 Flush the output buffer */
4541 PHP_FUNCTION(flush)
4542 {
4543 if (zend_parse_parameters_none() == FAILURE) {
4544 return;
4545 }
4546
4547 sapi_flush();
4548 }
4549 /* }}} */
4550
4551 /* {{{ proto void sleep(int seconds)
4552 Delay for a given number of seconds */
4553 PHP_FUNCTION(sleep)
4554 {
4555 zend_long num;
4556
4557 ZEND_PARSE_PARAMETERS_START(1, 1)
4558 Z_PARAM_LONG(num)
4559 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
4560
4561 if (num < 0) {
4562 php_error_docref(NULL, E_WARNING, "Number of seconds must be greater than or equal to 0");
4563 RETURN_FALSE;
4564 }
4565 #ifdef PHP_SLEEP_NON_VOID
4566 RETURN_LONG(php_sleep((unsigned int)num));
4567 #else
4568 php_sleep((unsigned int)num);
4569 #endif
4570
4571 }
4572 /* }}} */
4573
4574 /* {{{ proto void usleep(int micro_seconds)
4575 Delay for a given number of micro seconds */
4576 PHP_FUNCTION(usleep)
4577 {
4578 #if HAVE_USLEEP
4579 zend_long num;
4580
4581 ZEND_PARSE_PARAMETERS_START(1, 1)
4582 Z_PARAM_LONG(num)
4583 ZEND_PARSE_PARAMETERS_END();
4584
4585 if (num < 0) {
4586 php_error_docref(NULL, E_WARNING, "Number of microseconds must be greater than or equal to 0");
4587 RETURN_FALSE;
4588 }
4589 usleep((unsigned int)num);
4590 #endif
4591 }
4592 /* }}} */
4593
4594 #if HAVE_NANOSLEEP
4595 /* {{{ proto mixed time_nanosleep(int seconds, int nanoseconds)
4596 Delay for a number of seconds and nano seconds */
4597 PHP_FUNCTION(time_nanosleep)
4598 {
4599 zend_long tv_sec, tv_nsec;
4600 struct timespec php_req, php_rem;
4601
4602 ZEND_PARSE_PARAMETERS_START(2, 2)
4603 Z_PARAM_LONG(tv_sec)
4604 Z_PARAM_LONG(tv_nsec)
4605 ZEND_PARSE_PARAMETERS_END();
4606
4607 if (tv_sec < 0) {
4608 php_error_docref(NULL, E_WARNING, "The seconds value must be greater than 0");
4609 RETURN_FALSE;
4610 }
4611 if (tv_nsec < 0) {
4612 php_error_docref(NULL, E_WARNING, "The nanoseconds value must be greater than 0");
4613 RETURN_FALSE;
4614 }
4615
4616 php_req.tv_sec = (time_t) tv_sec;
4617 php_req.tv_nsec = (long)tv_nsec;
4618 if (!nanosleep(&php_req, &php_rem)) {
4619 RETURN_TRUE;
4620 } else if (errno == EINTR) {
4621 array_init(return_value);
4622 add_assoc_long_ex(return_value, "seconds", sizeof("seconds")-1, php_rem.tv_sec);
4623 add_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds")-1, php_rem.tv_nsec);
4624 return;
4625 } else if (errno == EINVAL) {
4626 php_error_docref(NULL, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative");
4627 }
4628
4629 RETURN_FALSE;
4630 }
4631 /* }}} */
4632
4633 /* {{{ proto mixed time_sleep_until(float timestamp)
4634 Make the script sleep until the specified time */
4635 PHP_FUNCTION(time_sleep_until)
4636 {
4637 double target_secs;
4638 struct timeval tm;
4639 struct timespec php_req, php_rem;
4640 uint64_t current_ns, target_ns, diff_ns;
4641 const uint64_t ns_per_sec = 1000000000;
4642
4643 ZEND_PARSE_PARAMETERS_START(1, 1)
4644 Z_PARAM_DOUBLE(target_secs)
4645 ZEND_PARSE_PARAMETERS_END();
4646
4647 if (gettimeofday((struct timeval *) &tm, NULL) != 0) {
4648 RETURN_FALSE;
4649 }
4650
4651 target_ns = (uint64_t) (target_secs * ns_per_sec);
4652 current_ns = ((uint64_t) tm.tv_sec) * ns_per_sec + ((uint64_t) tm.tv_usec) * 1000;
4653 if (target_ns < current_ns) {
4654 php_error_docref(NULL, E_WARNING, "Sleep until to time is less than current time");
4655 RETURN_FALSE;
4656 }
4657
4658 diff_ns = target_ns - current_ns;
4659 php_req.tv_sec = (time_t) (diff_ns / ns_per_sec);
4660 php_req.tv_nsec = (long) (diff_ns % ns_per_sec);
4661
4662 while (nanosleep(&php_req, &php_rem)) {
4663 if (errno == EINTR) {
4664 php_req.tv_sec = php_rem.tv_sec;
4665 php_req.tv_nsec = php_rem.tv_nsec;
4666 } else {
4667 RETURN_FALSE;
4668 }
4669 }
4670
4671 RETURN_TRUE;
4672 }
4673 /* }}} */
4674 #endif
4675
4676 /* {{{ proto string get_current_user(void)
4677 Get the name of the owner of the current PHP script */
4678 PHP_FUNCTION(get_current_user)
4679 {
4680 if (zend_parse_parameters_none() == FAILURE) {
4681 return;
4682 }
4683
4684 RETURN_STRING(php_get_current_user());
4685 }
4686 /* }}} */
4687
4688 static void add_config_entries(HashTable *hash, zval *return_value);
4689
4690 /* {{{ add_config_entry
4691 */
4692 static void add_config_entry(zend_ulong h, zend_string *key, zval *entry, zval *retval)
4693 {
4694 if (Z_TYPE_P(entry) == IS_STRING) {
4695 zend_string *str = Z_STR_P(entry);
4696 if (!ZSTR_IS_INTERNED(str)) {
4697 if (!(GC_FLAGS(str) & GC_PERSISTENT)) {
4698 zend_string_addref(str);
4699 } else {
4700 str = zend_string_init(ZSTR_VAL(str), ZSTR_LEN(str), 0);
4701 }
4702 }
4703
4704 if (key) {
4705 add_assoc_str_ex(retval, ZSTR_VAL(key), ZSTR_LEN(key), str);
4706 } else {
4707 add_index_str(retval, h, str);
4708 }
4709 } else if (Z_TYPE_P(entry) == IS_ARRAY) {
4710 zval tmp;
4711 array_init(&tmp);
4712 add_config_entries(Z_ARRVAL_P(entry), &tmp);
4713 zend_hash_update(Z_ARRVAL_P(retval), key, &tmp);
4714 }
4715 }
4716 /* }}} */
4717
4718 /* {{{ add_config_entries
4719 */
4720 static void add_config_entries(HashTable *hash, zval *return_value) /* {{{ */
4721 {
4722 zend_ulong h;
4723 zend_string *key;
4724 zval *zv;
4725
4726 ZEND_HASH_FOREACH_KEY_VAL(hash, h, key, zv)
4727 add_config_entry(h, key, zv, return_value);
4728 ZEND_HASH_FOREACH_END();
4729 }
4730 /* }}} */
4731
4732 /* {{{ proto mixed get_cfg_var(string option_name)
4733 Get the value of a PHP configuration option */
4734 PHP_FUNCTION(get_cfg_var)
4735 {
4736 char *varname;
4737 size_t varname_len;
4738 zval *retval;
4739
4740 ZEND_PARSE_PARAMETERS_START(1, 1)
4741 Z_PARAM_STRING(varname, varname_len)
4742 ZEND_PARSE_PARAMETERS_END();
4743
4744 retval = cfg_get_entry(varname, (uint32_t)varname_len);
4745
4746 if (retval) {
4747 if (Z_TYPE_P(retval) == IS_ARRAY) {
4748 array_init(return_value);
4749 add_config_entries(Z_ARRVAL_P(retval), return_value);
4750 return;
4751 } else {
4752 RETURN_STRING(Z_STRVAL_P(retval));
4753 }
4754 } else {
4755 RETURN_FALSE;
4756 }
4757 }
4758 /* }}} */
4759
4760 /* {{{ proto int get_magic_quotes_runtime(void)
4761 Get the current active configuration setting of magic_quotes_runtime */
4762 PHP_FUNCTION(get_magic_quotes_runtime)
4763 {
4764 if (zend_parse_parameters_none() == FAILURE) {
4765 return;
4766 }
4767 RETURN_FALSE;
4768 }
4769 /* }}} */
4770
4771 /* {{{ proto int get_magic_quotes_gpc(void)
4772 Get the current active configuration setting of magic_quotes_gpc */
4773 PHP_FUNCTION(get_magic_quotes_gpc)
4774 {
4775 if (zend_parse_parameters_none() == FAILURE) {
4776 return;
4777 }
4778 RETURN_FALSE;
4779 }
4780 /* }}} */
4781
4782 /*
4783 1st arg = error message
4784 2nd arg = error option
4785 3rd arg = optional parameters (email address or tcp address)
4786 4th arg = used for additional headers if email
4787
4788 error options:
4789 0 = send to php_error_log (uses syslog or file depending on ini setting)
4790 1 = send via email to 3rd parameter 4th option = additional headers
4791 2 = send via tcp/ip to 3rd parameter (name or ip:port)
4792 3 = save to file in 3rd parameter
4793 4 = send to SAPI logger directly
4794 */
4795
4796 /* {{{ proto bool error_log(string message [, int message_type [, string destination [, string extra_headers]]])
4797 Send an error message somewhere */
4798 PHP_FUNCTION(error_log)
4799 {
4800 char *message, *opt = NULL, *headers = NULL;
4801 size_t message_len, opt_len = 0, headers_len = 0;
4802 int opt_err = 0, argc = ZEND_NUM_ARGS();
4803 zend_long erropt = 0;
4804
4805 ZEND_PARSE_PARAMETERS_START(1, 4)
4806 Z_PARAM_STRING(message, message_len)
4807 Z_PARAM_OPTIONAL
4808 Z_PARAM_LONG(erropt)
4809 Z_PARAM_PATH(opt, opt_len)
4810 Z_PARAM_STRING(headers, headers_len)
4811 ZEND_PARSE_PARAMETERS_END();
4812
4813 if (argc > 1) {
4814 opt_err = (int)erropt;
4815 }
4816
4817 if (_php_error_log_ex(opt_err, message, message_len, opt, headers) == FAILURE) {
4818 RETURN_FALSE;
4819 }
4820
4821 RETURN_TRUE;
4822 }
4823 /* }}} */
4824
4825 /* For BC (not binary-safe!) */
4826 PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers) /* {{{ */
4827 {
4828 return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers);
4829 }
4830 /* }}} */
4831
4832 PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers) /* {{{ */
4833 {
4834 php_stream *stream = NULL;
4835 size_t nbytes;
4836
4837 switch (opt_err)
4838 {
4839 case 1: /*send an email */
4840 if (!php_mail(opt, "PHP error_log message", message, headers, NULL)) {
4841 return FAILURE;
4842 }
4843 break;
4844
4845 case 2: /*send to an address */
4846 php_error_docref(NULL, E_WARNING, "TCP/IP option not available!");
4847 return FAILURE;
4848 break;
4849
4850 case 3: /*save to a file */
4851 stream = php_stream_open_wrapper(opt, "a", IGNORE_URL_WIN | REPORT_ERRORS, NULL);
4852 if (!stream) {
4853 return FAILURE;
4854 }
4855 nbytes = php_stream_write(stream, message, message_len);
4856 php_stream_close(stream);
4857 if (nbytes != message_len) {
4858 return FAILURE;
4859 }
4860 break;
4861
4862 case 4: /* send to SAPI */
4863 if (sapi_module.log_message) {
4864 sapi_module.log_message(message, -1);
4865 } else {
4866 return FAILURE;
4867 }
4868 break;
4869
4870 default:
4871 php_log_err_with_severity(message, LOG_NOTICE);
4872 break;
4873 }
4874 return SUCCESS;
4875 }
4876 /* }}} */
4877
4878 /* {{{ proto array error_get_last()
4879 Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet. */
4880 PHP_FUNCTION(error_get_last)
4881 {
4882 if (zend_parse_parameters_none() == FAILURE) {
4883 return;
4884 }
4885
4886 if (PG(last_error_message)) {
4887 array_init(return_value);
4888 add_assoc_long_ex(return_value, "type", sizeof("type")-1, PG(last_error_type));
4889 add_assoc_string_ex(return_value, "message", sizeof("message")-1, PG(last_error_message));
4890 add_assoc_string_ex(return_value, "file", sizeof("file")-1, PG(last_error_file)?PG(last_error_file):"-");
4891 add_assoc_long_ex(return_value, "line", sizeof("line")-1, PG(last_error_lineno));
4892 }
4893 }
4894 /* }}} */
4895
4896 /* {{{ proto void error_clear_last(void)
4897 Clear the last occurred error. */
4898 PHP_FUNCTION(error_clear_last)
4899 {
4900 if (zend_parse_parameters_none() == FAILURE) {
4901 return;
4902 }
4903
4904 if (PG(last_error_message)) {
4905 PG(last_error_type) = 0;
4906 PG(last_error_lineno) = 0;
4907
4908 free(PG(last_error_message));
4909 PG(last_error_message) = NULL;
4910
4911 if (PG(last_error_file)) {
4912 free(PG(last_error_file));
4913 PG(last_error_file) = NULL;
4914 }
4915 }
4916 }
4917 /* }}} */
4918
4919 /* {{{ proto mixed call_user_func(mixed function_name [, mixed parameter] [, mixed ...])
4920 Call a user function which is the first parameter
4921 Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
4922 PHP_FUNCTION(call_user_func)
4923 {
4924 zval retval;
4925 zend_fcall_info fci;
4926 zend_fcall_info_cache fci_cache;
4927
4928 ZEND_PARSE_PARAMETERS_START(1, -1)
4929 Z_PARAM_FUNC(fci, fci_cache)
4930 Z_PARAM_VARIADIC('*', fci.params, fci.param_count)
4931 ZEND_PARSE_PARAMETERS_END();
4932
4933 fci.retval = &retval;
4934
4935 if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
4936 if (Z_ISREF(retval)) {
4937 zend_unwrap_reference(&retval);
4938 }
4939 ZVAL_COPY_VALUE(return_value, &retval);
4940 }
4941 }
4942 /* }}} */
4943
4944 /* {{{ proto mixed call_user_func_array(string function_name, array parameters)
4945 Call a user function which is the first parameter with the arguments contained in array
4946 Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
4947 PHP_FUNCTION(call_user_func_array)
4948 {
4949 zval *params, retval;
4950 zend_fcall_info fci;
4951 zend_fcall_info_cache fci_cache;
4952
4953 ZEND_PARSE_PARAMETERS_START(2, 2)
4954 Z_PARAM_FUNC(fci, fci_cache)
4955 Z_PARAM_ARRAY(params)
4956 ZEND_PARSE_PARAMETERS_END();
4957
4958 zend_fcall_info_args(&fci, params);
4959 fci.retval = &retval;
4960
4961 if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
4962 if (Z_ISREF(retval)) {
4963 zend_unwrap_reference(&retval);
4964 }
4965 ZVAL_COPY_VALUE(return_value, &retval);
4966 }
4967
4968 zend_fcall_info_args_clear(&fci, 1);
4969 }
4970 /* }}} */
4971
4972 /* {{{ proto mixed forward_static_call(mixed function_name [, mixed parameter] [, mixed ...]) U
4973 Call a user function which is the first parameter */
4974 PHP_FUNCTION(forward_static_call)
4975 {
4976 zval retval;
4977 zend_fcall_info fci;
4978 zend_fcall_info_cache fci_cache;
4979 zend_class_entry *called_scope;
4980
4981 ZEND_PARSE_PARAMETERS_START(1, -1)
4982 Z_PARAM_FUNC(fci, fci_cache)
4983 Z_PARAM_VARIADIC('*', fci.params, fci.param_count)
4984 ZEND_PARSE_PARAMETERS_END();
4985
4986 if (!EX(prev_execute_data)->func->common.scope) {
4987 zend_throw_error(NULL, "Cannot call forward_static_call() when no class scope is active");
4988 return;
4989 }
4990
4991 fci.retval = &retval;
4992
4993 called_scope = zend_get_called_scope(execute_data);
4994 if (called_scope && fci_cache.calling_scope &&
4995 instanceof_function(called_scope, fci_cache.calling_scope)) {
4996 fci_cache.called_scope = called_scope;
4997 }
4998
4999 if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
5000 if (Z_ISREF(retval)) {
5001 zend_unwrap_reference(&retval);
5002 }
5003 ZVAL_COPY_VALUE(return_value, &retval);
5004 }
5005 }
5006 /* }}} */
5007
5008 /* {{{ proto mixed call_user_func_array(string function_name, array parameters) U
5009 Call a user function which is the first parameter with the arguments contained in array */
5010 PHP_FUNCTION(forward_static_call_array)
5011 {
5012 zval *params, retval;
5013 zend_fcall_info fci;
5014 zend_fcall_info_cache fci_cache;
5015 zend_class_entry *called_scope;
5016
5017 ZEND_PARSE_PARAMETERS_START(2, 2)
5018 Z_PARAM_FUNC(fci, fci_cache)
5019 Z_PARAM_ARRAY(params)
5020 ZEND_PARSE_PARAMETERS_END();
5021
5022 zend_fcall_info_args(&fci, params);
5023 fci.retval = &retval;
5024
5025 called_scope = zend_get_called_scope(execute_data);
5026 if (called_scope && fci_cache.calling_scope &&
5027 instanceof_function(called_scope, fci_cache.calling_scope)) {
5028 fci_cache.called_scope = called_scope;
5029 }
5030
5031 if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
5032 if (Z_ISREF(retval)) {
5033 zend_unwrap_reference(&retval);
5034 }
5035 ZVAL_COPY_VALUE(return_value, &retval);
5036 }
5037
5038 zend_fcall_info_args_clear(&fci, 1);
5039 }
5040 /* }}} */
5041
5042 void user_shutdown_function_dtor(zval *zv) /* {{{ */
5043 {
5044 int i;
5045 php_shutdown_function_entry *shutdown_function_entry = Z_PTR_P(zv);
5046
5047 for (i = 0; i < shutdown_function_entry->arg_count; i++) {
5048 zval_ptr_dtor(&shutdown_function_entry->arguments[i]);
5049 }
5050 efree(shutdown_function_entry->arguments);
5051 efree(shutdown_function_entry);
5052 }
5053 /* }}} */
5054
5055 void user_tick_function_dtor(user_tick_function_entry *tick_function_entry) /* {{{ */
5056 {
5057 int i;
5058
5059 for (i = 0; i < tick_function_entry->arg_count; i++) {
5060 zval_ptr_dtor(&tick_function_entry->arguments[i]);
5061 }
5062 efree(tick_function_entry->arguments);
5063 }
5064 /* }}} */
5065
5066 static int user_shutdown_function_call(zval *zv) /* {{{ */
5067 {
5068 php_shutdown_function_entry *shutdown_function_entry = Z_PTR_P(zv);
5069 zval retval;
5070
5071 if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, NULL)) {
5072 zend_string *function_name
5073 = zend_get_callable_name(&shutdown_function_entry->arguments[0]);
5074 php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", ZSTR_VAL(function_name));
5075 zend_string_release_ex(function_name, 0);
5076 return 0;
5077 }
5078
5079 if (call_user_function(NULL, NULL,
5080 &shutdown_function_entry->arguments[0],
5081 &retval,
5082 shutdown_function_entry->arg_count - 1,
5083 shutdown_function_entry->arguments + 1) == SUCCESS)
5084 {
5085 zval_ptr_dtor(&retval);
5086 }
5087 return 0;
5088 }
5089 /* }}} */
5090
5091 static void user_tick_function_call(user_tick_function_entry *tick_fe) /* {{{ */
5092 {
5093 zval retval;
5094 zval *function = &tick_fe->arguments[0];
5095
5096 /* Prevent reentrant calls to the same user ticks function */
5097 if (! tick_fe->calling) {
5098 tick_fe->calling = 1;
5099
5100 if (call_user_function(NULL, NULL,
5101 function,
5102 &retval,
5103 tick_fe->arg_count - 1,
5104 tick_fe->arguments + 1
5105 ) == SUCCESS) {
5106 zval_ptr_dtor(&retval);
5107
5108 } else {
5109 zval *obj, *method;
5110
5111 if (Z_TYPE_P(function) == IS_STRING) {
5112 php_error_docref(NULL, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function));
5113 } else if ( Z_TYPE_P(function) == IS_ARRAY
5114 && (obj = zend_hash_index_find(Z_ARRVAL_P(function), 0)) != NULL
5115 && (method = zend_hash_index_find(Z_ARRVAL_P(function), 1)) != NULL
5116 && Z_TYPE_P(obj) == IS_OBJECT
5117 && Z_TYPE_P(method) == IS_STRING) {
5118 php_error_docref(NULL, E_WARNING, "Unable to call %s::%s() - function does not exist", ZSTR_VAL(Z_OBJCE_P(obj)->name), Z_STRVAL_P(method));
5119 } else {
5120 php_error_docref(NULL, E_WARNING, "Unable to call tick function");
5121 }
5122 }
5123
5124 tick_fe->calling = 0;
5125 }
5126 }
5127 /* }}} */
5128
5129 static void run_user_tick_functions(int tick_count, void *arg) /* {{{ */
5130 {
5131 zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call);
5132 }
5133 /* }}} */
5134
5135 static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_tick_function_entry * tick_fe2) /* {{{ */
5136 {
5137 zval *func1 = &tick_fe1->arguments[0];
5138 zval *func2 = &tick_fe2->arguments[0];
5139 int ret;
5140
5141 if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) {
5142 ret = zend_binary_zval_strcmp(func1, func2) == 0;
5143 } else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) {
5144 ret = zend_compare_arrays(func1, func2) == 0;
5145 } else if (Z_TYPE_P(func1) == IS_OBJECT && Z_TYPE_P(func2) == IS_OBJECT) {
5146 ret = zend_compare_objects(func1, func2) == 0;
5147 } else {
5148 ret = 0;
5149 }
5150
5151 if (ret && tick_fe1->calling) {
5152 php_error_docref(NULL, E_WARNING, "Unable to delete tick function executed at the moment");
5153 return 0;
5154 }
5155 return ret;
5156 }
5157 /* }}} */
5158
5159 PHPAPI void php_call_shutdown_functions(void) /* {{{ */
5160 {
5161 if (BG(user_shutdown_function_names)) {
5162 zend_try {
5163 zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call);
5164 }
5165 zend_end_try();
5166 }
5167 }
5168 /* }}} */
5169
5170 PHPAPI void php_free_shutdown_functions(void) /* {{{ */
5171 {
5172 if (BG(user_shutdown_function_names))
5173 zend_try {
5174 zend_hash_destroy(BG(user_shutdown_function_names));
5175 FREE_HASHTABLE(BG(user_shutdown_function_names));
5176 BG(user_shutdown_function_names) = NULL;
5177 } zend_catch {
5178 /* maybe shutdown method call exit, we just ignore it */
5179 FREE_HASHTABLE(BG(user_shutdown_function_names));
5180 BG(user_shutdown_function_names) = NULL;
5181 } zend_end_try();
5182 }
5183 /* }}} */
5184
5185 /* {{{ proto void register_shutdown_function(callback function) U
5186 Register a user-level function to be called on request termination */
5187 PHP_FUNCTION(register_shutdown_function)
5188 {
5189 php_shutdown_function_entry shutdown_function_entry;
5190 int i;
5191
5192 shutdown_function_entry.arg_count = ZEND_NUM_ARGS();
5193
5194 if (shutdown_function_entry.arg_count < 1) {
5195 WRONG_PARAM_COUNT;
5196 }
5197
5198 shutdown_function_entry.arguments = (zval *) safe_emalloc(sizeof(zval), shutdown_function_entry.arg_count, 0);
5199
5200 if (zend_get_parameters_array(ZEND_NUM_ARGS(), shutdown_function_entry.arg_count, shutdown_function_entry.arguments) == FAILURE) {
5201 efree(shutdown_function_entry.arguments);
5202 RETURN_FALSE;
5203 }
5204
5205 /* Prevent entering of anything but valid callback (syntax check only!) */
5206 if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, NULL)) {
5207 zend_string *callback_name
5208 = zend_get_callable_name(&shutdown_function_entry.arguments[0]);
5209 php_error_docref(NULL, E_WARNING, "Invalid shutdown callback '%s' passed", ZSTR_VAL(callback_name));
5210 efree(shutdown_function_entry.arguments);
5211 zend_string_release_ex(callback_name, 0);
5212 RETVAL_FALSE;
5213 } else {
5214 if (!BG(user_shutdown_function_names)) {
5215 ALLOC_HASHTABLE(BG(user_shutdown_function_names));
5216 zend_hash_init(BG(user_shutdown_function_names), 0, NULL, user_shutdown_function_dtor, 0);
5217 }
5218
5219 for (i = 0; i < shutdown_function_entry.arg_count; i++) {
5220 Z_TRY_ADDREF(shutdown_function_entry.arguments[i]);
5221 }
5222 zend_hash_next_index_insert_mem(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry));
5223 }
5224 }
5225 /* }}} */
5226
5227 PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry) /* {{{ */
5228 {
5229 if (!BG(user_shutdown_function_names)) {
5230 ALLOC_HASHTABLE(BG(user_shutdown_function_names));
5231 zend_hash_init(BG(user_shutdown_function_names), 0, NULL, user_shutdown_function_dtor, 0);
5232 }
5233
5234 zend_hash_str_update_mem(BG(user_shutdown_function_names), function_name, function_len, shutdown_function_entry, sizeof(php_shutdown_function_entry));
5235 return 1;
5236 }
5237 /* }}} */
5238
5239 PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t function_len) /* {{{ */
5240 {
5241 if (BG(user_shutdown_function_names)) {
5242 return zend_hash_str_del(BG(user_shutdown_function_names), function_name, function_len) != FAILURE;
5243 }
5244
5245 return 0;
5246 }
5247 /* }}} */
5248
5249 PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry) /* {{{ */
5250 {
5251 if (!BG(user_shutdown_function_names)) {
5252 ALLOC_HASHTABLE(BG(user_shutdown_function_names));
5253 zend_hash_init(BG(user_shutdown_function_names), 0, NULL, user_shutdown_function_dtor, 0);
5254 }
5255
5256 return zend_hash_next_index_insert_mem(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry)) != NULL;
5257 }
5258 /* }}} */
5259
5260 ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini) /* {{{ */
5261 {
5262 syntax_highlighter_ini->highlight_comment = INI_STR("highlight.comment");
5263 syntax_highlighter_ini->highlight_default = INI_STR("highlight.default");
5264 syntax_highlighter_ini->highlight_html = INI_STR("highlight.html");
5265 syntax_highlighter_ini->highlight_keyword = INI_STR("highlight.keyword");
5266 syntax_highlighter_ini->highlight_string = INI_STR("highlight.string");
5267 }
5268 /* }}} */
5269
5270 /* {{{ proto bool highlight_file(string file_name [, bool return] )
5271 Syntax highlight a source file */
5272 PHP_FUNCTION(highlight_file)
5273 {
5274 char *filename;
5275 size_t filename_len;
5276 int ret;
5277 zend_syntax_highlighter_ini syntax_highlighter_ini;
5278 zend_bool i = 0;
5279
5280 ZEND_PARSE_PARAMETERS_START(1, 2)
5281 Z_PARAM_PATH(filename, filename_len)
5282 Z_PARAM_OPTIONAL
5283 Z_PARAM_BOOL(i)
5284 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
5285
5286 if (php_check_open_basedir(filename)) {
5287 RETURN_FALSE;
5288 }
5289
5290 if (i) {
5291 php_output_start_default();
5292 }
5293
5294 php_get_highlight_struct(&syntax_highlighter_ini);
5295
5296 ret = highlight_file(filename, &syntax_highlighter_ini);
5297
5298 if (ret == FAILURE) {
5299 if (i) {
5300 php_output_end();
5301 }
5302 RETURN_FALSE;
5303 }
5304
5305 if (i) {
5306 php_output_get_contents(return_value);
5307 php_output_discard();
5308 } else {
5309 RETURN_TRUE;
5310 }
5311 }
5312 /* }}} */
5313
5314 /* {{{ proto string php_strip_whitespace(string file_name)
5315 Return source with stripped comments and whitespace */
5316 PHP_FUNCTION(php_strip_whitespace)
5317 {
5318 char *filename;
5319 size_t filename_len;
5320 zend_lex_state original_lex_state;
5321 zend_file_handle file_handle;
5322
5323 ZEND_PARSE_PARAMETERS_START(1, 1)
5324 Z_PARAM_PATH(filename, filename_len)
5325 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
5326
5327 php_output_start_default();
5328
5329 zend_stream_init_filename(&file_handle, filename);
5330 zend_save_lexical_state(&original_lex_state);
5331 if (open_file_for_scanning(&file_handle) == FAILURE) {
5332 zend_restore_lexical_state(&original_lex_state);
5333 php_output_end();
5334 RETURN_EMPTY_STRING();
5335 }
5336
5337 zend_strip();
5338
5339 zend_destroy_file_handle(&file_handle);
5340 zend_restore_lexical_state(&original_lex_state);
5341
5342 php_output_get_contents(return_value);
5343 php_output_discard();
5344 }
5345 /* }}} */
5346
5347 /* {{{ proto bool highlight_string(string string [, bool return] )
5348 Syntax highlight a string or optionally return it */
5349 PHP_FUNCTION(highlight_string)
5350 {
5351 zval *expr;
5352 zend_syntax_highlighter_ini syntax_highlighter_ini;
5353 char *hicompiled_string_description;
5354 zend_bool i = 0;
5355 int old_error_reporting = EG(error_reporting);
5356
5357 ZEND_PARSE_PARAMETERS_START(1, 2)
5358 Z_PARAM_ZVAL(expr)
5359 Z_PARAM_OPTIONAL
5360 Z_PARAM_BOOL(i)
5361 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
5362
5363 if (!try_convert_to_string(expr)) {
5364 return;
5365 }
5366
5367 if (i) {
5368 php_output_start_default();
5369 }
5370
5371 EG(error_reporting) = E_ERROR;
5372
5373 php_get_highlight_struct(&syntax_highlighter_ini);
5374
5375 hicompiled_string_description = zend_make_compiled_string_description("highlighted code");
5376
5377 if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description) == FAILURE) {
5378 efree(hicompiled_string_description);
5379 EG(error_reporting) = old_error_reporting;
5380 if (i) {
5381 php_output_end();
5382 }
5383 RETURN_FALSE;
5384 }
5385 efree(hicompiled_string_description);
5386
5387 EG(error_reporting) = old_error_reporting;
5388
5389 if (i) {
5390 php_output_get_contents(return_value);
5391 php_output_discard();
5392 } else {
5393 RETURN_TRUE;
5394 }
5395 }
5396 /* }}} */
5397
5398 /* {{{ proto string ini_get(string varname)
5399 Get a configuration option */
5400 PHP_FUNCTION(ini_get)
5401 {
5402 zend_string *varname, *val;
5403
5404 ZEND_PARSE_PARAMETERS_START(1, 1)
5405 Z_PARAM_STR(varname)
5406 ZEND_PARSE_PARAMETERS_END();
5407
5408 val = zend_ini_get_value(varname);
5409
5410 if (!val) {
5411 RETURN_FALSE;
5412 }
5413
5414 if (ZSTR_IS_INTERNED(val)) {
5415 RETVAL_INTERNED_STR(val);
5416 } else if (ZSTR_LEN(val) == 0) {
5417 RETVAL_EMPTY_STRING();
5418 } else if (ZSTR_LEN(val) == 1) {
5419 RETVAL_INTERNED_STR(ZSTR_CHAR((zend_uchar)ZSTR_VAL(val)[0]));
5420 } else if (!(GC_FLAGS(val) & GC_PERSISTENT)) {
5421 ZVAL_NEW_STR(return_value, zend_string_copy(val));
5422 } else {
5423 ZVAL_NEW_STR(return_value, zend_string_init(ZSTR_VAL(val), ZSTR_LEN(val), 0));
5424 }
5425 }
5426 /* }}} */
5427
5428 /* {{{ proto array ini_get_all([string extension[, bool details = true]])
5429 Get all configuration options */
5430 PHP_FUNCTION(ini_get_all)
5431 {
5432 char *extname = NULL;
5433 size_t extname_len = 0, module_number = 0;
5434 zend_module_entry *module;
5435 zend_bool details = 1;
5436 zend_string *key;
5437 zend_ini_entry *ini_entry;
5438
5439
5440 ZEND_PARSE_PARAMETERS_START(0, 2)
5441 Z_PARAM_OPTIONAL
5442 Z_PARAM_STRING_EX(extname, extname_len, 1, 0)
5443 Z_PARAM_BOOL(details)
5444 ZEND_PARSE_PARAMETERS_END();
5445
5446 zend_ini_sort_entries();
5447
5448 if (extname) {
5449 if ((module = zend_hash_str_find_ptr(&module_registry, extname, extname_len)) == NULL) {
5450 php_error_docref(NULL, E_WARNING, "Unable to find extension '%s'", extname);
5451 RETURN_FALSE;
5452 }
5453 module_number = module->module_number;
5454 }
5455
5456 array_init(return_value);
5457 ZEND_HASH_FOREACH_STR_KEY_PTR(EG(ini_directives), key, ini_entry) {
5458 zval option;
5459
5460 if (module_number != 0 && ini_entry->module_number != module_number) {
5461 continue;
5462 }
5463
5464 if (key == NULL || ZSTR_VAL(key)[0] != 0) {
5465 if (details) {
5466 array_init(&option);
5467
5468 if (ini_entry->orig_value) {
5469 add_assoc_str(&option, "global_value", zend_string_copy(ini_entry->orig_value));
5470 } else if (ini_entry->value) {
5471 add_assoc_str(&option, "global_value", zend_string_copy(ini_entry->value));
5472 } else {
5473 add_assoc_null(&option, "global_value");
5474 }
5475
5476 if (ini_entry->value) {
5477 add_assoc_str(&option, "local_value", zend_string_copy(ini_entry->value));
5478 } else {
5479 add_assoc_null(&option, "local_value");
5480 }
5481
5482 add_assoc_long(&option, "access", ini_entry->modifiable);
5483
5484 zend_symtable_update(Z_ARRVAL_P(return_value), ini_entry->name, &option);
5485 } else {
5486 if (ini_entry->value) {
5487 zval zv;
5488
5489 ZVAL_STR_COPY(&zv, ini_entry->value);
5490 zend_symtable_update(Z_ARRVAL_P(return_value), ini_entry->name, &zv);
5491 } else {
5492 zend_symtable_update(Z_ARRVAL_P(return_value), ini_entry->name, &EG(uninitialized_zval));
5493 }
5494 }
5495 }
5496 } ZEND_HASH_FOREACH_END();
5497 }
5498 /* }}} */
5499
5500 static int php_ini_check_path(char *option_name, size_t option_len, char *new_option_name, size_t new_option_len) /* {{{ */
5501 {
5502 if (option_len + 1 != new_option_len) {
5503 return 0;
5504 }
5505
5506 return !strncmp(option_name, new_option_name, option_len);
5507 }
5508 /* }}} */
5509
5510 /* {{{ proto string ini_set(string varname, string newvalue)
5511 Set a configuration option, returns false on error and the old value of the configuration option on success */
5512 PHP_FUNCTION(ini_set)
5513 {
5514 zend_string *varname;
5515 zend_string *new_value;
5516 zend_string *val;
5517
5518 ZEND_PARSE_PARAMETERS_START(2, 2)
5519 Z_PARAM_STR(varname)
5520 Z_PARAM_STR(new_value)
5521 ZEND_PARSE_PARAMETERS_END();
5522
5523 val = zend_ini_get_value(varname);
5524
5525 /* copy to return here, because alter might free it! */
5526 if (val) {
5527 if (ZSTR_IS_INTERNED(val)) {
5528 RETVAL_INTERNED_STR(val);
5529 } else if (ZSTR_LEN(val) == 0) {
5530 RETVAL_EMPTY_STRING();
5531 } else if (ZSTR_LEN(val) == 1) {
5532 RETVAL_INTERNED_STR(ZSTR_CHAR((zend_uchar)ZSTR_VAL(val)[0]));
5533 } else if (!(GC_FLAGS(val) & GC_PERSISTENT)) {
5534 ZVAL_NEW_STR(return_value, zend_string_copy(val));
5535 } else {
5536 ZVAL_NEW_STR(return_value, zend_string_init(ZSTR_VAL(val), ZSTR_LEN(val), 0));
5537 }
5538 } else {
5539 RETVAL_FALSE;
5540 }
5541
5542 #define _CHECK_PATH(var, var_len, ini) php_ini_check_path(var, var_len, ini, sizeof(ini))
5543 /* open basedir check */
5544 if (PG(open_basedir)) {
5545 if (_CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "error_log") ||
5546 _CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "java.class.path") ||
5547 _CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "java.home") ||
5548 _CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "mail.log") ||
5549 _CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "java.library.path") ||
5550 _CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "vpopmail.directory")) {
5551 if (php_check_open_basedir(ZSTR_VAL(new_value))) {
5552 zval_ptr_dtor_str(return_value);
5553 RETURN_FALSE;
5554 }
5555 }
5556 }
5557 #undef _CHECK_PATH
5558
5559 if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
5560 zval_ptr_dtor_str(return_value);
5561 RETURN_FALSE;
5562 }
5563 }
5564 /* }}} */
5565
5566 /* {{{ proto void ini_restore(string varname)
5567 Restore the value of a configuration option specified by varname */
5568 PHP_FUNCTION(ini_restore)
5569 {
5570 zend_string *varname;
5571
5572 ZEND_PARSE_PARAMETERS_START(1, 1)
5573 Z_PARAM_STR(varname)
5574 ZEND_PARSE_PARAMETERS_END();
5575
5576 zend_restore_ini_entry(varname, PHP_INI_STAGE_RUNTIME);
5577 }
5578 /* }}} */
5579
5580 /* {{{ proto string set_include_path(string new_include_path)
5581 Sets the include_path configuration option */
5582 PHP_FUNCTION(set_include_path)
5583 {
5584 zend_string *new_value;
5585 char *old_value;
5586 zend_string *key;
5587
5588 ZEND_PARSE_PARAMETERS_START(1, 1)
5589 Z_PARAM_PATH_STR(new_value)
5590 ZEND_PARSE_PARAMETERS_END();
5591
5592 old_value = zend_ini_string("include_path", sizeof("include_path") - 1, 0);
5593 /* copy to return here, because alter might free it! */
5594 if (old_value) {
5595 RETVAL_STRING(old_value);
5596 } else {
5597 RETVAL_FALSE;
5598 }
5599
5600 key = zend_string_init("include_path", sizeof("include_path") - 1, 0);
5601 if (zend_alter_ini_entry_ex(key, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
5602 zend_string_release_ex(key, 0);
5603 zval_ptr_dtor_str(return_value);
5604 RETURN_FALSE;
5605 }
5606 zend_string_release_ex(key, 0);
5607 }
5608 /* }}} */
5609
5610 /* {{{ proto string get_include_path()
5611 Get the current include_path configuration option */
5612 PHP_FUNCTION(get_include_path)
5613 {
5614 char *str;
5615
5616 if (zend_parse_parameters_none() == FAILURE) {
5617 return;
5618 }
5619
5620 str = zend_ini_string("include_path", sizeof("include_path") - 1, 0);
5621
5622 if (str == NULL) {
5623 RETURN_FALSE;
5624 }
5625
5626 RETURN_STRING(str);
5627 }
5628 /* }}} */
5629
5630 /* {{{ proto void restore_include_path()
5631 Restore the value of the include_path configuration option */
5632 PHP_FUNCTION(restore_include_path)
5633 {
5634 zend_string *key;
5635
5636 if (zend_parse_parameters_none() == FAILURE) {
5637 return;
5638 }
5639 key = zend_string_init("include_path", sizeof("include_path")-1, 0);
5640 zend_restore_ini_entry(key, PHP_INI_STAGE_RUNTIME);
5641 zend_string_efree(key);
5642 }
5643 /* }}} */
5644
5645 /* {{{ proto mixed print_r(mixed var [, bool return])
5646 Prints out or returns information about the specified variable */
5647 PHP_FUNCTION(print_r)
5648 {
5649 zval *var;
5650 zend_bool do_return = 0;
5651
5652 ZEND_PARSE_PARAMETERS_START(1, 2)
5653 Z_PARAM_ZVAL(var)
5654 Z_PARAM_OPTIONAL
5655 Z_PARAM_BOOL(do_return)
5656 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
5657
5658 if (do_return) {
5659 RETURN_STR(zend_print_zval_r_to_str(var, 0));
5660 } else {
5661 zend_print_zval_r(var, 0);
5662 RETURN_TRUE;
5663 }
5664 }
5665 /* }}} */
5666
5667 /* {{{ proto int connection_aborted(void)
5668 Returns true if client disconnected */
5669 PHP_FUNCTION(connection_aborted)
5670 {
5671 RETURN_LONG(PG(connection_status) & PHP_CONNECTION_ABORTED);
5672 }
5673 /* }}} */
5674
5675 /* {{{ proto int connection_status(void)
5676 Returns the connection status bitfield */
5677 PHP_FUNCTION(connection_status)
5678 {
5679 RETURN_LONG(PG(connection_status));
5680 }
5681 /* }}} */
5682
5683 /* {{{ proto int ignore_user_abort([bool value])
5684 Set whether we want to ignore a user abort event or not */
5685 PHP_FUNCTION(ignore_user_abort)
5686 {
5687 zend_bool arg = 0;
5688 int old_setting;
5689
5690 ZEND_PARSE_PARAMETERS_START(0, 1)
5691 Z_PARAM_OPTIONAL
5692 Z_PARAM_BOOL(arg)
5693 ZEND_PARSE_PARAMETERS_END();
5694
5695 old_setting = (unsigned short)PG(ignore_user_abort);
5696
5697 if (ZEND_NUM_ARGS()) {
5698 zend_string *key = zend_string_init("ignore_user_abort", sizeof("ignore_user_abort") - 1, 0);
5699 zend_alter_ini_entry_chars(key, arg ? "1" : "0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
5700 zend_string_release_ex(key, 0);
5701 }
5702
5703 RETURN_LONG(old_setting);
5704 }
5705 /* }}} */
5706
5707 #if HAVE_GETSERVBYNAME
5708 /* {{{ proto int getservbyname(string service, string protocol)
5709 Returns port associated with service. Protocol must be "tcp" or "udp" */
5710 PHP_FUNCTION(getservbyname)
5711 {
5712 char *name, *proto;
5713 size_t name_len, proto_len;
5714 struct servent *serv;
5715
5716 ZEND_PARSE_PARAMETERS_START(2, 2)
5717 Z_PARAM_STRING(name, name_len)
5718 Z_PARAM_STRING(proto, proto_len)
5719 ZEND_PARSE_PARAMETERS_END();
5720
5721
5722 /* empty string behaves like NULL on windows implementation of
5723 getservbyname. Let be portable instead. */
5724 #ifdef PHP_WIN32
5725 if (proto_len == 0) {
5726 RETURN_FALSE;
5727 }
5728 #endif
5729
5730 serv = getservbyname(name, proto);
5731
5732 #if defined(_AIX)
5733 /*
5734 On AIX, imap is only known as imap2 in /etc/services, while on Linux imap is an alias for imap2.
5735 If a request for imap gives no result, we try again with imap2.
5736 */
5737 if (serv == NULL && strcmp(name, "imap") == 0) {
5738 serv = getservbyname("imap2", proto);
5739 }
5740 #endif
5741 if (serv == NULL) {
5742 RETURN_FALSE;
5743 }
5744
5745 RETURN_LONG(ntohs(serv->s_port));
5746 }
5747 /* }}} */
5748 #endif
5749
5750 #if HAVE_GETSERVBYPORT
5751 /* {{{ proto string getservbyport(int port, string protocol)
5752 Returns service name associated with port. Protocol must be "tcp" or "udp" */
5753 PHP_FUNCTION(getservbyport)
5754 {
5755 char *proto;
5756 size_t proto_len;
5757 zend_long port;
5758 struct servent *serv;
5759
5760 ZEND_PARSE_PARAMETERS_START(2, 2)
5761 Z_PARAM_LONG(port)
5762 Z_PARAM_STRING(proto, proto_len)
5763 ZEND_PARSE_PARAMETERS_END();
5764
5765 serv = getservbyport(htons((unsigned short) port), proto);
5766
5767 if (serv == NULL) {
5768 RETURN_FALSE;
5769 }
5770
5771 RETURN_STRING(serv->s_name);
5772 }
5773 /* }}} */
5774 #endif
5775
5776 #if HAVE_GETPROTOBYNAME
5777 /* {{{ proto int getprotobyname(string name)
5778 Returns protocol number associated with name as per /etc/protocols */
5779 PHP_FUNCTION(getprotobyname)
5780 {
5781 char *name;
5782 size_t name_len;
5783 struct protoent *ent;
5784
5785 ZEND_PARSE_PARAMETERS_START(1, 1)
5786 Z_PARAM_STRING(name, name_len)
5787 ZEND_PARSE_PARAMETERS_END();
5788
5789 ent = getprotobyname(name);
5790
5791 if (ent == NULL) {
5792 RETURN_FALSE;
5793 }
5794
5795 RETURN_LONG(ent->p_proto);
5796 }
5797 /* }}} */
5798 #endif
5799
5800 #if HAVE_GETPROTOBYNUMBER
5801 /* {{{ proto string getprotobynumber(int proto)
5802 Returns protocol name associated with protocol number proto */
5803 PHP_FUNCTION(getprotobynumber)
5804 {
5805 zend_long proto;
5806 struct protoent *ent;
5807
5808 ZEND_PARSE_PARAMETERS_START(1, 1)
5809 Z_PARAM_LONG(proto)
5810 ZEND_PARSE_PARAMETERS_END();
5811
5812 ent = getprotobynumber((int)proto);
5813
5814 if (ent == NULL) {
5815 RETURN_FALSE;
5816 }
5817
5818 RETURN_STRING(ent->p_name);
5819 }
5820 /* }}} */
5821 #endif
5822
5823 /* {{{ proto bool register_tick_function(string function_name [, mixed arg [, mixed ... ]])
5824 Registers a tick callback function */
5825 PHP_FUNCTION(register_tick_function)
5826 {
5827 user_tick_function_entry tick_fe;
5828 int i;
5829 zend_string *function_name = NULL;
5830
5831 tick_fe.calling = 0;
5832 tick_fe.arg_count = ZEND_NUM_ARGS();
5833
5834 if (tick_fe.arg_count < 1) {
5835 WRONG_PARAM_COUNT;
5836 }
5837
5838 tick_fe.arguments = (zval *) safe_emalloc(sizeof(zval), tick_fe.arg_count, 0);
5839
5840 if (zend_get_parameters_array(ZEND_NUM_ARGS(), tick_fe.arg_count, tick_fe.arguments) == FAILURE) {
5841 efree(tick_fe.arguments);
5842 RETURN_FALSE;
5843 }
5844
5845 if (!zend_is_callable(&tick_fe.arguments[0], 0, &function_name)) {
5846 efree(tick_fe.arguments);
5847 php_error_docref(NULL, E_WARNING, "Invalid tick callback '%s' passed", ZSTR_VAL(function_name));
5848 zend_string_release_ex(function_name, 0);
5849 RETURN_FALSE;
5850 } else if (function_name) {
5851 zend_string_release_ex(function_name, 0);
5852 }
5853
5854 if (Z_TYPE(tick_fe.arguments[0]) != IS_ARRAY && Z_TYPE(tick_fe.arguments[0]) != IS_OBJECT) {
5855 convert_to_string_ex(&tick_fe.arguments[0]);
5856 }
5857
5858 if (!BG(user_tick_functions)) {
5859 BG(user_tick_functions) = (zend_llist *) emalloc(sizeof(zend_llist));
5860 zend_llist_init(BG(user_tick_functions),
5861 sizeof(user_tick_function_entry),
5862 (llist_dtor_func_t) user_tick_function_dtor, 0);
5863 php_add_tick_function(run_user_tick_functions, NULL);
5864 }
5865
5866 for (i = 0; i < tick_fe.arg_count; i++) {
5867 Z_TRY_ADDREF(tick_fe.arguments[i]);
5868 }
5869
5870 zend_llist_add_element(BG(user_tick_functions), &tick_fe);
5871
5872 RETURN_TRUE;
5873 }
5874 /* }}} */
5875
5876 /* {{{ proto void unregister_tick_function(string function_name)
5877 Unregisters a tick callback function */
5878 PHP_FUNCTION(unregister_tick_function)
5879 {
5880 zval *function;
5881 user_tick_function_entry tick_fe;
5882
5883 ZEND_PARSE_PARAMETERS_START(1, 1)
5884 Z_PARAM_ZVAL(function)
5885 ZEND_PARSE_PARAMETERS_END();
5886
5887 if (!BG(user_tick_functions)) {
5888 return;
5889 }
5890
5891 if (Z_TYPE_P(function) != IS_ARRAY && Z_TYPE_P(function) != IS_OBJECT) {
5892 convert_to_string(function);
5893 }
5894
5895 tick_fe.arguments = (zval *) emalloc(sizeof(zval));
5896 ZVAL_COPY_VALUE(&tick_fe.arguments[0], function);
5897 tick_fe.arg_count = 1;
5898 zend_llist_del_element(BG(user_tick_functions), &tick_fe, (int (*)(void *, void *)) user_tick_function_compare);
5899 efree(tick_fe.arguments);
5900 }
5901 /* }}} */
5902
5903 /* {{{ proto bool is_uploaded_file(string path)
5904 Check if file was created by rfc1867 upload */
5905 PHP_FUNCTION(is_uploaded_file)
5906 {
5907 char *path;
5908 size_t path_len;
5909
5910 if (!SG(rfc1867_uploaded_files)) {
5911 RETURN_FALSE;
5912 }
5913
5914 ZEND_PARSE_PARAMETERS_START(1, 1)
5915 Z_PARAM_STRING(path, path_len)
5916 ZEND_PARSE_PARAMETERS_END();
5917
5918 if (zend_hash_str_exists(SG(rfc1867_uploaded_files), path, path_len)) {
5919 RETURN_TRUE;
5920 } else {
5921 RETURN_FALSE;
5922 }
5923 }
5924 /* }}} */
5925
5926 /* {{{ proto bool move_uploaded_file(string path, string new_path)
5927 Move a file if and only if it was created by an upload */
5928 PHP_FUNCTION(move_uploaded_file)
5929 {
5930 char *path, *new_path;
5931 size_t path_len, new_path_len;
5932 zend_bool successful = 0;
5933
5934 #ifndef PHP_WIN32
5935 int oldmask; int ret;
5936 #endif
5937
5938 if (!SG(rfc1867_uploaded_files)) {
5939 RETURN_FALSE;
5940 }
5941
5942 ZEND_PARSE_PARAMETERS_START(2, 2)
5943 Z_PARAM_STRING(path, path_len)
5944 Z_PARAM_PATH(new_path, new_path_len)
5945 ZEND_PARSE_PARAMETERS_END();
5946
5947 if (!zend_hash_str_exists(SG(rfc1867_uploaded_files), path, path_len)) {
5948 RETURN_FALSE;
5949 }
5950
5951 if (php_check_open_basedir(new_path)) {
5952 RETURN_FALSE;
5953 }
5954
5955 if (VCWD_RENAME(path, new_path) == 0) {
5956 successful = 1;
5957 #ifndef PHP_WIN32
5958 oldmask = umask(077);
5959 umask(oldmask);
5960
5961 ret = VCWD_CHMOD(new_path, 0666 & ~oldmask);
5962
5963 if (ret == -1) {
5964 php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
5965 }
5966 #endif
5967 } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR) == SUCCESS) {
5968 VCWD_UNLINK(path);
5969 successful = 1;
5970 }
5971
5972 if (successful) {
5973 zend_hash_str_del(SG(rfc1867_uploaded_files), path, path_len);
5974 } else {
5975 php_error_docref(NULL, E_WARNING, "Unable to move '%s' to '%s'", path, new_path);
5976 }
5977
5978 RETURN_BOOL(successful);
5979 }
5980 /* }}} */
5981
5982 /* {{{ php_simple_ini_parser_cb
5983 */
5984 static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr)
5985 {
5986 switch (callback_type) {
5987
5988 case ZEND_INI_PARSER_ENTRY:
5989 if (!arg2) {
5990 /* bare string - nothing to do */
5991 break;
5992 }
5993 Z_TRY_ADDREF_P(arg2);
5994 zend_symtable_update(Z_ARRVAL_P(arr), Z_STR_P(arg1), arg2);
5995 break;
5996
5997 case ZEND_INI_PARSER_POP_ENTRY:
5998 {
5999 zval hash, *find_hash;
6000
6001 if (!arg2) {
6002 /* bare string - nothing to do */
6003 break;
6004 }
6005
6006 if (!(Z_STRLEN_P(arg1) > 1 && Z_STRVAL_P(arg1)[0] == '0') && is_numeric_string(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), NULL, NULL, 0) == IS_LONG) {
6007 zend_ulong key = (zend_ulong) zend_atol(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1));
6008 if ((find_hash = zend_hash_index_find(Z_ARRVAL_P(arr), key)) == NULL) {
6009 array_init(&hash);
6010 find_hash = zend_hash_index_add_new(Z_ARRVAL_P(arr), key, &hash);
6011 }
6012 } else {
6013 if ((find_hash = zend_hash_find(Z_ARRVAL_P(arr), Z_STR_P(arg1))) == NULL) {
6014 array_init(&hash);
6015 find_hash = zend_hash_add_new(Z_ARRVAL_P(arr), Z_STR_P(arg1), &hash);
6016 }
6017 }
6018
6019 if (Z_TYPE_P(find_hash) != IS_ARRAY) {
6020 zval_ptr_dtor_nogc(find_hash);
6021 array_init(find_hash);
6022 }
6023
6024 if (!arg3 || (Z_TYPE_P(arg3) == IS_STRING && Z_STRLEN_P(arg3) == 0)) {
6025 Z_TRY_ADDREF_P(arg2);
6026 add_next_index_zval(find_hash, arg2);
6027 } else {
6028 array_set_zval_key(Z_ARRVAL_P(find_hash), arg3, arg2);
6029 }
6030 }
6031 break;
6032
6033 case ZEND_INI_PARSER_SECTION:
6034 break;
6035 }
6036 }
6037 /* }}} */
6038
6039 /* {{{ php_ini_parser_cb_with_sections
6040 */
6041 static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr)
6042 {
6043 if (callback_type == ZEND_INI_PARSER_SECTION) {
6044 array_init(&BG(active_ini_file_section));
6045 zend_symtable_update(Z_ARRVAL_P(arr), Z_STR_P(arg1), &BG(active_ini_file_section));
6046 } else if (arg2) {
6047 zval *active_arr;
6048
6049 if (Z_TYPE(BG(active_ini_file_section)) != IS_UNDEF) {
6050 active_arr = &BG(active_ini_file_section);
6051 } else {
6052 active_arr = arr;
6053 }
6054
6055 php_simple_ini_parser_cb(arg1, arg2, arg3, callback_type, active_arr);
6056 }
6057 }
6058 /* }}} */
6059
6060 /* {{{ proto array parse_ini_file(string filename [, bool process_sections [, int scanner_mode]])
6061 Parse configuration file */
6062 PHP_FUNCTION(parse_ini_file)
6063 {
6064 char *filename = NULL;
6065 size_t filename_len = 0;
6066 zend_bool process_sections = 0;
6067 zend_long scanner_mode = ZEND_INI_SCANNER_NORMAL;
6068 zend_file_handle fh;
6069 zend_ini_parser_cb_t ini_parser_cb;
6070
6071 ZEND_PARSE_PARAMETERS_START(1, 3)
6072 Z_PARAM_PATH(filename, filename_len)
6073 Z_PARAM_OPTIONAL
6074 Z_PARAM_BOOL(process_sections)
6075 Z_PARAM_LONG(scanner_mode)
6076 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
6077
6078 if (filename_len == 0) {
6079 php_error_docref(NULL, E_WARNING, "Filename cannot be empty!");
6080 RETURN_FALSE;
6081 }
6082
6083 /* Set callback function */
6084 if (process_sections) {
6085 ZVAL_UNDEF(&BG(active_ini_file_section));
6086 ini_parser_cb = (zend_ini_parser_cb_t) php_ini_parser_cb_with_sections;
6087 } else {
6088 ini_parser_cb = (zend_ini_parser_cb_t) php_simple_ini_parser_cb;
6089 }
6090
6091 /* Setup filehandle */
6092 zend_stream_init_filename(&fh, filename);
6093
6094 array_init(return_value);
6095 if (zend_parse_ini_file(&fh, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) {
6096 zend_array_destroy(Z_ARR_P(return_value));
6097 RETURN_FALSE;
6098 }
6099 }
6100 /* }}} */
6101
6102 /* {{{ proto array parse_ini_string(string ini_string [, bool process_sections [, int scanner_mode]])
6103 Parse configuration string */
6104 PHP_FUNCTION(parse_ini_string)
6105 {
6106 char *string = NULL, *str = NULL;
6107 size_t str_len = 0;
6108 zend_bool process_sections = 0;
6109 zend_long scanner_mode = ZEND_INI_SCANNER_NORMAL;
6110 zend_ini_parser_cb_t ini_parser_cb;
6111
6112 ZEND_PARSE_PARAMETERS_START(1, 3)
6113 Z_PARAM_STRING(str, str_len)
6114 Z_PARAM_OPTIONAL
6115 Z_PARAM_BOOL(process_sections)
6116 Z_PARAM_LONG(scanner_mode)
6117 ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
6118
6119 if (INT_MAX - str_len < ZEND_MMAP_AHEAD) {
6120 RETVAL_FALSE;
6121 }
6122
6123 /* Set callback function */
6124 if (process_sections) {
6125 ZVAL_UNDEF(&BG(active_ini_file_section));
6126 ini_parser_cb = (zend_ini_parser_cb_t) php_ini_parser_cb_with_sections;
6127 } else {
6128 ini_parser_cb = (zend_ini_parser_cb_t) php_simple_ini_parser_cb;
6129 }
6130
6131 /* Setup string */
6132 string = (char *) emalloc(str_len + ZEND_MMAP_AHEAD);
6133 memcpy(string, str, str_len);
6134 memset(string + str_len, 0, ZEND_MMAP_AHEAD);
6135
6136 array_init(return_value);
6137 if (zend_parse_ini_string(string, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) {
6138 zend_array_destroy(Z_ARR_P(return_value));
6139 RETVAL_FALSE;
6140 }
6141 efree(string);
6142 }
6143 /* }}} */
6144
6145 #if ZEND_DEBUG
6146 /* This function returns an array of ALL valid ini options with values and
6147 * is not the same as ini_get_all() which returns only registered ini options. Only useful for devs to debug php.ini scanner/parser! */
6148 PHP_FUNCTION(config_get_hash) /* {{{ */
6149 {
6150 HashTable *hash = php_ini_get_configuration_hash();
6151
6152 array_init(return_value);
6153 add_config_entries(hash, return_value);
6154 }
6155 /* }}} */
6156 #endif
6157
6158 #ifdef HAVE_GETLOADAVG
6159 /* {{{ proto array sys_getloadavg()
6160 */
6161 PHP_FUNCTION(sys_getloadavg)
6162 {
6163 double load[3];
6164
6165 if (zend_parse_parameters_none() == FAILURE) {
6166 return;
6167 }
6168
6169 if (getloadavg(load, 3) == -1) {
6170 RETURN_FALSE;
6171 } else {
6172 array_init(return_value);
6173 add_index_double(return_value, 0, load[0]);
6174 add_index_double(return_value, 1, load[1]);
6175 add_index_double(return_value, 2, load[2]);
6176 }
6177 }
6178 /* }}} */
6179 #endif
6180