summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/basic_functions.c215
-rw-r--r--ext/standard/basic_functions.h9
2 files changed, 126 insertions, 98 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index ca21545f2e..d62542e801 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
@@ -96,7 +96,7 @@ function_entry basic_functions[] = {
PHP_FE(bin2hex, NULL)
PHP_FE(sleep, NULL)
PHP_FE(usleep, NULL)
-
+
PHP_FE(time, NULL)
PHP_FE(mktime, NULL)
PHP_FE(gmmktime, NULL)
@@ -104,8 +104,8 @@ function_entry basic_functions[] = {
PHP_FE(strftime, NULL)
PHP_FE(gmstrftime, NULL)
#else
- PHP_FALIAS(strftime , warn_not_available, NULL)
- PHP_FALIAS(gmstrftime, warn_not_available, NULL)
+ PHP_FALIAS(strftime , warn_not_available, NULL)
+ PHP_FALIAS(gmstrftime, warn_not_available, NULL)
#endif
PHP_FE(strtotime, NULL)
PHP_FE(date, NULL)
@@ -115,23 +115,23 @@ function_entry basic_functions[] = {
PHP_FE(checkdate, NULL)
PHP_FE(flush, NULL)
-
+
PHP_FE(gettype, NULL)
PHP_FE(settype, first_arg_force_ref)
-
+
PHP_FE(getimagesize, second_args_force_ref)
-
+
PHP_FE(wordwrap, NULL)
PHP_FE(htmlspecialchars, NULL)
PHP_FE(htmlentities, NULL)
PHP_FE(get_html_translation_table, NULL)
-
+
PHP_NAMED_FE(md5, php_if_md5, NULL)
PHP_NAMED_FE(crc32, php_if_crc32, NULL)
PHP_FE(iptcparse, NULL)
PHP_FE(iptcembed, NULL)
-
+
PHP_FE(phpinfo, NULL)
PHP_FE(phpversion, NULL)
PHP_FE(phpcredits, NULL)
@@ -139,7 +139,7 @@ function_entry basic_functions[] = {
PHP_FE(zend_logo_guid, NULL)
PHP_FE(php_sapi_name, NULL)
PHP_FE(php_uname, NULL)
-
+
PHP_FE(strnatcmp, NULL)
PHP_FE(strnatcasecmp, NULL)
PHP_FE(substr_count, NULL)
@@ -215,7 +215,7 @@ function_entry basic_functions[] = {
PHP_FALIAS(link, warn_not_available, NULL)
#endif
PHP_FE(unlink, NULL)
-
+
PHP_FE(exec, second_and_third_args_force_ref)
PHP_FE(system, second_arg_force_ref)
PHP_FE(escapeshellcmd, NULL)
@@ -230,7 +230,7 @@ function_entry basic_functions[] = {
PHP_FE(mt_srand, NULL)
PHP_FE(mt_getrandmax, NULL)
PHP_FE(getservbyname, NULL)
- PHP_FE(getservbyport, NULL)
+ PHP_FE(getservbyport, NULL)
PHP_FE(getprotobyname, NULL)
PHP_FE(getprotobynumber, NULL)
PHP_FE(gethostbyaddr, NULL)
@@ -240,8 +240,8 @@ function_entry basic_functions[] = {
PHP_FE(checkdnsrr, NULL)
PHP_FE(getmxrr, second_and_third_args_force_ref)
#else
- PHP_FALIAS(checkdnsrr, warn_not_available, NULL)
- PHP_FALIAS(getmxrr, warn_not_available, NULL)
+ PHP_FALIAS(checkdnsrr, warn_not_available, NULL)
+ PHP_FALIAS(getmxrr, warn_not_available, NULL)
#endif
PHP_FE(getmyuid, NULL)
@@ -286,7 +286,7 @@ function_entry basic_functions[] = {
#ifdef HAVE_PUTENV
PHP_FE(putenv, NULL)
#else
- PHP_FALIAS(putenv , warn_not_available, NULL)
+ PHP_FALIAS(putenv , warn_not_available, NULL)
#endif
PHP_FE(microtime, NULL)
@@ -294,23 +294,23 @@ function_entry basic_functions[] = {
#ifdef HAVE_GETRUSAGE
PHP_FE(getrusage, NULL)
#else
- PHP_FALIAS(getrusage , warn_not_available, NULL)
+ PHP_FALIAS(getrusage , warn_not_available, NULL)
#endif
-
+
PHP_FE(uniqid, NULL)
-
+
PHP_FE(quoted_printable_decode, NULL)
-
+
PHP_FE(convert_cyr_string, NULL)
PHP_FE(get_current_user, NULL)
PHP_FE(set_time_limit, NULL)
-
+
PHP_FE(get_cfg_var, NULL)
PHP_FALIAS(magic_quotes_runtime, set_magic_quotes_runtime, NULL)
PHP_FE(set_magic_quotes_runtime, NULL)
PHP_FE(get_magic_quotes_gpc, NULL)
PHP_FE(get_magic_quotes_runtime, NULL)
-
+
PHP_FE(is_null, first_arg_allow_ref)
PHP_FE(is_resource, first_arg_allow_ref)
PHP_FE(is_bool, first_arg_allow_ref)
@@ -324,6 +324,7 @@ function_entry basic_functions[] = {
PHP_FE(is_string, first_arg_allow_ref)
PHP_FE(is_array, first_arg_allow_ref)
PHP_FE(is_object, first_arg_allow_ref)
+ PHP_FE(is_scalar, NULL)
PHP_FE(error_log, NULL)
PHP_FE(call_user_func, NULL)
@@ -334,27 +335,27 @@ function_entry basic_functions[] = {
PHP_FE(var_dump, NULL)
PHP_FE(serialize, first_arg_allow_ref)
PHP_FE(unserialize, first_arg_allow_ref)
-
+
PHP_FE(register_shutdown_function, NULL)
PHP_FE(register_tick_function, NULL)
PHP_FE(unregister_tick_function, NULL)
- PHP_FE(highlight_file, NULL)
+ PHP_FE(highlight_file, NULL)
PHP_FALIAS(show_source, highlight_file , NULL)
PHP_FE(highlight_string, NULL)
-
+
PHP_FE(ini_get, NULL)
PHP_FE(ini_set, NULL)
PHP_FALIAS(ini_alter, ini_set, NULL)
PHP_FE(ini_restore, NULL)
PHP_FE(print_r, NULL)
-
+
PHP_FE(setcookie, NULL)
PHP_NAMED_FE(header, PHP_FN(Header), NULL)
PHP_FE(headers_sent, NULL)
-
+
PHP_FE(connection_aborted, NULL)
PHP_FE(connection_timeout, NULL)
PHP_FE(connection_status, NULL)
@@ -422,7 +423,7 @@ function_entry basic_functions[] = {
#if HAVE_SYS_TIME_H
PHP_FE(socket_set_timeout, NULL)
#else
- PHP_FALIAS(socket_set_timeout, warn_not_available, NULL)
+ PHP_FALIAS(socket_set_timeout, warn_not_available, NULL)
#endif
PHP_FE(socket_get_status, NULL)
#if !PHP_WIN32 || defined(ZTS)
@@ -446,7 +447,7 @@ function_entry basic_functions[] = {
/* functions from crypt.c */
PHP_FE(crypt, NULL)
#else
- PHP_FALIAS(crypt , warn_not_available, NULL)
+ PHP_FALIAS(crypt , warn_not_available, NULL)
#endif
/* functions from dir.c */
@@ -560,7 +561,7 @@ function_entry basic_functions[] = {
/* aliases from array.c */
PHP_FALIAS(pos, current, first_arg_force_ref)
PHP_FALIAS(sizeof, count, first_arg_allow_ref)
-
+
/* functions from assert.c */
PHP_FE(assert, NULL)
PHP_FE(assert_options, NULL)
@@ -631,7 +632,7 @@ static void php_putenv_destructor(putenv_entry *pe)
unsetenv(pe->key);
# else
char **env;
-
+
for (env = environ; env != NULL && *env != NULL; env++) {
if (!strncmp(*env,pe->key,pe->key_len) && (*env)[pe->key_len]=='=') { /* found it */
*env = "";
@@ -687,7 +688,7 @@ PHP_MINIT_FUNCTION(basic)
#else
basic_globals_ctor(BLS_C);
#endif
-
+
#define REGISTER_MATH_CONSTANT(x) REGISTER_DOUBLE_CONSTANT(#x, x, CONST_CS | CONST_PERSISTENT)
REGISTER_MATH_CONSTANT(M_E);
REGISTER_MATH_CONSTANT(M_LOG2E);
@@ -733,15 +734,15 @@ PHP_MINIT_FUNCTION(basic)
if(PG(allow_url_fopen)) {
if (FAILURE==php_register_url_wrapper("http", php_fopen_url_wrap_http)) {
return FAILURE;
- }
+ }
if (FAILURE==php_register_url_wrapper("ftp", php_fopen_url_wrap_ftp)) {
return FAILURE;
- }
+ }
if (FAILURE==php_register_url_wrapper("php", php_fopen_url_wrap_php)) {
return FAILURE;
- }
+ }
}
-
+
return SUCCESS;
}
@@ -774,7 +775,7 @@ PHP_MSHUTDOWN_FUNCTION(basic)
PHP_MSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#endif
- return SUCCESS;
+ return SUCCESS;
}
@@ -809,7 +810,7 @@ PHP_RINIT_FUNCTION(basic)
PHP_RINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU);
}
#endif
-
+
return SUCCESS;
}
@@ -845,7 +846,7 @@ PHP_RSHUTDOWN_FUNCTION(basic)
efree(BG(user_tick_functions));
BG(user_tick_functions) = NULL;
}
-
+
return SUCCESS;
}
@@ -873,13 +874,13 @@ PHP_MINFO_FUNCTION(basic)
PHP_FUNCTION(constant)
{
zval **const_name;
-
+
if (ZEND_NUM_ARGS() != 1 ||
zend_get_parameters_ex(1, &const_name) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(const_name);
-
+
if (!zend_get_constant(Z_STRVAL_PP(const_name), Z_STRLEN_PP(const_name), return_value)) {
php_error(E_WARNING, "Couldn't find constant %s", Z_STRVAL_PP(const_name));
RETURN_NULL();
@@ -910,11 +911,11 @@ PHP_FUNCTION(long2ip)
{
zval **num;
struct in_addr myaddr;
-
+
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
WRONG_PARAM_COUNT;
}
-
+
convert_to_long_ex(num);
myaddr.s_addr = htonl((unsigned long)Z_LVAL_PP(num));
@@ -943,8 +944,8 @@ PHP_FUNCTION(getenv)
if (Z_TYPE_PP(str) != IS_STRING) {
RETURN_FALSE;
}
-
-
+
+
ptr = sapi_getenv(Z_STRVAL_PP(str), Z_STRLEN_PP(str));
if (!ptr) {
ptr = getenv(Z_STRVAL_PP(str));
@@ -975,14 +976,14 @@ PHP_FUNCTION(putenv)
char *p,**env;
putenv_entry pe;
PLS_FETCH();
-
+
pe.putenv_string = estrndup(Z_STRVAL_PP(str),Z_STRLEN_PP(str));
pe.key = estrndup(Z_STRVAL_PP(str), Z_STRLEN_PP(str));
if ((p=strchr(pe.key,'='))) { /* nullify the '=' if there is one */
*p='\0';
}
pe.key_len = strlen(pe.key);
-
+
if (PG(safe_mode)) {
/* Check the protected list */
if (zend_hash_exists(&BG(sm_protected_env_vars), pe.key, pe.key_len)) {
@@ -1016,7 +1017,7 @@ PHP_FUNCTION(putenv)
}
zend_hash_del(&BG(putenv_ht),pe.key,pe.key_len+1);
-
+
/* find previous value */
pe.previous_value = NULL;
for (env = environ; env != NULL && *env != NULL; env++) {
@@ -1049,7 +1050,7 @@ PHP_FUNCTION(intval)
{
pval **num, **arg_base;
int base;
-
+
switch(ZEND_NUM_ARGS()) {
case 1:
if (zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -1088,7 +1089,7 @@ PHP_FUNCTION(doubleval)
}
/* }}} */
-/* {{{ proto string strval(mixed var)
+/* {{{ proto string strval(mixed var)
Get the string value of a variable */
PHP_FUNCTION(strval)
{
@@ -1179,7 +1180,7 @@ PHP_FUNCTION(gettype)
{
char *result;
int res_len;
-
+
res_len = sizeof("object of type ")-1 + arg->value.obj.ce->name_length;
result = (char *) emalloc(res_len+1);
sprintf(result, "object of type %s", arg->value.obj.ce->name);
@@ -1243,13 +1244,13 @@ PHP_FUNCTION(get_cfg_var)
{
pval **varname;
char *value;
-
+
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &varname)==FAILURE) {
WRONG_PARAM_COUNT;
}
-
+
convert_to_string_ex(varname);
-
+
if (cfg_get_string(Z_STRVAL_PP(varname),&value)==FAILURE) {
RETURN_FALSE;
}
@@ -1264,19 +1265,19 @@ PHP_FUNCTION(set_magic_quotes_runtime)
{
pval **new_setting;
PLS_FETCH();
-
+
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &new_setting)==FAILURE) {
RETURN_FALSE;
}
convert_to_boolean_ex(new_setting);
-
+
PG(magic_quotes_runtime) = (zend_bool) Z_LVAL_PP(new_setting);
RETURN_TRUE;
}
/* }}} */
/* {{{ proto int get_magic_quotes_runtime(void)
- Get the current active configuration setting of magic_quotes_runtime */
+ Get the current active configuration setting of magic_quotes_runtime */
PHP_FUNCTION(get_magic_quotes_runtime)
{
PLS_FETCH();
@@ -1299,7 +1300,7 @@ PHP_FUNCTION(get_magic_quotes_gpc)
void php_is_type(INTERNAL_FUNCTION_PARAMETERS,int type)
{
pval **arg;
-
+
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
RETURN_FALSE;
}
@@ -1319,8 +1320,8 @@ PHP_FUNCTION(is_null)
/* }}} */
/* {{{ proto bool is_resource(mixed var)
- Returns true if variable is a resource */
-PHP_FUNCTION(is_resource)
+ Returns true if variable is a resource */
+PHP_FUNCTION(is_resource)
{
php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_RESOURCE);
}
@@ -1328,7 +1329,7 @@ PHP_FUNCTION(is_resource)
/* {{{ proto bool is_bool(mixed var)
Returns true if variable is a boolean */
-PHP_FUNCTION(is_bool)
+PHP_FUNCTION(is_bool)
{
php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_BOOL);
}
@@ -1336,7 +1337,7 @@ PHP_FUNCTION(is_bool)
/* {{{ proto bool is_long(mixed var)
Returns true if variable is a long (integer) */
-PHP_FUNCTION(is_long)
+PHP_FUNCTION(is_long)
{
php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_LONG);
}
@@ -1353,7 +1354,7 @@ PHP_FUNCTION(is_double)
/* {{{ proto bool is_string(mixed var)
Returns true if variable is a string */
PHP_FUNCTION(is_string)
-{
+{
php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_STRING);
}
/* }}} */
@@ -1380,7 +1381,7 @@ PHP_FUNCTION(is_numeric)
{
zval **arg;
int result;
-
+
if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -1407,7 +1408,33 @@ PHP_FUNCTION(is_numeric)
}
/* }}} */
-/*
+/* {{{ proto bool is_scalar (mixed value)
+ Returns true if value is a scalar */
+PHP_FUNCTION(is_scalar)
+{
+ zval **arg;
+ int result;
+
+ if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ switch (Z_TYPE_PP(arg)) {
+ case IS_BOOL:
+ case IS_DOUBLE:
+ case IS_LONG:
+ case IS_STRING:
+ RETURN_TRUE;
+ break;
+
+ default:
+ RETURN_FALSE;
+ break;
+ }
+}
+/* }}} */
+
+/*
1st arg = error message
2nd arg = error option
3rd arg = optional parameters (email address or tcp address)
@@ -1531,12 +1558,12 @@ PHP_FUNCTION(call_user_func)
pval *retval_ptr;
int arg_count=ZEND_NUM_ARGS();
CLS_FETCH();
-
+
if (arg_count<1) {
WRONG_PARAM_COUNT;
}
params = (pval ***) emalloc(sizeof(pval **)*arg_count);
-
+
if (zend_get_parameters_array_ex(arg_count, params)==FAILURE) {
efree(params);
RETURN_FALSE;
@@ -1564,32 +1591,32 @@ PHP_FUNCTION(call_user_func_array)
int num_elems,
element = 0;
CLS_FETCH();
-
+
if (ZEND_NUM_ARGS() != 2 ||
zend_get_parameters_ex(2, &func_name, &params) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(func_name);
convert_to_array_ex(params);
-
+
params_ar = HASH_OF(*params);
num_elems = zend_hash_num_elements(params_ar);
-
+
func_args = (zval ***)emalloc(sizeof(zval **) * num_elems);
-
+
for (zend_hash_internal_pointer_reset(params_ar);
zend_hash_get_current_data(params_ar, (void **)&(func_args[element])) == SUCCESS;
zend_hash_move_forward(params_ar))
element++;
-
+
if (call_user_function_ex(CG(function_table), NULL, *func_name, &retval_ptr, num_elems, func_args, 1, NULL) == SUCCESS
&& retval_ptr) {
COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
} else {
php_error(E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_PP(func_name));
}
-
+
efree(func_args);
}
/* }}} */
@@ -1602,12 +1629,12 @@ PHP_FUNCTION(call_user_method)
pval *retval_ptr;
int arg_count=ZEND_NUM_ARGS();
CLS_FETCH();
-
+
if (arg_count<2) {
WRONG_PARAM_COUNT;
}
params = (pval ***) emalloc(sizeof(pval **)*arg_count);
-
+
if (zend_get_parameters_array_ex(arg_count, params)==FAILURE) {
efree(params);
RETURN_FALSE;
@@ -1635,7 +1662,7 @@ PHP_FUNCTION(call_user_method)
PHP_FUNCTION(call_user_method_array)
{
zval **method_name,
- **obj,
+ **obj,
**params,
***method_args = NULL,
*retval_ptr;
@@ -1643,7 +1670,7 @@ PHP_FUNCTION(call_user_method_array)
int num_elems,
element = 0;
CLS_FETCH();
-
+
if (ZEND_NUM_ARGS() != 3 ||
zend_get_parameters_ex(3, &method_name, &obj, &params) == FAILURE) {
WRONG_PARAM_COUNT;
@@ -1651,7 +1678,7 @@ PHP_FUNCTION(call_user_method_array)
convert_to_string_ex(method_name);
convert_to_object_ex(obj);
convert_to_array_ex(params);
-
+
params_ar = HASH_OF(*params);
num_elems = zend_hash_num_elements(params_ar);
method_args = (zval ***)emalloc(sizeof(zval **) * num_elems);
@@ -1660,14 +1687,14 @@ PHP_FUNCTION(call_user_method_array)
zend_hash_get_current_data(params_ar, (void **)&(method_args[element])) == SUCCESS;
zend_hash_move_forward(params_ar))
element++;
-
+
if (call_user_function_ex(CG(function_table), obj, *method_name, &retval_ptr, num_elems, method_args, 1, NULL) == SUCCESS
&& retval_ptr) {
COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
} else {
php_error(E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_PP(method_name));
}
-
+
efree(method_args);
}
/* }}} */
@@ -1745,7 +1772,7 @@ static int user_tick_function_compare(user_tick_function_entry *tick_fe1,
{
zval *func1 = tick_fe1->arguments[0];
zval *func2 = tick_fe2->arguments[0];
-
+
if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) {
return (zend_binary_zval_strcmp(func1, func2) == 0);
} else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) {
@@ -1826,7 +1853,7 @@ PHP_FUNCTION(highlight_file)
pval **filename;
zend_syntax_highlighter_ini syntax_highlighter_ini;
-
+
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &filename)==FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -1849,15 +1876,15 @@ PHP_FUNCTION(highlight_string)
pval **expr;
zend_syntax_highlighter_ini syntax_highlighter_ini;
char *hicompiled_string_description;
-
+
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &expr)==FAILURE) {
WRONG_PARAM_COUNT;
}
-
+
convert_to_string_ex(expr);
php_get_highlight_struct(&syntax_highlighter_ini);
-
+
hicompiled_string_description = zend_make_compiled_string_description("highlighted code");
if (highlight_string(*expr, &syntax_highlighter_ini, hicompiled_string_description)==FAILURE) {
@@ -1899,7 +1926,7 @@ pval test_class_get_property(zend_property_reference *property_reference)
}
pval_destructor(&overloaded_property->element);
}
-
+
Z_STRVAL(result) = estrndup("testing", 7);
Z_STRLEN(result) = 7;
Z_TYPE(result) = IS_STRING;
@@ -1937,7 +1964,7 @@ int test_class_set_property(zend_property_reference *property_reference, pval *v
}
pval_destructor(&overloaded_property->element);
}
-
+
return 0;
}
@@ -1973,7 +2000,7 @@ void test_class_call_function(INTERNAL_FUNCTION_PARAMETERS, zend_property_refere
}
pval_destructor(&overloaded_property->element);
}
-
+
printf("%d arguments\n", ZEND_NUM_ARGS());
RETVAL_STRING("testing", 1);
}
@@ -2139,7 +2166,7 @@ PHP_FUNCTION(ignore_user_abort)
Returns port associated with service. Protocol must be "tcp" or "udp". */
PHP_FUNCTION(getservbyname)
{
- pval **name,**proto;
+ pval **name,**proto;
struct servent *serv;
if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2,&name,&proto) == FAILURE) {
@@ -2193,7 +2220,7 @@ PHP_FUNCTION(getprotobyname)
}
convert_to_string_ex(name);
-
+
ent = getprotobyname(Z_STRVAL_PP(name));
if(ent == NULL) {
@@ -2205,7 +2232,7 @@ PHP_FUNCTION(getprotobyname)
RETURN_LONG(ent->p_proto);
}
/* }}} */
-
+
/* {{{ proto string getprotobynumber(int proto)
Returns protocol name associated with protocol number proto */
@@ -2221,7 +2248,7 @@ PHP_FUNCTION(getprotobynumber)
convert_to_long_ex(proto);
ent = getprotobynumber(Z_LVAL_PP(proto));
-
+
if(ent == NULL)
RETURN_FALSE;
@@ -2315,10 +2342,10 @@ PHP_FUNCTION(register_tick_function)
if (zend_get_parameters_array(ht, tick_fe.arg_count, tick_fe.arguments) == FAILURE) {
RETURN_FALSE;
}
-
+
if (Z_TYPE_P(tick_fe.arguments[0]) != IS_ARRAY)
convert_to_string_ex(&tick_fe.arguments[0]);
-
+
if (!BG(user_tick_functions)) {
BG(user_tick_functions) = (zend_llist *)emalloc(sizeof(zend_llist));
zend_llist_init(BG(user_tick_functions), sizeof(user_tick_function_entry),
@@ -2537,4 +2564,4 @@ PHP_FUNCTION(parse_ini_file)
* tab-width: 4
* c-basic-offset: 4
* End:
- */
+ */
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index c6142826ba..247c42271d 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
@@ -76,6 +76,7 @@ PHP_FUNCTION(is_numeric);
PHP_FUNCTION(is_string);
PHP_FUNCTION(is_array);
PHP_FUNCTION(is_object);
+PHP_FUNCTION(is_scalar);
PHP_FUNCTION(error_log);
@@ -153,7 +154,7 @@ typedef struct {
zend_llist *user_tick_functions;
zval *active_ini_file_section;
-
+
HashTable sm_protected_env_vars;
char *sm_allowed_env_vars;
@@ -183,9 +184,9 @@ typedef struct {
#ifdef TRANS_SID
/* url_scanner.c */
- url_adapt_state_t url_adapt_state;
+ url_adapt_state_t url_adapt_state;
/* url_scanner_ex.re */
- url_adapt_state_ex_t url_adapt_state_ex;
+ url_adapt_state_ex_t url_adapt_state_ex;
#endif
} php_basic_globals;