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