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