PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/standard - basic_functions.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 1029 1214 84.8 %
Date: 2014-07-27 Functions: 78 85 91.8 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10

Generated at Sun, 27 Jul 2014 12:58:38 +0000 (17 hours ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.