diff options
author | SVN Migration <svn@php.net> | 2008-12-03 20:30:45 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2008-12-03 20:30:45 +0000 |
commit | 2876046398950e59c3b3c460e67e6fec7ff2ba3c (patch) | |
tree | 33b2b8b4b859960a6446ad19d0ada1c55f9cfcda /ext/standard | |
parent | 3fb86b0b9e79e6a3312b694f30ee627e2e1b325c (diff) | |
download | php-git-php-5.3.0alpha2.tar.gz |
This commit was manufactured by cvs2svn to create tag 'php_5_3_0alpha2'.php-5.3.0alpha2
Diffstat (limited to 'ext/standard')
137 files changed, 2315 insertions, 2393 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 7c3049e1f4..9b12c27b14 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -751,17 +751,16 @@ PHP_FUNCTION(uksort) Advances array argument's internal pointer to the last element and return it */ PHP_FUNCTION(end) { - HashTable *array; - zval **entry; + zval *array, **entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { return; } - zend_hash_internal_pointer_end(array); + zend_hash_internal_pointer_end(Z_ARRVAL_P(array)); if (return_value_used) { - if (zend_hash_get_current_data(array, (void **) &entry) == FAILURE) { + if (zend_hash_get_current_data(Z_ARRVAL_P(array), (void **) &entry) == FAILURE) { RETURN_FALSE; } @@ -774,17 +773,16 @@ PHP_FUNCTION(end) Move array argument's internal pointer to the previous element and return it */ PHP_FUNCTION(prev) { - HashTable *array; - zval **entry; + zval *array, **entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { return; } - zend_hash_move_backwards(array); + zend_hash_move_backwards(Z_ARRVAL_P(array)); if (return_value_used) { - if (zend_hash_get_current_data(array, (void **) &entry) == FAILURE) { + if (zend_hash_get_current_data(Z_ARRVAL_P(array), (void **) &entry) == FAILURE) { RETURN_FALSE; } @@ -797,17 +795,16 @@ PHP_FUNCTION(prev) Move array argument's internal pointer to the next element and return it */ PHP_FUNCTION(next) { - HashTable *array; - zval **entry; + zval *array, **entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { return; } - zend_hash_move_forward(array); + zend_hash_move_forward(Z_ARRVAL_P(array)); if (return_value_used) { - if (zend_hash_get_current_data(array, (void **) &entry) == FAILURE) { + if (zend_hash_get_current_data(Z_ARRVAL_P(array), (void **) &entry) == FAILURE) { RETURN_FALSE; } @@ -820,17 +817,16 @@ PHP_FUNCTION(next) Set array argument's internal pointer to the first element and return it */ PHP_FUNCTION(reset) { - HashTable *array; - zval **entry; + zval *array, **entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { return; } - zend_hash_internal_pointer_reset(array); + zend_hash_internal_pointer_reset(Z_ARRVAL_P(array)); if (return_value_used) { - if (zend_hash_get_current_data(array, (void **) &entry) == FAILURE) { + if (zend_hash_get_current_data(Z_ARRVAL_P(array), (void **) &entry) == FAILURE) { RETURN_FALSE; } @@ -843,14 +839,13 @@ PHP_FUNCTION(reset) Return the element currently pointed to by the internal array pointer */ PHP_FUNCTION(current) { - HashTable *array; - zval **entry; + zval *array, **entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { return; } - if (zend_hash_get_current_data(array, (void **) &entry) == FAILURE) { + if (zend_hash_get_current_data(Z_ARRVAL_P(array), (void **) &entry) == FAILURE) { RETURN_FALSE; } RETURN_ZVAL(*entry, 1, 0); @@ -861,16 +856,16 @@ PHP_FUNCTION(current) Return the key of the element currently pointed to by the internal array pointer */ PHP_FUNCTION(key) { - HashTable *array; + zval *array; char *string_key; uint string_length; ulong num_key; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { return; } - switch (zend_hash_get_current_key_ex(array, &string_key, &string_length, &num_key, 0, NULL)) { + switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(array), &string_key, &string_length, &num_key, 0, NULL)) { case HASH_KEY_IS_STRING: RETVAL_STRINGL(string_key, string_length - 1, 1); break; @@ -1075,21 +1070,21 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive Apply a user function to every member of an array */ PHP_FUNCTION(array_walk) { - HashTable *array; - zval *userdata = NULL; + zval *array, + *userdata = NULL; zend_fcall_info orig_array_walk_fci; zend_fcall_info_cache orig_array_walk_fci_cache; orig_array_walk_fci = BG(array_walk_fci); orig_array_walk_fci_cache = BG(array_walk_fci_cache); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Hf|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "af|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) { BG(array_walk_fci) = orig_array_walk_fci; BG(array_walk_fci_cache) = orig_array_walk_fci_cache; return; } - php_array_walk(array, userdata ? &userdata : NULL, 0 TSRMLS_CC); + php_array_walk(Z_ARRVAL_P(array), userdata ? &userdata : NULL, 0 TSRMLS_CC); BG(array_walk_fci) = orig_array_walk_fci; BG(array_walk_fci_cache) = orig_array_walk_fci_cache; RETURN_TRUE; @@ -1100,21 +1095,21 @@ PHP_FUNCTION(array_walk) Apply a user function recursively to every member of an array */ PHP_FUNCTION(array_walk_recursive) { - HashTable *array; - zval *userdata = NULL; + zval *array, + *userdata = NULL; zend_fcall_info orig_array_walk_fci; zend_fcall_info_cache orig_array_walk_fci_cache; orig_array_walk_fci = BG(array_walk_fci); orig_array_walk_fci_cache = BG(array_walk_fci_cache); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Hf|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "af|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) { BG(array_walk_fci) = orig_array_walk_fci; BG(array_walk_fci_cache) = orig_array_walk_fci_cache; return; } - php_array_walk(array, userdata ? &userdata : NULL, 1 TSRMLS_CC); + php_array_walk(Z_ARRVAL_P(array), userdata ? &userdata : NULL, 1 TSRMLS_CC); BG(array_walk_fci) = orig_array_walk_fci; BG(array_walk_fci_cache) = orig_array_walk_fci_cache; RETURN_TRUE; @@ -1359,13 +1354,18 @@ PHP_FUNCTION(extract) if (extract_refs) { zval **orig_var; - SEPARATE_ZVAL_TO_MAKE_IS_REF(entry); - zval_add_ref(entry); - if (zend_hash_find(EG(active_symbol_table), Z_STRVAL(final_name), Z_STRLEN(final_name) + 1, (void **) &orig_var) == SUCCESS) { + SEPARATE_ZVAL_TO_MAKE_IS_REF(entry); + zval_add_ref(entry); zval_ptr_dtor(orig_var); *orig_var = *entry; } else { + if (Z_REFCOUNT_P(var_array) > 1 || *entry == EG(uninitialized_zval_ptr)) { + SEPARATE_ZVAL_TO_MAKE_IS_REF(entry); + } else { + Z_SET_ISREF_PP(entry); + } + zval_add_ref(entry); zend_hash_update(EG(active_symbol_table), Z_STRVAL(final_name), Z_STRLEN(final_name) + 1, (void **) entry, sizeof(zval *), NULL); } } else { @@ -1981,14 +1981,14 @@ PHP_FUNCTION(array_unshift) PHP_FUNCTION(array_splice) { zval *array, /* Input array */ - *repl_array = NULL, /* Replacement array */ + *repl_array, /* Replacement array */ ***repl = NULL; /* Replacement elements */ HashTable *new_hash = NULL, /* Output array's hash */ **rem_hash = NULL; /* Removed elements' hash */ Bucket *p; /* Bucket used for traversing hash */ long i, offset, - length = 0, + length, repl_num = 0; /* Number of replacement elements */ int num_in; /* Number of elements in the input array */ @@ -2061,7 +2061,7 @@ PHP_FUNCTION(array_splice) PHP_FUNCTION(array_slice) { zval *input, /* Input array */ - **z_length = NULL, /* How many elements to get */ + **z_length, /* How many elements to get */ **entry; /* An array entry */ long offset, /* Offset to get elements from */ length = 0; @@ -3347,6 +3347,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ } else if (behavior & DIFF_ASSOC) { /* triggered also if DIFF_KEY */ /* DIFF_KEY is subset of DIFF_ASSOC. When having the former * no comparison of the data is done (part of DIFF_ASSOC) */ + diff_key_compare_func = php_array_key_compare; if (data_compare_type == DIFF_COMP_DATA_INTERNAL && key_compare_type == DIFF_COMP_KEY_INTERNAL) { /* array_diff_assoc() or array_diff_key() */ @@ -4004,7 +4005,7 @@ PHP_FUNCTION(array_reduce) zval *retval; zend_fcall_info fci; zend_fcall_info_cache fci_cache = empty_fcall_info_cache; - zval *initial = NULL; + zval *initial; HashPosition pos; HashTable *htbl; @@ -4073,7 +4074,7 @@ PHP_FUNCTION(array_filter) zval *retval = NULL; zend_bool have_callback = 0; char *string_key; - zend_fcall_info fci = empty_fcall_info; + zend_fcall_info fci; zend_fcall_info_cache fci_cache = empty_fcall_info_cache; uint string_key_len; ulong num_key; @@ -4268,26 +4269,26 @@ PHP_FUNCTION(array_map) Checks if the given key or index exists in the array */ PHP_FUNCTION(array_key_exists) { - zval *key; /* key to check for */ - HashTable *array; /* array to check in */ + zval *key, /* key to check for */ + *array; /* array to check in */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zH", &key, &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za", &key, &array) == FAILURE) { return; } switch (Z_TYPE_P(key)) { case IS_STRING: - if (zend_symtable_exists(array, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1)) { + if (zend_symtable_exists(Z_ARRVAL_P(array), Z_STRVAL_P(key), Z_STRLEN_P(key) + 1)) { RETURN_TRUE; } RETURN_FALSE; case IS_LONG: - if (zend_hash_index_exists(array, Z_LVAL_P(key))) { + if (zend_hash_index_exists(Z_ARRVAL_P(array), Z_LVAL_P(key))) { RETURN_TRUE; } RETURN_FALSE; case IS_NULL: - if (zend_hash_exists(array, "", 1)) { + if (zend_hash_exists(Z_ARRVAL_P(array), "", 1)) { RETURN_TRUE; } RETURN_FALSE; diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 37ff546577..91eacb94a9 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -239,7 +239,7 @@ PHP_FUNCTION(assert) Set/get the various assert flags */ PHP_FUNCTION(assert_options) { - zval **value = NULL; + zval **value; long what; int oldint; int ac = ZEND_NUM_ARGS(); diff --git a/ext/standard/base64.c b/ext/standard/base64.c index faf2cae055..88fe8fa7eb 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -190,7 +190,7 @@ PHPAPI unsigned char *php_base64_decode_ex(const unsigned char *str, int length, case 2: k++; case 3: - result[k] = 0; + result[k++] = 0; } } if(ret_length) { diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 9742052e2a..253cdccc21 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -138,249 +138,303 @@ static void user_tick_function_dtor(user_tick_function_entry *tick_function_entr /* {{{ arginfo */ /* {{{ main/main.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_set_time_limit, 0) ZEND_ARG_INFO(0, seconds) ZEND_END_ARG_INFO() /* }}} */ /* {{{ main/output.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_start, 0, 0, 0) ZEND_ARG_INFO(0, user_function) ZEND_ARG_INFO(0, chunk_size) ZEND_ARG_INFO(0, flags) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ob_flush, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ob_clean, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ob_end_flush, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ob_end_clean, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ob_get_flush, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ob_get_clean, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ob_get_contents, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ob_get_level, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ob_get_length, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ob_list_handlers, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_get_status, 0, 0, 0) ZEND_ARG_INFO(0, full_status) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_implicit_flush, 0, 0, 0) ZEND_ARG_INFO(0, flag) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_output_reset_rewrite_vars, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_output_add_rewrite_var, 0) ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() /* }}} */ /* {{{ main/streams/userspace.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_wrapper_register, 0, 0, 2) ZEND_ARG_INFO(0, protocol) ZEND_ARG_INFO(0, classname) ZEND_ARG_INFO(0, flags) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_unregister, 0) ZEND_ARG_INFO(0, protocol) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_restore, 0) ZEND_ARG_INFO(0, protocol) ZEND_END_ARG_INFO() /* }}} */ /* {{{ array.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_krsort, 0, 0, 1) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, sort_flags) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_ksort, 0, 0, 1) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, sort_flags) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_count, 0, 0, 1) ZEND_ARG_INFO(0, var) ZEND_ARG_INFO(0, mode) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_natsort, 0) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_natcasesort, 0) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_asort, 0, 0, 1) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, sort_flags) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_arsort, 0, 0, 1) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, sort_flags) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_sort, 0, 0, 1) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, sort_flags) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_rsort, 0, 0, 1) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, sort_flags) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_usort, 0) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, cmp_function) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_uasort, 0) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, cmp_function) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_uksort, 0) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, cmp_function) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_end, 0) ZEND_ARG_INFO(1, arg) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_prev, 0) ZEND_ARG_INFO(1, arg) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_next, 0) ZEND_ARG_INFO(1, arg) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_reset, 0) ZEND_ARG_INFO(1, arg) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_current, ZEND_SEND_PREFER_REF) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_key, ZEND_SEND_PREFER_REF) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_min, 0, 0, 1) ZEND_ARG_INFO(0, arg1) ZEND_ARG_INFO(0, arg2) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_max, 0, 0, 1) ZEND_ARG_INFO(0, arg1) ZEND_ARG_INFO(0, arg2) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk, 0, 0, 2) ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, funcname) ZEND_ARG_INFO(0, userdata) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk_recursive, 0, 0, 2) ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, funcname) ZEND_ARG_INFO(0, userdata) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_in_array, 0, 0, 2) ZEND_ARG_INFO(0, needle) ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */ ZEND_ARG_INFO(0, strict) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_search, 0, 0, 2) ZEND_ARG_INFO(0, needle) ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */ ZEND_ARG_INFO(0, strict) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_extract, 0, 0, 1) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) /* ARRAY_INFO(0, arg, 0) */ + ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, extract_type) ZEND_ARG_INFO(0, prefix) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_compact, 0, 0, 1) ZEND_ARG_INFO(0, var_names) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_fill, 0) ZEND_ARG_INFO(0, start_key) ZEND_ARG_INFO(0, num) ZEND_ARG_INFO(0, val) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_fill_keys, 0) ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */ ZEND_ARG_INFO(0, val) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_range, 0, 0, 2) ZEND_ARG_INFO(0, low) ZEND_ARG_INFO(0, high) ZEND_ARG_INFO(0, step) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_shuffle, 0) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_push, 0, 0, 2) ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */ ZEND_ARG_INFO(0, var) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_pop, 0) ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_shift, 0) ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unshift, 0, 0, 2) ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */ ZEND_ARG_INFO(0, var) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_splice, 0, 0, 2) ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, offset) @@ -388,6 +442,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_splice, 0, 0, 2) ZEND_ARG_INFO(0, replacement) /* ARRAY_INFO(0, arg, 1) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_slice, 0, 0, 2) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(1, arg, 0) */ ZEND_ARG_INFO(0, offset) @@ -395,110 +450,130 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_slice, 0, 0, 2) ZEND_ARG_INFO(0, preserve_keys) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 2) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 2) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 2) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 2) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_keys, 0, 0, 1) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, search_value) ZEND_ARG_INFO(0, strict) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_values, 0) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_count_values, 0) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reverse, 0, 0, 1) ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, preserve_keys) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_pad, 0) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, pad_size) ZEND_ARG_INFO(0, pad_value) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_flip, 0) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_change_key_case, 0, 0, 1) ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, case) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_unique, 0) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_key, 0, 0, 2) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_ukey, 0) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, callback_key_compare_func) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect, 0, 0, 2) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect, 0) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, callback_data_compare_func) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_assoc, 0, 0, 2) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_assoc, 0) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, callback_data_compare_func) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_uassoc, 0) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, callback_key_compare_func) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_uassoc, 0) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ @@ -506,48 +581,56 @@ ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_uassoc, 0) ZEND_ARG_INFO(0, callback_key_compare_func) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_key, 0, 0, 2) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_diff_ukey, 0) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, callback_key_comp_func) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff, 0, 0, 2) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_udiff, 0) ZEND_ARG_INFO(0, arr1) ZEND_ARG_INFO(0, arr2) ZEND_ARG_INFO(0, callback_data_comp_func) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_assoc, 0, 0, 2) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_diff_uassoc, 0) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, callback_data_comp_func) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_assoc, 0) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ ZEND_ARG_INFO(0, callback_key_comp_func) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_uassoc, 0) ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */ @@ -555,6 +638,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_uassoc, 0) ZEND_ARG_INFO(0, callback_key_comp_func) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, ZEND_SEND_PREFER_REF, 0, 1) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC) @@ -564,30 +648,36 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, ZEND_SEND_PREFER_REF, 0, 1) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, num_req) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_sum, 0) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_product, 0) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reduce, 0, 0, 2) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, callback) ZEND_ARG_INFO(0, initial) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_filter, 0, 0, 1) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 3) ZEND_ARG_INFO(0, callback) ZEND_ARG_INFO(0, arg1) /* ARRAY_INFO(0, arg1, 0) */ @@ -595,101 +685,123 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 3) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_key_exists, 0) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, search) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_array_chunk, 0, 0, 2) ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */ ZEND_ARG_INFO(0, size) ZEND_ARG_INFO(0, preserve_keys) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_array_combine, 0) ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */ ZEND_ARG_INFO(0, values) /* ARRAY_INFO(0, values, 0) */ ZEND_END_ARG_INFO() /* }}} */ /* {{{ basic_functions.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_get_magic_quotes_gpc, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_get_magic_quotes_runtime, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_set_magic_quotes_runtime, 0, 0, 1) ZEND_ARG_INFO(0, new_setting) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_constant, 0) ZEND_ARG_INFO(0, const_name) ZEND_END_ARG_INFO() #ifdef HAVE_INET_NTOP +static ZEND_BEGIN_ARG_INFO(arginfo_inet_ntop, 0) ZEND_ARG_INFO(0, in_addr) ZEND_END_ARG_INFO() #endif #ifdef HAVE_INET_PTON +static ZEND_BEGIN_ARG_INFO(arginfo_inet_pton, 0) ZEND_ARG_INFO(0, ip_address) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO(arginfo_ip2long, 0) ZEND_ARG_INFO(0, ip_address) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_long2ip, 0) ZEND_ARG_INFO(0, proper_address) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_getenv, 0) ZEND_ARG_INFO(0, varname) ZEND_END_ARG_INFO() #ifdef HAVE_PUTENV +static ZEND_BEGIN_ARG_INFO(arginfo_putenv, 0) ZEND_ARG_INFO(0, setting) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO_EX(arginfo_getopt, 0, 0, 1) ZEND_ARG_INFO(0, options) ZEND_ARG_INFO(0, opts) /* ARRAY_INFO(0, opts, 1) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_flush, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_sleep, 0) ZEND_ARG_INFO(0, seconds) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_usleep, 0) ZEND_ARG_INFO(0, micro_seconds) ZEND_END_ARG_INFO() #if HAVE_NANOSLEEP +static ZEND_BEGIN_ARG_INFO(arginfo_time_nanosleep, 0) ZEND_ARG_INFO(0, seconds) ZEND_ARG_INFO(0, nanoseconds) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_time_sleep_until, 0) ZEND_ARG_INFO(0, timestamp) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO(arginfo_get_current_user, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_get_cfg_var, 0) ZEND_ARG_INFO(0, option_name) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_error_log, 0, 0, 1) ZEND_ARG_INFO(0, message) ZEND_ARG_INFO(0, message_type) @@ -697,20 +809,24 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_error_log, 0, 0, 1) ZEND_ARG_INFO(0, extra_headers) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_error_get_last, 0, 0, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func, 0, 0, 1) ZEND_ARG_INFO(0, function_name) ZEND_ARG_INFO(0, parmeter) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func_array, 0, 0, 2) ZEND_ARG_INFO(0, function_name) ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_method, 0, 0, 2) ZEND_ARG_INFO(0, method_name) ZEND_ARG_INFO(1, object) @@ -718,84 +834,103 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_method, 0, 0, 2) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_call_user_method_array, 0) ZEND_ARG_INFO(0, method_name) ZEND_ARG_INFO(1, object) ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call, 0, 0, 1) ZEND_ARG_INFO(0, function_name) ZEND_ARG_INFO(0, parameter) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call_array, 0, 0, 2) ZEND_ARG_INFO(0, function_name) ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_register_shutdown_function, 0) ZEND_ARG_INFO(0, function_name) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_file, 0, 0, 1) ZEND_ARG_INFO(0, file_name) ZEND_ARG_INFO(0, return) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_php_strip_whitespace, 0) ZEND_ARG_INFO(0, file_name) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_string, 0, 0, 1) ZEND_ARG_INFO(0, string) ZEND_ARG_INFO(0, return) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ini_get, 0) ZEND_ARG_INFO(0, varname) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_ini_get_all, 0, 0, 0) ZEND_ARG_INFO(0, extension) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ini_set, 0) ZEND_ARG_INFO(0, varname) ZEND_ARG_INFO(0, newvalue) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ini_restore, 0) ZEND_ARG_INFO(0, varname) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_set_include_path, 0) ZEND_ARG_INFO(0, new_include_path) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_get_include_path, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_restore_include_path, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_print_r, 0, 0, 1) ZEND_ARG_INFO(0, var) ZEND_ARG_INFO(0, return) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_connection_aborted, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_connection_status, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_ignore_user_abort, 0, 0, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() #if HAVE_GETSERVBYNAME +static ZEND_BEGIN_ARG_INFO(arginfo_getservbyname, 0) ZEND_ARG_INFO(0, service) ZEND_ARG_INFO(0, protocol) @@ -803,6 +938,7 @@ ZEND_END_ARG_INFO() #endif #if HAVE_GETSERVBYPORT +static ZEND_BEGIN_ARG_INFO(arginfo_getservbyport, 0) ZEND_ARG_INFO(0, port) ZEND_ARG_INFO(0, protocol) @@ -810,78 +946,86 @@ ZEND_END_ARG_INFO() #endif #if HAVE_GETPROTOBYNAME +static ZEND_BEGIN_ARG_INFO(arginfo_getprotobyname, 0) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() #endif #if HAVE_GETPROTOBYNUMBER +static ZEND_BEGIN_ARG_INFO(arginfo_getprotobynumber, 0) ZEND_ARG_INFO(0, proto) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO_EX(arginfo_register_tick_function, 0, 0, 1) ZEND_ARG_INFO(0, function_name) ZEND_ARG_INFO(0, arg) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_unregister_tick_function, 0) ZEND_ARG_INFO(0, function_name) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_uploaded_file, 0) ZEND_ARG_INFO(0, path) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_move_uploaded_file, 0) ZEND_ARG_INFO(0, path) ZEND_ARG_INFO(0, new_path) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_file, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, process_sections) ZEND_ARG_INFO(0, scanner_mode) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_string, 0, 0, 1) - ZEND_ARG_INFO(0, ini_string) - ZEND_ARG_INFO(0, process_sections) - ZEND_ARG_INFO(0, scanner_mode) -ZEND_END_ARG_INFO() - #if ZEND_DEBUG +static ZEND_BEGIN_ARG_INFO(arginfo_config_get_hash, 0) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO_EX(arginfo_import_request_variables, 0, 0, 1) ZEND_ARG_INFO(0, types) ZEND_ARG_INFO(0, prefix) ZEND_END_ARG_INFO() #ifdef HAVE_GETLOADAVG +static ZEND_BEGIN_ARG_INFO(arginfo_sys_getloadavg, 0) ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ assert.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_assert, 0) ZEND_ARG_INFO(0, assertion) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_assert_options, 0, 0, 1) ZEND_ARG_INFO(0, what) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() /* }}} */ /* {{{ base64.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_base64_encode, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_base64_decode, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, strict) @@ -889,12 +1033,14 @@ ZEND_END_ARG_INFO() /* }}} */ /* {{{ browscap.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_get_browser, 0, 0, 0) ZEND_ARG_INFO(0, browser_name) ZEND_ARG_INFO(0, return_array) ZEND_END_ARG_INFO() /* }}} */ /* {{{ crc32.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_crc32, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() @@ -902,6 +1048,7 @@ ZEND_END_ARG_INFO() /* }}} */ /* {{{ crypt.c */ #if HAVE_CRYPT +static ZEND_BEGIN_ARG_INFO_EX(arginfo_crypt, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, salt) @@ -909,6 +1056,7 @@ ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ cyr_convert.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_convert_cyr_string, 0) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, from) @@ -918,6 +1066,7 @@ ZEND_END_ARG_INFO() /* }}} */ /* {{{ datetime.c */ #if HAVE_STRPTIME +static ZEND_BEGIN_ARG_INFO(arginfo_strptime, 0) ZEND_ARG_INFO(0, timestamp) ZEND_ARG_INFO(0, format) @@ -925,48 +1074,58 @@ ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ dir.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_opendir, 0, 0, 1) ZEND_ARG_INFO(0, path) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_dir, 0, 0, 1) ZEND_ARG_INFO(0, directory) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_closedir, 0, 0, 0) ZEND_ARG_INFO(0, dir_handle) ZEND_END_ARG_INFO() #if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC +static ZEND_BEGIN_ARG_INFO(arginfo_chroot, 0) ZEND_ARG_INFO(0, directory) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO(arginfo_chdir, 0) ZEND_ARG_INFO(0, directory) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_getcwd, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_rewinddir, 0, 0, 0) ZEND_ARG_INFO(0, dir_handle) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_readdir, 0, 0, 0) ZEND_ARG_INFO(0, dir_handle) ZEND_END_ARG_INFO() #ifdef HAVE_GLOB +static ZEND_BEGIN_ARG_INFO_EX(arginfo_glob, 0, 0, 1) ZEND_ARG_INFO(0, pattern) ZEND_ARG_INFO(0, flags) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO_EX(arginfo_scandir, 0, 0, 1) ZEND_ARG_INFO(0, dir) ZEND_ARG_INFO(0, sorting_order) @@ -974,30 +1133,36 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_scandir, 0, 0, 1) ZEND_END_ARG_INFO() /* }}} */ /* {{{ arginfo ext/standard/dl.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_dl, 0) ZEND_ARG_INFO(0, extension_filename) ZEND_END_ARG_INFO() /* }}} */ /* {{{ dns.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_gethostbyaddr, 0) ZEND_ARG_INFO(0, ip_address) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_gethostbyname, 0) ZEND_ARG_INFO(0, hostname) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_gethostbynamel, 0) ZEND_ARG_INFO(0, hostname) ZEND_END_ARG_INFO() #if HAVE_RES_SEARCH && !(defined(__BEOS__)||defined(PHP_WIN32) || defined(NETWARE)) +static ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1) ZEND_ARG_INFO(0, host) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() # if HAVE_DNS_FUNCS +static ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_record, 1, 0, 1) ZEND_ARG_INFO(0, hostname) ZEND_ARG_INFO(0, type) @@ -1007,6 +1172,7 @@ ZEND_END_ARG_INFO() # endif # if HAVE_DN_SKIPNAME && HAVE_DN_EXPAND +static ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2) ZEND_ARG_INFO(0, hostname) ZEND_ARG_INFO(1, mxhosts) /* ARRAY_INFO(1, mxhosts, 1) */ @@ -1016,52 +1182,62 @@ ZEND_END_ARG_INFO() #endif /* HAVE_RES_SEARCH && !(defined(__BEOS__)||defined(PHP_WIN32) || defined(NETWARE)) */ /* }}} */ /* {{{ exec.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_exec, 0, 0, 1) ZEND_ARG_INFO(0, command) ZEND_ARG_INFO(1, output) /* ARRAY_INFO(1, output, 1) */ ZEND_ARG_INFO(1, return_value) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_system, 0, 0, 1) ZEND_ARG_INFO(0, command) ZEND_ARG_INFO(1, return_value) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_passthru, 0, 0, 1) ZEND_ARG_INFO(0, command) ZEND_ARG_INFO(1, return_value) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_escapeshellcmd, 0) ZEND_ARG_INFO(0, command) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_escapeshellarg, 0) ZEND_ARG_INFO(0, arg) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_shell_exec, 0) ZEND_ARG_INFO(0, cmd) ZEND_END_ARG_INFO() #ifdef HAVE_NICE +static ZEND_BEGIN_ARG_INFO(arginfo_proc_nice, 0) ZEND_ARG_INFO(0, priority) ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ file.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_flock, 0, 0, 2) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, operation) ZEND_ARG_INFO(1, wouldblock) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_get_meta_tags, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, use_include_path) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, flags) @@ -1070,6 +1246,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1) ZEND_ARG_INFO(0, maxlen) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_file_put_contents, 0, 0, 2) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, data) @@ -1077,20 +1254,24 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_file_put_contents, 0, 0, 2) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_file, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, flags) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_tempnam, 0) ZEND_ARG_INFO(0, dir) ZEND_ARG_INFO(0, prefix) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_tmpfile, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fopen, 0, 0, 2) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, mode) @@ -1098,68 +1279,82 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fopen, 0, 0, 2) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fclose, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_popen, 0) ZEND_ARG_INFO(0, command) ZEND_ARG_INFO(0, mode) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_pclose, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_feof, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fgets, 0, 0, 1) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, length) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fgetc, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetss, 0, 0, 1) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, length) ZEND_ARG_INFO(0, allowable_tags) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fscanf, 1, 0, 2) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, format) ZEND_ARG_INFO(1, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fwrite, 0, 0, 2) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, length) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fflush, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_rewind, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ftell, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fseek, 0, 0, 2) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, offset) ZEND_ARG_INFO(0, whence) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_mkdir, 0, 0, 1) ZEND_ARG_INFO(0, pathname) ZEND_ARG_INFO(0, mode) @@ -1167,54 +1362,65 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mkdir, 0, 0, 1) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_rmdir, 0, 0, 1) ZEND_ARG_INFO(0, dirname) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_readfile, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, flags) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_umask, 0, 0, 0) ZEND_ARG_INFO(0, mask) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fpassthru, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_rename, 0, 0, 2) ZEND_ARG_INFO(0, old_name) ZEND_ARG_INFO(0, new_name) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_unlink, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ftruncate, 0) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, size) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fstat, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_copy, 0) ZEND_ARG_INFO(0, source_file) ZEND_ARG_INFO(0, destination_file) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fread, 0) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, length) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fputcsv, 0, 0, 2) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, fields) /* ARRAY_INFO(0, fields, 1) */ @@ -1222,6 +1428,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fputcsv, 0, 0, 2) ZEND_ARG_INFO(0, enclosure) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetcsv, 0, 0, 1) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, length) @@ -1230,12 +1437,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetcsv, 0, 0, 1) ZEND_END_ARG_INFO() #if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS) +static ZEND_BEGIN_ARG_INFO(arginfo_realpath, 0) ZEND_ARG_INFO(0, path) ZEND_END_ARG_INFO() #endif #ifdef HAVE_FNMATCH +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fnmatch, 0, 0, 2) ZEND_ARG_INFO(0, pattern) ZEND_ARG_INFO(0, filename) @@ -1243,24 +1452,29 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fnmatch, 0, 0, 2) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO(arginfo_sys_get_temp_dir, 0) ZEND_END_ARG_INFO() /* }}} */ /* {{{ filestat.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_disk_total_space, 0) ZEND_ARG_INFO(0, path) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_disk_free_space, 0) ZEND_ARG_INFO(0, path) ZEND_END_ARG_INFO() #ifndef NETWARE +static ZEND_BEGIN_ARG_INFO(arginfo_chgrp, 0) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, group) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_chown, 0) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, user) @@ -1268,23 +1482,27 @@ ZEND_END_ARG_INFO() #endif #if HAVE_LCHOWN +static ZEND_BEGIN_ARG_INFO(arginfo_lchgrp, 0) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, group) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_lchown, 0) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, user) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO(arginfo_chmod, 0) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, mode) ZEND_END_ARG_INFO() #if HAVE_UTIME +static ZEND_BEGIN_ARG_INFO_EX(arginfo_touch, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, time) @@ -1292,106 +1510,130 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_touch, 0, 0, 1) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO_EX(arginfo_clearstatcache, 0, 0, 0) ZEND_ARG_INFO(0, clear_realpath_cache) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fileperms, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fileinode, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_filesize, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fileowner, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_filegroup, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fileatime, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_filemtime, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_filectime, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_filetype, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_writable, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_readable, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_executable, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_file, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_dir, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_link, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_file_exists, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_lstat, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stat, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() /* }}} */ /* {{{ formatted_print.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_sprintf, 0, 0, 2) ZEND_ARG_INFO(0, format) ZEND_ARG_INFO(0, arg1) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_vsprintf, 0) ZEND_ARG_INFO(0, format) ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_printf, 0, 0, 1) ZEND_ARG_INFO(0, format) ZEND_ARG_INFO(0, arg1) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_vprintf, 0) ZEND_ARG_INFO(0, format) ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fprintf, 0, 0, 2) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, format) @@ -1399,6 +1641,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fprintf, 0, 0, 2) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_vfprintf, 0) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, format) @@ -1406,6 +1649,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_vfprintf, 0) ZEND_END_ARG_INFO() /* }}} */ /* {{{ fsock.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 2) ZEND_ARG_INFO(0, hostname) ZEND_ARG_INFO(0, port) @@ -1414,6 +1658,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 2) ZEND_ARG_INFO(0, timeout) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_pfsockopen, 0, 0, 2) ZEND_ARG_INFO(0, hostname) ZEND_ARG_INFO(0, port) @@ -1424,6 +1669,7 @@ ZEND_END_ARG_INFO() /* }}} */ /* {{{ ftok.c */ #if HAVE_FTOK +static ZEND_BEGIN_ARG_INFO(arginfo_ftok, 0) ZEND_ARG_INFO(0, pathname) ZEND_ARG_INFO(0, proj) @@ -1431,16 +1677,14 @@ ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ head.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_header, 0, 0, 1) ZEND_ARG_INFO(0, header) ZEND_ARG_INFO(0, replace) ZEND_ARG_INFO(0, http_response_code) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_header_remove, 0, 0, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - +static ZEND_BEGIN_ARG_INFO_EX(arginfo_setcookie, 0, 0, 1) ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, value) @@ -1450,6 +1694,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_setcookie, 0, 0, 1) ZEND_ARG_INFO(0, secure) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_setrawcookie, 0, 0, 1) ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, value) @@ -1459,15 +1704,18 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_setrawcookie, 0, 0, 1) ZEND_ARG_INFO(0, secure) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_headers_sent, 0, 0, 0) ZEND_ARG_INFO(1, file) ZEND_ARG_INFO(1, line) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_headers_list, 0) ZEND_END_ARG_INFO() /* }}} */ /* {{{ html.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars, 0, 0, 1) ZEND_ARG_INFO(0, string) ZEND_ARG_INFO(0, quote_style) @@ -1475,17 +1723,20 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars, 0, 0, 1) ZEND_ARG_INFO(0, double_encode) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars_decode, 0, 0, 1) ZEND_ARG_INFO(0, string) ZEND_ARG_INFO(0, quote_style) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_html_entity_decode, 0, 0, 1) ZEND_ARG_INFO(0, string) ZEND_ARG_INFO(0, quote_style) ZEND_ARG_INFO(0, charset) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlentities, 0, 0, 1) ZEND_ARG_INFO(0, string) ZEND_ARG_INFO(0, quote_style) @@ -1493,6 +1744,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlentities, 0, 0, 1) ZEND_ARG_INFO(0, double_encode) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_get_html_translation_table, 0, 0, 0) ZEND_ARG_INFO(0, table) ZEND_ARG_INFO(0, quote_style) @@ -1500,6 +1752,7 @@ ZEND_END_ARG_INFO() /* }}} */ /* {{{ http.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_http_build_query, 0, 0, 1) ZEND_ARG_INFO(0, formdata) ZEND_ARG_INFO(0, prefix) @@ -1507,73 +1760,91 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_http_build_query, 0, 0, 1) ZEND_END_ARG_INFO() /* }}} */ /* {{{ image.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_image_type_to_mime_type, 0) ZEND_ARG_INFO(0, imagetype) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_image_type_to_extension, 0, 0, 1) ZEND_ARG_INFO(0, imagetype) ZEND_ARG_INFO(0, include_dot) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_getimagesize, 0, 0, 1) ZEND_ARG_INFO(0, imagefile) ZEND_ARG_INFO(1, info) /* ARRAY_INFO(1, info, 1) */ ZEND_END_ARG_INFO() /* }}} */ /* {{{ info.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_phpinfo, 0, 0, 0) ZEND_ARG_INFO(0, what) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_phpversion, 0, 0, 0) ZEND_ARG_INFO(0, extension) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_phpcredits, 0, 0, 0) ZEND_ARG_INFO(0, flag) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_php_logo_guid, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_php_real_logo_guid, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_php_egg_logo_guid, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_zend_logo_guid, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_php_sapi_name, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_php_uname, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_php_ini_scanned_files, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_php_ini_loaded_file, 0) ZEND_END_ARG_INFO() /* }}} */ /* {{{ iptc.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_iptcembed, 0, 0, 2) ZEND_ARG_INFO(0, iptcdata) ZEND_ARG_INFO(0, jpeg_file_name) ZEND_ARG_INFO(0, spool) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_iptcparse, 0) ZEND_ARG_INFO(0, iptcdata) ZEND_END_ARG_INFO() /* }}} */ /* {{{ lcg.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_lcg_value, 0) ZEND_END_ARG_INFO() /* }}} */ /* {{{ levenshtein.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_levenshtein, 0) ZEND_ARG_INFO(0, str1) ZEND_ARG_INFO(0, str2) @@ -1584,19 +1855,23 @@ ZEND_END_ARG_INFO() /* }}} */ /* {{{ link.c */ #ifdef HAVE_SYMLINK +static ZEND_BEGIN_ARG_INFO(arginfo_readlink, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_linkinfo, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_symlink, 0) ZEND_ARG_INFO(0, target) ZEND_ARG_INFO(0, link) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_link, 0) ZEND_ARG_INFO(0, target) ZEND_ARG_INFO(0, link) @@ -1604,10 +1879,12 @@ ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ mail.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_ezmlm_hash, 0) ZEND_ARG_INFO(0, addr) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_mail, 0, 0, 3) ZEND_ARG_INFO(0, to) ZEND_ARG_INFO(0, subject) @@ -1617,165 +1894,203 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mail, 0, 0, 3) ZEND_END_ARG_INFO() /* }}} */ /* {{{ math.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_abs, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ceil, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_floor, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_round, 0, 0, 1) ZEND_ARG_INFO(0, number) ZEND_ARG_INFO(0, precision) - ZEND_ARG_INFO(0, mode) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_sin, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_cos, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_tan, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_asin, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_acos, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_atan, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_atan2, 0) ZEND_ARG_INFO(0, y) ZEND_ARG_INFO(0, x) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_sinh, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_cosh, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_tanh, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_asinh, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_acosh, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_atanh, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_pi, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_finite, 0) ZEND_ARG_INFO(0, val) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_infinite, 0) ZEND_ARG_INFO(0, val) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_nan, 0) ZEND_ARG_INFO(0, val) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_pow, 0) ZEND_ARG_INFO(0, base) ZEND_ARG_INFO(0, exponent) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_exp, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_expm1, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_log1p, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_log, 0, 0, 1) ZEND_ARG_INFO(0, number) ZEND_ARG_INFO(0, base) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_log10, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_sqrt, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_hypot, 0) ZEND_ARG_INFO(0, num1) ZEND_ARG_INFO(0, num2) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_deg2rad, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_rad2deg, 0) ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_bindec, 0) ZEND_ARG_INFO(0, binary_number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_hexdec, 0) ZEND_ARG_INFO(0, hexadecimal_number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_octdec, 0) ZEND_ARG_INFO(0, octal_number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_decbin, 0) ZEND_ARG_INFO(0, decimal_number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_decoct, 0) ZEND_ARG_INFO(0, decimal_number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_dechex, 0) ZEND_ARG_INFO(0, decimal_number) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_base_convert, 0) ZEND_ARG_INFO(0, number) ZEND_ARG_INFO(0, frombase) ZEND_ARG_INFO(0, tobase) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_number_format, 0, 0, 1) ZEND_ARG_INFO(0, number) ZEND_ARG_INFO(0, num_decimal_places) @@ -1783,23 +2098,27 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_number_format, 0, 0, 1) ZEND_ARG_INFO(0, thousands_seperator) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_fmod, 0) ZEND_ARG_INFO(0, x) ZEND_ARG_INFO(0, y) ZEND_END_ARG_INFO() /* }}} */ /* {{{ md5.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_md5, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, raw_output) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_md5_file, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, raw_output) ZEND_END_ARG_INFO() /* }}} */ /* {{{ metaphone.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_metaphone, 0, 0, 1) ZEND_ARG_INFO(0, text) ZEND_ARG_INFO(0, phones) @@ -1807,64 +2126,78 @@ ZEND_END_ARG_INFO() /* }}} */ /* {{{ microtime.c */ #ifdef HAVE_GETTIMEOFDAY +static ZEND_BEGIN_ARG_INFO_EX(arginfo_microtime, 0, 0, 0) ZEND_ARG_INFO(0, get_as_float) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_gettimeofday, 0, 0, 0) ZEND_ARG_INFO(0, get_as_float) ZEND_END_ARG_INFO() #endif #ifdef HAVE_GETRUSAGE +static ZEND_BEGIN_ARG_INFO_EX(arginfo_getrusage, 0, 0, 0) ZEND_ARG_INFO(0, who) ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ pack.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_pack, 0, 0, 2) ZEND_ARG_INFO(0, format) ZEND_ARG_INFO(0, arg1) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_unpack, 0) ZEND_ARG_INFO(0, format) ZEND_ARG_INFO(0, input) ZEND_END_ARG_INFO() /* }}} */ /* {{{ pageinfo.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_getmyuid, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_getmygid, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_getmypid, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_getmyinode, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_getlastmod, 0) ZEND_END_ARG_INFO() /* }}} */ /* {{{ proc_open.c */ #ifdef PHP_CAN_SUPPORT_PROC_OPEN +static ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_terminate, 0, 0, 1) ZEND_ARG_INFO(0, process) ZEND_ARG_INFO(0, signal) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_proc_close, 0) ZEND_ARG_INFO(0, process) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_proc_get_status, 0) ZEND_ARG_INFO(0, process) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_open, 0, 0, 3) ZEND_ARG_INFO(0, command) ZEND_ARG_INFO(0, descriptorspec) /* ARRAY_INFO(0, descriptorspec, 1) */ @@ -1876,58 +2209,70 @@ ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ quot_print.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_decode, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() /* }}} */ /* {{{ quot_print.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_encode, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() /* }}} */ /* {{{ rand.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_srand, 0, 0, 0) ZEND_ARG_INFO(0, seed) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_srand, 0, 0, 0) ZEND_ARG_INFO(0, seed) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_rand, 0, 0, 0) ZEND_ARG_INFO(0, min) ZEND_ARG_INFO(0, max) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_rand, 0, 0, 0) ZEND_ARG_INFO(0, min) ZEND_ARG_INFO(0, max) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_getrandmax, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0) ZEND_END_ARG_INFO() /* }}} */ /* {{{ sha1.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, raw_output) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1_file, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, raw_output) ZEND_END_ARG_INFO() /* }}} */ /* {{{ soundex.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_soundex, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() /* }}} */ /* {{{ streamsfuncs.c */ #if HAVE_SOCKETPAIR +static ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_pair, 0) ZEND_ARG_INFO(0, domain) ZEND_ARG_INFO(0, type) @@ -1935,6 +2280,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_pair, 0) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_client, 0, 0, 1) ZEND_ARG_INFO(0, remoteaddress) ZEND_ARG_INFO(1, errcode) @@ -1944,6 +2290,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_client, 0, 0, 1) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_server, 0, 0, 1) ZEND_ARG_INFO(0, localaddress) ZEND_ARG_INFO(1, errcode) @@ -1952,17 +2299,20 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_server, 0, 0, 1) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_accept, 0, 0, 1) ZEND_ARG_INFO(0, serverstream) ZEND_ARG_INFO(0, timeout) ZEND_ARG_INFO(1, peername) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_get_name, 0) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, want_peer) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_sendto, 0, 0, 2) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, data) @@ -1970,6 +2320,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_sendto, 0, 0, 2) ZEND_ARG_INFO(0, target_addr) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_recvfrom, 0, 0, 2) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, amount) @@ -1977,12 +2328,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_recvfrom, 0, 0, 2) ZEND_ARG_INFO(1, remote_addr) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_contents, 0, 0, 1) ZEND_ARG_INFO(0, source) ZEND_ARG_INFO(0, maxlen) ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_copy_to_stream, 0, 0, 2) ZEND_ARG_INFO(0, source) ZEND_ARG_INFO(0, dest) @@ -1990,24 +2343,30 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_copy_to_stream, 0, 0, 2) ZEND_ARG_INFO(0, pos) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_get_meta_data, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_get_transports, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_get_wrappers, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_is_local, 0) ZEND_ARG_INFO(0, stream) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_supports_lock, 0, 0, 1) ZEND_ARG_INFO(0, stream) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_select, 0, 0, 4) ZEND_ARG_INFO(1, read_streams) /* ARRAY_INFO(1, read_streams, 1) */ ZEND_ARG_INFO(1, write_streams) /* ARRAY_INFO(1, write_streams, 1) */ @@ -2016,10 +2375,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_select, 0, 0, 4) ZEND_ARG_INFO(0, tv_usec) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_context_get_options, 0) ZEND_ARG_INFO(0, stream_or_context) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_option, 0) ZEND_ARG_INFO(0, stream_or_context) ZEND_ARG_INFO(0, wrappername) @@ -2027,28 +2388,29 @@ ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_option, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_params, 0) ZEND_ARG_INFO(0, stream_or_context) ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */ ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_params, 0, ZEND_RETURN_VALUE, 1) - ZEND_ARG_INFO(0, stream_or_context) -ZEND_END_ARG_INFO() - +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_default, 0, 0, 0) ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_default, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_create, 0, 0, 0) ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */ ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */ ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_prepend, 0, 0, 2) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, filtername) @@ -2056,6 +2418,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_prepend, 0, 0, 2) ZEND_ARG_INFO(0, filterparams) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_append, 0, 0, 2) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, filtername) @@ -2063,22 +2426,26 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_append, 0, 0, 2) ZEND_ARG_INFO(0, filterparams) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_remove, 0) ZEND_ARG_INFO(0, stream_filter) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_line, 0, 0, 2) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, maxlen) ZEND_ARG_INFO(0, ending) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_set_blocking, 0) ZEND_ARG_INFO(0, socket) ZEND_ARG_INFO(0, mode) ZEND_END_ARG_INFO() #if HAVE_SYS_TIME_H || defined(PHP_WIN32) +static ZEND_BEGIN_ARG_INFO(arginfo_stream_set_timeout, 0) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, seconds) @@ -2086,11 +2453,13 @@ ZEND_BEGIN_ARG_INFO(arginfo_stream_set_timeout, 0) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO(arginfo_stream_set_write_buffer, 0) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, buffer) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_enable_crypto, 0, 0, 2) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, enable) @@ -2099,6 +2468,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_enable_crypto, 0, 0, 2) ZEND_END_ARG_INFO() #ifdef HAVE_SHUTDOWN +static ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_shutdown, 0) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, how) @@ -2106,10 +2476,12 @@ ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ string.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_bin2hex, 0) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_strspn, 0, 0, 2) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, mask) @@ -2117,6 +2489,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_strspn, 0, 0, 2) ZEND_ARG_INFO(0, len) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_strcspn, 0, 0, 2) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, mask) @@ -2125,33 +2498,39 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_strcspn, 0, 0, 2) ZEND_END_ARG_INFO() #if HAVE_NL_LANGINFO +static ZEND_BEGIN_ARG_INFO(arginfo_nl_langinfo, 0) ZEND_ARG_INFO(0, item) ZEND_END_ARG_INFO() #endif #ifdef HAVE_STRCOLL +static ZEND_BEGIN_ARG_INFO(arginfo_strcoll, 0) ZEND_ARG_INFO(0, str1) ZEND_ARG_INFO(0, str2) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO_EX(arginfo_trim, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, character_mask) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_rtrim, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, character_mask) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_ltrim, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, character_mask) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_wordwrap, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, width) @@ -2159,97 +2538,115 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_wordwrap, 0, 0, 1) ZEND_ARG_INFO(0, cut) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_explode, 0, 0, 2) ZEND_ARG_INFO(0, separator) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, limit) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_implode, 0) ZEND_ARG_INFO(0, glue) ZEND_ARG_INFO(0, pieces) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_strtok, 0) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, token) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_strtoupper, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_strtolower, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_basename, 0, 0, 1) ZEND_ARG_INFO(0, path) ZEND_ARG_INFO(0, suffix) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_dirname, 0) ZEND_ARG_INFO(0, path) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_pathinfo, 0, 0, 1) ZEND_ARG_INFO(0, path) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stristr, 0, 0, 2) ZEND_ARG_INFO(0, haystack) ZEND_ARG_INFO(0, needle) ZEND_ARG_INFO(0, part) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_strstr, 0, 0, 2) ZEND_ARG_INFO(0, haystack) ZEND_ARG_INFO(0, needle) ZEND_ARG_INFO(0, part) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_strpos, 0, 0, 2) ZEND_ARG_INFO(0, haystack) ZEND_ARG_INFO(0, needle) ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_stripos, 0, 0, 2) ZEND_ARG_INFO(0, haystack) ZEND_ARG_INFO(0, needle) ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_strrpos, 0, 0, 2) ZEND_ARG_INFO(0, haystack) ZEND_ARG_INFO(0, needle) ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_strripos, 0, 0, 2) ZEND_ARG_INFO(0, haystack) ZEND_ARG_INFO(0, needle) ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_strrchr, 0) ZEND_ARG_INFO(0, haystack) ZEND_ARG_INFO(0, needle) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_chunk_split, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, chunklen) ZEND_ARG_INFO(0, ending) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_substr, 0, 0, 2) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, start) ZEND_ARG_INFO(0, length) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_replace, 0, 0, 3) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, replace) @@ -2257,63 +2654,77 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_replace, 0, 0, 3) ZEND_ARG_INFO(0, length) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_quotemeta, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ord, 0) ZEND_ARG_INFO(0, character) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_chr, 0) ZEND_ARG_INFO(0, codepoint) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ucfirst, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_lcfirst, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_ucwords, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_strtr, 0, 0, 2) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, from) ZEND_ARG_INFO(0, to) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_strrev, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_similar_text, 0, 0, 2) ZEND_ARG_INFO(0, str1) ZEND_ARG_INFO(0, str2) ZEND_ARG_INFO(1, percent) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_addcslashes, 0) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, charlist) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_addslashes, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stripcslashes, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stripslashes, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_str_replace, 0, 0, 3) ZEND_ARG_INFO(0, search) ZEND_ARG_INFO(0, replace) @@ -2321,6 +2732,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_str_replace, 0, 0, 3) ZEND_ARG_INFO(1, replace_count) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_str_ireplace, 0, 0, 3) ZEND_ARG_INFO(0, search) ZEND_ARG_INFO(0, replace) @@ -2328,67 +2740,72 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_str_ireplace, 0, 0, 3) ZEND_ARG_INFO(1, replace_count) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrev, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, max_chars_per_line) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrevc, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, max_chars_per_line) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_nl2br, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, is_xhtml) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_strip_tags, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, allowable_tags) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_setlocale, 0, 0, 2) ZEND_ARG_INFO(0, category) ZEND_ARG_INFO(0, locale) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_str, 0, 0, 1) ZEND_ARG_INFO(0, encoded_string) ZEND_ARG_INFO(1, result) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_str_getcsv, 0, 0, 1) - ZEND_ARG_INFO(0, string) - ZEND_ARG_INFO(0, delimiter) - ZEND_ARG_INFO(0, enclosure) - ZEND_ARG_INFO(0, escape) -ZEND_END_ARG_INFO() - +static ZEND_BEGIN_ARG_INFO(arginfo_str_repeat, 0) ZEND_ARG_INFO(0, input) ZEND_ARG_INFO(0, mult) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_count_chars, 0, 0, 1) ZEND_ARG_INFO(0, input) ZEND_ARG_INFO(0, mode) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_strnatcmp, 0) ZEND_ARG_INFO(0, s1) ZEND_ARG_INFO(0, s2) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_localeconv, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_strnatcasecmp, 0) ZEND_ARG_INFO(0, s1) ZEND_ARG_INFO(0, s2) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_count, 0, 0, 2) ZEND_ARG_INFO(0, haystack) ZEND_ARG_INFO(0, needle) @@ -2396,6 +2813,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_count, 0, 0, 2) ZEND_ARG_INFO(0, length) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_str_pad, 0, 0, 2) ZEND_ARG_INFO(0, input) ZEND_ARG_INFO(0, pad_length) @@ -2403,20 +2821,24 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_str_pad, 0, 0, 2) ZEND_ARG_INFO(0, pad_type) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_sscanf, 1, 0, 2) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, format) ZEND_ARG_INFO(1, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_str_rot13, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_str_shuffle, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_str_word_count, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, format) @@ -2424,22 +2846,26 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_str_word_count, 0, 0, 1) ZEND_END_ARG_INFO() #ifdef HAVE_STRFMON +static ZEND_BEGIN_ARG_INFO(arginfo_money_format, 0) ZEND_ARG_INFO(0, format) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() #endif +static ZEND_BEGIN_ARG_INFO_EX(arginfo_str_split, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, split_length) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_strpbrk, 0, 0, 1) ZEND_ARG_INFO(0, haystack) ZEND_ARG_INFO(0, char_list) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_compare, 0, 0, 3) ZEND_ARG_INFO(0, main_str) ZEND_ARG_INFO(0, str) @@ -2450,18 +2876,22 @@ ZEND_END_ARG_INFO() /* }}} */ /* {{{ syslog.c */ #ifdef HAVE_SYSLOG_H +static ZEND_BEGIN_ARG_INFO(arginfo_define_syslog_variables, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_openlog, 0) ZEND_ARG_INFO(0, ident) ZEND_ARG_INFO(0, option) ZEND_ARG_INFO(0, facility) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_closelog, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_syslog, 0) ZEND_ARG_INFO(0, priority) ZEND_ARG_INFO(0, message) @@ -2469,68 +2899,84 @@ ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ type.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_gettype, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_settype, 0) ZEND_ARG_INFO(1, var) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_intval, 0, 0, 1) ZEND_ARG_INFO(0, var) ZEND_ARG_INFO(0, base) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_floatval, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_strval, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_null, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_resource, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_bool, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_long, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_float, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_string, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_array, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_object, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_numeric, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_is_scalar, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_is_callable, 0, 0, 1) ZEND_ARG_INFO(0, var) ZEND_ARG_INFO(0, syntax_only) @@ -2539,6 +2985,7 @@ ZEND_END_ARG_INFO() /* }}} */ /* {{{ uniqid.c */ #ifdef HAVE_GETTIMEOFDAY +static ZEND_BEGIN_ARG_INFO_EX(arginfo_uniqid, 0, 0, 0) ZEND_ARG_INFO(0, prefix) ZEND_ARG_INFO(0, more_entropy) @@ -2546,102 +2993,124 @@ ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ url.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_url, 0, 0, 1) ZEND_ARG_INFO(0, url) ZEND_ARG_INFO(0, component) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_urlencode, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_urldecode, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_rawurlencode, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_rawurldecode, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_get_headers, 0, 0, 1) ZEND_ARG_INFO(0, url) ZEND_ARG_INFO(0, format) ZEND_END_ARG_INFO() /* }}} */ /* {{{ user_filters.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_make_writeable, 0) ZEND_ARG_INFO(0, brigade) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_prepend, 0) ZEND_ARG_INFO(0, brigade) ZEND_ARG_INFO(0, bucket) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_append, 0) ZEND_ARG_INFO(0, brigade) ZEND_ARG_INFO(0, bucket) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_new, 0) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, buffer) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_get_filters, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_register, 0) ZEND_ARG_INFO(0, filtername) ZEND_ARG_INFO(0, classname) ZEND_END_ARG_INFO() /* }}} */ /* {{{ uuencode.c */ +static ZEND_BEGIN_ARG_INFO(arginfo_convert_uuencode, 0) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_convert_uudecode, 0) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() /* }}} */ /* {{{ var.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_var_dump, 0, 0, 1) ZEND_ARG_INFO(0, var) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_debug_zval_dump, 0, 0, 1) ZEND_ARG_INFO(0, var) ZEND_ARG_INFO(0, ...) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_var_export, 0, 0, 1) ZEND_ARG_INFO(0, var) ZEND_ARG_INFO(0, return) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_serialize, 0) ZEND_ARG_INFO(0, var) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_unserialize, 0) ZEND_ARG_INFO(0, variable_representation) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_usage, 0, 0, 0) ZEND_ARG_INFO(0, real_usage) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_peak_usage, 0, 0, 0) ZEND_ARG_INFO(0, real_usage) ZEND_END_ARG_INFO() /* }}} */ /* {{{ versioning.c */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_version_compare, 0, 0, 2) ZEND_ARG_INFO(0, ver1) ZEND_ARG_INFO(0, ver2) @@ -2767,7 +3236,6 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(chr, arginfo_chr) PHP_FE(ord, arginfo_ord) PHP_FE(parse_str, arginfo_parse_str) - PHP_FE(str_getcsv, arginfo_str_getcsv) PHP_FE(str_pad, arginfo_str_pad) PHP_FALIAS(chop, rtrim, arginfo_rtrim) PHP_FALIAS(strchr, strstr, arginfo_strstr) @@ -2970,7 +3438,6 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(setcookie, arginfo_setcookie) PHP_FE(setrawcookie, arginfo_setrawcookie) PHP_FE(header, arginfo_header) - PHP_FE(header_remove, arginfo_header_remove) PHP_FE(headers_sent, arginfo_headers_sent) PHP_FE(headers_list, arginfo_headers_list) @@ -2978,7 +3445,6 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(connection_status, arginfo_connection_status) PHP_FE(ignore_user_abort, arginfo_ignore_user_abort) PHP_FE(parse_ini_file, arginfo_parse_ini_file) - PHP_FE(parse_ini_string, arginfo_parse_ini_string) #if ZEND_DEBUG PHP_FE(config_get_hash, arginfo_config_get_hash) #endif @@ -3061,7 +3527,6 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(stream_select, arginfo_stream_select) PHP_FE(stream_context_create, arginfo_stream_context_create) PHP_FE(stream_context_set_params, arginfo_stream_context_set_params) - PHP_FE(stream_context_get_params, arginfo_stream_context_get_params) PHP_FE(stream_context_set_option, arginfo_stream_context_set_option) PHP_FE(stream_context_get_options, arginfo_stream_context_get_options) PHP_FE(stream_context_get_default, arginfo_stream_context_get_default) @@ -3203,7 +3668,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(openlog, arginfo_openlog) PHP_FE(syslog, arginfo_syslog) PHP_FE(closelog, arginfo_closelog) - PHP_DEP_FE(define_syslog_variables, arginfo_define_syslog_variables) + PHP_FE(define_syslog_variables, arginfo_define_syslog_variables) #endif /* functions from lcg.c */ @@ -3459,8 +3924,6 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC) /* #endif BG(incomplete_class) = incomplete_class_entry; - BG(page_uid) = -1; - BG(page_gid) = -1; } /* }}} */ @@ -3572,11 +4035,6 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */ REGISTER_DOUBLE_CONSTANT("INF", php_get_inf(), CONST_CS | CONST_PERSISTENT); REGISTER_DOUBLE_CONSTANT("NAN", php_get_nan(), CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_UP", PHP_ROUND_HALF_UP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_DOWN", PHP_ROUND_HALF_DOWN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_EVEN", PHP_ROUND_HALF_EVEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_ODD", PHP_ROUND_HALF_ODD, CONST_CS | CONST_PERSISTENT); - #if ENABLE_TEST_CLASS test_class_startup(); #endif @@ -3685,7 +4143,6 @@ PHP_RINIT_FUNCTION(basic) /* {{{ */ memset(BG(strtok_table), 0, 256); BG(strtok_string) = NULL; BG(strtok_zval) = NULL; - BG(strtok_last) = NULL; BG(locale_string) = NULL; BG(array_walk_fci) = empty_fcall_info; BG(array_walk_fci_cache) = empty_fcall_info_cache; @@ -3774,8 +4231,6 @@ PHP_RSHUTDOWN_FUNCTION(basic) /* {{{ */ PHP_RSHUTDOWN(user_filters)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - BG(page_uid) = -1; - BG(page_gid) = -1; return SUCCESS; } /* }}} */ @@ -4604,7 +5059,6 @@ error options: 1 = send via email to 3rd parameter 4th option = additional headers 2 = send via tcp/ip to 3rd parameter (name or ip:port) 3 = save to file in 3rd parameter - 4 = send to SAPI logger directly */ /* {{{ proto bool error_log(string message [, int message_type [, string destination [, string extra_headers]]]) @@ -4612,9 +5066,9 @@ error options: PHP_FUNCTION(error_log) { char *message, *opt = NULL, *headers = NULL; - int message_len, opt_len = 0, headers_len = 0; + int message_len, opt_len, headers_len; int opt_err = 0, argc = ZEND_NUM_ARGS(); - long erropt = 0; + long erropt; if (zend_parse_parameters(argc TSRMLS_CC, "s|lss", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) { return; @@ -4658,13 +5112,7 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T php_stream_write(stream, message, strlen(message)); php_stream_close(stream); break; - case 4: /* send to SAPI */ - if (sapi_module.log_message) { - sapi_module.log_message(message); - } else { - return FAILURE; - } - break; + default: php_log_err(message TSRMLS_CC); break; @@ -4781,7 +5229,7 @@ PHP_FUNCTION(call_user_method_array) HashTable *params_ar; int num_elems, element = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/zA/", &callback, &object, ¶ms) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/za/", &callback, &object, ¶ms) == FAILURE) { return; } @@ -5500,7 +5948,7 @@ PHP_FUNCTION(connection_status) PHP_FUNCTION(ignore_user_abort) { char *arg = NULL; - int arg_len = 0; + int arg_len; int old_setting; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) { @@ -5919,43 +6367,6 @@ PHP_FUNCTION(parse_ini_file) } /* }}} */ -/* {{{ proto array parse_ini_string(string ini_string [, bool process_sections [, int scanner_mode]]) - Parse configuration string */ -PHP_FUNCTION(parse_ini_string) -{ - char *string = NULL, *str = NULL; - int str_len = 0; - zend_bool process_sections = 0; - long scanner_mode = ZEND_INI_SCANNER_NORMAL; - zend_ini_parser_cb_t ini_parser_cb; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) { - RETURN_FALSE; - } - - /* Set callback function */ - if (process_sections) { - BG(active_ini_file_section) = NULL; - ini_parser_cb = (zend_ini_parser_cb_t) php_ini_parser_cb_with_sections; - } else { - ini_parser_cb = (zend_ini_parser_cb_t) php_simple_ini_parser_cb; - } - - /* Setup string */ - string = (char *) emalloc(str_len + ZEND_MMAP_AHEAD); - memcpy(string, str, str_len); - memset(string + str_len, 0, ZEND_MMAP_AHEAD); - - array_init(return_value); - if (zend_parse_ini_string(string, 0, scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) { - zend_hash_destroy(Z_ARRVAL_P(return_value)); - efree(Z_ARRVAL_P(return_value)); - RETVAL_FALSE; - } - efree(string); -} -/* }}} */ - #if ZEND_DEBUG /* This function returns an array of ALL valid ini options with values and * is not the same as ini_get_all() which returns only registered ini options. Only useful for devs to debug php.ini scanner/parser! */ diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index f50776ff65..b8768dc0c6 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -127,7 +127,6 @@ PHP_FUNCTION(move_uploaded_file); /* From the INI parser */ PHP_FUNCTION(parse_ini_file); -PHP_FUNCTION(parse_ini_string); #if ZEND_DEBUG PHP_FUNCTION(config_get_hash); #endif diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 8c96f709cd..8e4e5f3895 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -326,7 +326,7 @@ static int browser_reg_compare(zval **browser TSRMLS_DC, int num_args, va_list a PHP_FUNCTION(get_browser) { char *agent_name = NULL; - int agent_name_len = 0; + int agent_name_len; zend_bool return_array = 0; zval **agent, **z_agent_name; zval *found_browser_entry, *tmp_copy; diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 50bd1dc7af..125e7266a3 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -223,6 +223,31 @@ AC_FUNC_FNMATCH divert(5)dnl dnl +dnl round fuzz +dnl +AC_MSG_CHECKING([whether rounding works as expected]) +AC_TRY_RUN([ +#include <math.h> + /* keep this out-of-line to prevent use of gcc inline floor() */ + double somefn(double n) { + return floor(n*pow(10,2) + 0.5); + } + int main() { + return somefn(0.045)/10.0 != 0.5; + } +],[ + PHP_ROUND_FUZZ=0.5 + AC_MSG_RESULT(yes) +],[ + PHP_ROUND_FUZZ=0.50000000001 + AC_MSG_RESULT(no) +],[ + PHP_ROUND_FUZZ=0.50000000001 + AC_MSG_RESULT(cross compile) +]) +AC_DEFINE_UNQUOTED(PHP_ROUND_FUZZ, $PHP_ROUND_FUZZ, [ see #24142 ]) + +dnl dnl Check if there is a support means of creating a new process dnl and defining which handles it receives dnl diff --git a/ext/standard/credits.c b/ext/standard/credits.c index 2d007b6ee1..655725dca6 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -54,14 +54,14 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */ } else { php_info_print_table_header(1, "Language Design & Concept"); } - php_info_print_table_row(1, "Andi Gutmans, Rasmus Lerdorf, Zeev Suraski, Marcus Boerger"); + php_info_print_table_row(1, "Andi Gutmans, Rasmus Lerdorf, Zeev Suraski"); php_info_print_table_end(); /* PHP Language */ php_info_print_table_start(); php_info_print_table_colspan_header(2, "PHP Authors"); php_info_print_table_header(2, "Contribution", "Authors"); - CREDIT_LINE("Zend Scripting Language Engine", "Andi Gutmans, Zeev Suraski, Stanislav Malyshev, Marcus Boerger, Dmitry Stogov"); + CREDIT_LINE("Zend Scripting Language Engine", "Andi Gutmans, Zeev Suraski"); CREDIT_LINE("Extension Module API", "Andi Gutmans, Zeev Suraski, Andrei Zmievski"); CREDIT_LINE("UNIX Build and Modularization", "Stig Bakken, Sascha Schumann"); CREDIT_LINE("Win32 Port", "Shane Caraveo, Zeev Suraski, Wez Furlong"); diff --git a/ext/standard/credits_ext.h b/ext/standard/credits_ext.h index 82cc186edf..4417f120eb 100644 --- a/ext/standard/credits_ext.h +++ b/ext/standard/credits_ext.h @@ -38,6 +38,8 @@ CREDIT_LINE("JSON", "Omar Kilani"); CREDIT_LINE("LDAP", "Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson, Stig Venaas"); CREDIT_LINE("LIBXML", "Christian Stocker, Rob Richards, Marcus Boerger, Wez Furlong, Shane Caraveo"); CREDIT_LINE("mcrypt", "Sascha Schumann, Derick Rethans"); +CREDIT_LINE("mhash", "Sascha Schumann"); +CREDIT_LINE("mSQL", "Zeev Suraski"); CREDIT_LINE("MS SQL", "Frank M. Kromann"); CREDIT_LINE("Multibyte String Functions", "Tsukada Takuya, Rui Hirokawa"); CREDIT_LINE("MySQL driver for PDO", "George Schlossnagle, Wez Furlong, Ilia Alshanetsky, Johannes Schlueter"); @@ -49,7 +51,7 @@ CREDIT_LINE("ODBC driver for PDO", "Wez Furlong"); CREDIT_LINE("ODBC", "Stig Bakken, Andreas Karajannis, Frank M. Kromann, Daniel R. Kalowsky"); CREDIT_LINE("OpenSSL", "Stig Venaas, Wez Furlong, Sascha Kettler"); CREDIT_LINE("Oracle (OCI) driver for PDO", "Wez Furlong"); -CREDIT_LINE("pcntl", "Jason Greene, Arnaud Le Blanc"); +CREDIT_LINE("pcntl", "Jason Greene"); CREDIT_LINE("Perl Compatible Regexps", "Andrei Zmievski"); CREDIT_LINE("PHP Archive", "Gregory Beaver, Marcus Boerger"); CREDIT_LINE("PHP Data Objects", "Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle, Ilia Alshanetsky"); diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index cae5226a18..141b63b5b5 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -136,7 +136,7 @@ PHP_FUNCTION(crypt) { char salt[PHP_MAX_SALT_LEN + 1]; char *str, *salt_in = NULL; - int str_len, salt_in_len = 0; + int str_len, salt_in_len; salt[0] = salt[PHP_MAX_SALT_LEN] = '\0'; diff --git a/ext/standard/dns.c b/ext/standard/dns.c index f0276b6081..39412adc86 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -446,22 +446,13 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int cp += n; break; case DNS_T_TXT: - { - int ll = 0; - - add_assoc_string(*subarray, "type", "TXT", 1); - tp = emalloc(dlen + 1); - - while (ll < dlen) { - n = cp[ll]; - memcpy(tp + ll , cp + ll + 1, n); - ll = ll + n + 1; - } - tp[dlen] = '\0'; - cp += dlen; - - add_assoc_stringl(*subarray, "txt", tp, dlen, 0); - } + add_assoc_string(*subarray, "type", "TXT", 1); + n = cp[0]; + tp = emalloc(n + 1); + memcpy(tp, cp + 1, n); + tp[n] = '\0'; + cp += dlen; + add_assoc_stringl(*subarray, "txt", (char*)tp, n, 0); break; case DNS_T_SOA: add_assoc_string(*subarray, "type", "SOA", 1); diff --git a/ext/standard/exec.c b/ext/standard/exec.c index cd4bd61ea2..794a67982f 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -268,7 +268,7 @@ PHPAPI char *php_escape_shell_cmd(char *str) char *cmd; char *p = NULL; size_t estimate = (2 * l) + 1; - + TSRMLS_FETCH(); cmd = safe_emalloc(2, l, 1); @@ -358,7 +358,6 @@ PHPAPI char *php_escape_shell_arg(char *str) int x, y = 0, l = strlen(str); char *cmd; size_t estimate = (4 * l) + 3; - TSRMLS_FETCH(); cmd = safe_emalloc(4, l, 3); /* worst case */ diff --git a/ext/standard/file.c b/ext/standard/file.c index 116ee1c452..617afb62b3 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -193,10 +193,10 @@ PHP_MINIT_FUNCTION(file) REGISTER_LONG_CONSTANT("SEEK_SET", SEEK_SET, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SEEK_CUR", SEEK_CUR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SEEK_END", SEEK_END, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOCK_SH", PHP_LOCK_SH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOCK_EX", PHP_LOCK_EX, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOCK_UN", PHP_LOCK_UN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOCK_NB", PHP_LOCK_NB, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOCK_SH", 1, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOCK_EX", 2, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOCK_UN", 3, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOCK_NB", 4, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_NOTIFY_CONNECT", PHP_STREAM_NOTIFY_CONNECT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_NOTIFY_AUTH_REQUIRED", PHP_STREAM_NOTIFY_AUTH_REQUIRED, CONST_CS | CONST_PERSISTENT); @@ -344,7 +344,7 @@ PHP_FUNCTION(flock) } /* flock_values contains all possible actions if (operation & 4) we won't block on the lock */ - act = flock_values[act - 1] | (operation & PHP_LOCK_NB ? LOCK_NB : 0); + act = flock_values[act - 1] | (operation & 4 ? LOCK_NB : 0); if (php_stream_lock(stream, act)) { if (operation && errno == EWOULDBLOCK && arg3 && PZVAL_IS_REF(arg3)) { Z_LVAL_P(arg3) = 1; @@ -1223,7 +1223,7 @@ PHPAPI PHP_FUNCTION(fwrite) int arg2len; int ret; int num_bytes; - long arg3 = 0; + long arg3; char *buffer = NULL; php_stream *stream; @@ -1441,7 +1441,7 @@ PHP_FUNCTION(readfile) Return or change the umask */ PHP_FUNCTION(umask) { - long arg1 = 0; + long arg1; int oldumask; int arg_count = ZEND_NUM_ARGS(); @@ -1866,7 +1866,7 @@ quit_loop: } /* }}} */ -#define FPUTCSV_FLD_CHK(c) memchr(Z_STRVAL(field), c, Z_STRLEN(field)) +#define FPUTCSV_FLD_CHK(c) memchr(Z_STRVAL_PP(field), c, Z_STRLEN_PP(field)) /* {{{ proto int fputcsv(resource fp, array fields [, string delimiter [, string enclosure]]) Format line as CSV and write to file pointer */ @@ -1877,9 +1877,9 @@ PHP_FUNCTION(fputcsv) const char escape_char = '\\'; php_stream *stream; int ret; - zval *fp = NULL, *fields = NULL, **field_tmp = NULL, field; + zval *fp = NULL, *fields = NULL, **field = NULL; char *delimiter_str = NULL, *enclosure_str = NULL; - int delimiter_str_len = 0, enclosure_str_len = 0; + int delimiter_str_len, enclosure_str_len; HashPosition pos; int count, i = 0; smart_str csvline = {0}; @@ -1918,14 +1918,11 @@ PHP_FUNCTION(fputcsv) count = zend_hash_num_elements(Z_ARRVAL_P(fields)); zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(fields), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(fields), (void **) &field_tmp, &pos) == SUCCESS) { - field = **field_tmp; - - if (Z_TYPE_PP(field_tmp) != IS_STRING) { - zval_copy_ctor(&field); - convert_to_string(&field); + while (zend_hash_get_current_data_ex(Z_ARRVAL_P(fields), (void **) &field, &pos) == SUCCESS) { + if (Z_TYPE_PP(field) != IS_STRING) { + SEPARATE_ZVAL(field); + convert_to_string(*field); } - /* enclose a field that contains a delimiter, an enclosure character, or a newline */ if (FPUTCSV_FLD_CHK(delimiter) || FPUTCSV_FLD_CHK(enclosure) || @@ -1935,8 +1932,8 @@ PHP_FUNCTION(fputcsv) FPUTCSV_FLD_CHK('\t') || FPUTCSV_FLD_CHK(' ') ) { - char *ch = Z_STRVAL(field); - char *end = ch + Z_STRLEN(field); + char *ch = Z_STRVAL_PP(field); + char *end = ch + Z_STRLEN_PP(field); int escaped = 0; smart_str_appendc(&csvline, enclosure); @@ -1953,17 +1950,13 @@ PHP_FUNCTION(fputcsv) } smart_str_appendc(&csvline, enclosure); } else { - smart_str_appendl(&csvline, Z_STRVAL(field), Z_STRLEN(field)); + smart_str_appendl(&csvline, Z_STRVAL_PP(field), Z_STRLEN_PP(field)); } if (++i != count) { smart_str_appendl(&csvline, &delimiter, 1); } zend_hash_move_forward_ex(Z_ARRVAL_P(fields), &pos); - - if (Z_TYPE_PP(field_tmp) != IS_STRING) { - zval_dtor(&field); - } } smart_str_appendc(&csvline, '\n'); @@ -2180,9 +2173,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char memcpy(tptr, line_end, line_end_len); tptr += line_end_len; - if (stream == NULL) { - goto quit_loop_2; - } else if ((new_buf = php_stream_get_line(stream, NULL, 0, &new_len)) == NULL) { + if ((new_buf = php_stream_get_line(stream, NULL, 0, &new_len)) == NULL) { /* we've got an unterminated enclosure, * assign all the data from the start of * the enclosure to end of data to the @@ -2343,9 +2334,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char out: efree(temp); - if (stream) { - efree(buf); - } + efree(buf); } /* }}} */ diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 6e1dc3bbc1..3ec931c42d 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -741,7 +741,7 @@ PHP_FUNCTION(clearstatcache) { zend_bool clear_realpath_cache = 0; char *filename = NULL; - int filename_len = 0; + int filename_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bs", &clear_realpath_cache, &filename, &filename_len) == FAILURE) { return; diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h index 2ad95d80f3..f9f8a4fe4c 100644 --- a/ext/standard/flock_compat.h +++ b/ext/standard/flock_compat.h @@ -35,12 +35,6 @@ PHPAPI int php_flock(int fd, int operation); PHPAPI int flock(int fd, int operation); #endif -/* Userland LOCK_* constants */ -#define PHP_LOCK_SH 1 -#define PHP_LOCK_EX 2 -#define PHP_LOCK_UN 3 -#define PHP_LOCK_NB 4 - #ifdef PHP_WIN32 #define EWOULDBLOCK WSAEWOULDBLOCK # define fsync _commit diff --git a/ext/standard/head.c b/ext/standard/head.c index bcb7f37963..6958fbfccd 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -50,20 +50,6 @@ PHP_FUNCTION(header) } /* }}} */ -/* {{{ proto void header_remove([string name]) - Removes an HTTP header previously set using header() */ -PHP_FUNCTION(header_remove) -{ - sapi_header_line ctr = {0}; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ctr.line, - &ctr.line_len) == FAILURE) - return; - - sapi_header_op(ZEND_NUM_ARGS() == 0 ? SAPI_HEADER_DELETE_ALL : SAPI_HEADER_DELETE, &ctr TSRMLS_CC); -} -/* }}} */ - PHPAPI int php_header(TSRMLS_D) { if (sapi_send_headers(TSRMLS_C)==FAILURE || SG(request_info).headers_only) { @@ -211,7 +197,7 @@ PHP_FUNCTION(setrawcookie) Returns true if headers have already been sent, false otherwise */ PHP_FUNCTION(headers_sent) { - zval *arg1 = NULL, *arg2 = NULL; + zval *arg1, *arg2; char *file=""; int line=0; diff --git a/ext/standard/head.h b/ext/standard/head.h index 54dce2685b..81abf7094f 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -23,7 +23,6 @@ extern PHP_RINIT_FUNCTION(head); PHP_FUNCTION(header); -PHP_FUNCTION(header_remove); PHP_FUNCTION(setcookie); PHP_FUNCTION(setrawcookie); PHP_FUNCTION(headers_sent); diff --git a/ext/standard/html.c b/ext/standard/html.c index 14b4fab941..a32886617b 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -485,7 +485,6 @@ struct basic_entities_dec { #define CHECK_LEN(pos, chars_need) \ if((str_len - (pos)) < chars_need) { \ - *newpos = pos; \ *status = FAILURE; \ return 0; \ } @@ -528,11 +527,6 @@ inline static unsigned short get_next_char(enum entity_charset charset, do { if (this_char < 0x80) { more = 0; - if(stat) { - /* we didn't finish the UTF sequence correctly */ - --pos; - *status = FAILURE; - } break; } else if (this_char < 0xc0) { switch (stat) { @@ -1137,9 +1131,6 @@ PHPAPI char *php_escape_html_entities_ex(unsigned char *old, int oldlen, int *ne if(status == FAILURE) { /* invalid MB sequence */ - if (quote_style & ENT_HTML_IGNORE_ERRORS) { - continue; - } efree(replaced); if(!PG(display_errors)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid multibyte sequence in argument"); @@ -1298,7 +1289,6 @@ void register_html_constants(INIT_FUNC_ARGS) REGISTER_LONG_CONSTANT("ENT_COMPAT", ENT_COMPAT, CONST_PERSISTENT|CONST_CS); REGISTER_LONG_CONSTANT("ENT_QUOTES", ENT_QUOTES, CONST_PERSISTENT|CONST_CS); REGISTER_LONG_CONSTANT("ENT_NOQUOTES", ENT_NOQUOTES, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("ENT_IGNORE", ENT_IGNORE, CONST_PERSISTENT|CONST_CS); } /* }}} */ @@ -1381,7 +1371,7 @@ done: PHP_FUNCTION(html_entity_decode) { char *str, *hint_charset = NULL; - int str_len, hint_charset_len = 0, len; + int str_len, hint_charset_len, len; long quote_style = ENT_COMPAT; char *replaced; diff --git a/ext/standard/html.h b/ext/standard/html.h index 003496ca2e..76a27418aa 100644 --- a/ext/standard/html.h +++ b/ext/standard/html.h @@ -24,12 +24,10 @@ #define ENT_HTML_QUOTE_NONE 0 #define ENT_HTML_QUOTE_SINGLE 1 #define ENT_HTML_QUOTE_DOUBLE 2 -#define ENT_HTML_IGNORE_ERRORS 4 #define ENT_COMPAT ENT_HTML_QUOTE_DOUBLE #define ENT_QUOTES (ENT_HTML_QUOTE_DOUBLE | ENT_HTML_QUOTE_SINGLE) #define ENT_NOQUOTES ENT_HTML_QUOTE_NONE -#define ENT_IGNORE ENT_HTML_IGNORE_ERRORS void register_html_constants(INIT_FUNC_ARGS); diff --git a/ext/standard/http.c b/ext/standard/http.c index dfa4e980df..09253145ab 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -194,7 +194,7 @@ PHP_FUNCTION(http_build_query) { zval *formdata; char *prefix = NULL, *arg_sep=NULL; - int arg_sep_len = 0, prefix_len = 0; + int arg_sep_len, prefix_len = 0; smart_str formstr = {0}; diff --git a/ext/standard/image.c b/ext/standard/image.c index d21a91b8b6..c2f640ed45 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -653,7 +653,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC) } /* Collect bit depth info */ - highest_bit_depth = 0; + highest_bit_depth = bit_depth = 0; for (i = 0; i < result->channels; i++) { bit_depth = php_stream_getc(stream); /* Ssiz[i] */ bit_depth++; diff --git a/ext/standard/info.c b/ext/standard/info.c index 2f21bd79fc..85b8be25cd 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -528,10 +528,9 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) ulong num_key; if ((url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash())) { - HashPosition pos; - for (zend_hash_internal_pointer_reset_ex(url_stream_wrappers_hash, &pos); - zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, (uint *)&stream_protocol_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING; - zend_hash_move_forward_ex(url_stream_wrappers_hash, &pos)) { + for (zend_hash_internal_pointer_reset(url_stream_wrappers_hash); + zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, (uint *)&stream_protocol_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING; + zend_hash_move_forward(url_stream_wrappers_hash)) { stream_protocols_buf = erealloc(stream_protocols_buf, stream_protocols_buf_len + stream_protocol_len + 2 + 1); memcpy(stream_protocols_buf + stream_protocols_buf_len, stream_protocol, stream_protocol_len - 1); stream_protocols_buf[stream_protocols_buf_len + stream_protocol_len - 1] = ','; @@ -560,10 +559,9 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) ulong num_key; if ((stream_xport_hash = php_stream_xport_get_hash())) { - HashPosition pos; - for(zend_hash_internal_pointer_reset_ex(stream_xport_hash, &pos); - zend_hash_get_current_key_ex(stream_xport_hash, &xport_name, (uint *)&xport_name_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING; - zend_hash_move_forward_ex(stream_xport_hash, &pos)) { + for(zend_hash_internal_pointer_reset(stream_xport_hash); + zend_hash_get_current_key_ex(stream_xport_hash, &xport_name, (uint *)&xport_name_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING; + zend_hash_move_forward(stream_xport_hash)) { if (xport_buf_len + xport_name_len + 2 > xport_buf_size) { while (xport_buf_len + xport_name_len + 2 > xport_buf_size) { xport_buf_size += 256; @@ -602,10 +600,9 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) ulong num_key; if ((stream_filter_hash = php_get_stream_filters_hash())) { - HashPosition pos; - for(zend_hash_internal_pointer_reset_ex(stream_filter_hash, &pos); - zend_hash_get_current_key_ex(stream_filter_hash, &filter_name, (uint *)&filter_name_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING; - zend_hash_move_forward_ex(stream_filter_hash, &pos)) { + for(zend_hash_internal_pointer_reset(stream_filter_hash); + zend_hash_get_current_key_ex(stream_filter_hash, &filter_name, (uint *)&filter_name_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING; + zend_hash_move_forward(stream_filter_hash)) { if (filter_buf_len + filter_name_len + 2 > filter_buf_size) { while (filter_buf_len + filter_name_len + 2 > filter_buf_size) { filter_buf_size += 256; @@ -1001,12 +998,17 @@ void register_phpinfo_constants(INIT_FUNC_ARGS) Output a page of useful information about PHP and the current request */ PHP_FUNCTION(phpinfo) { - long flag = PHP_INFO_ALL; + int argc = ZEND_NUM_ARGS(); + long flag; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) { + if (zend_parse_parameters(argc TSRMLS_CC, "|l", &flag) == FAILURE) { return; } + if(!argc) { + flag = PHP_INFO_ALL; + } + /* Andale! Andale! Yee-Hah! */ php_start_ob_buffer(NULL, 4096, 0 TSRMLS_CC); php_print_info(flag TSRMLS_CC); @@ -1047,12 +1049,17 @@ PHP_FUNCTION(phpversion) Prints the list of people who've contributed to the PHP project */ PHP_FUNCTION(phpcredits) { - long flag = PHP_CREDITS_ALL; + int argc = ZEND_NUM_ARGS(); + long flag; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) { + if (zend_parse_parameters(argc TSRMLS_CC, "|l", &flag) == FAILURE) { return; } + if(!argc) { + flag = PHP_CREDITS_ALL; + } + php_print_credits(flag TSRMLS_CC); RETURN_TRUE; } @@ -1154,7 +1161,7 @@ PHP_FUNCTION(php_sapi_name) PHP_FUNCTION(php_uname) { char *mode = "a"; - int modelen = sizeof("a")-1; + int modelen; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &mode, &modelen) == FAILURE) { return; } diff --git a/ext/standard/mail.c b/ext/standard/mail.c index a9b6457889..1f2d470d74 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -31,12 +31,6 @@ #include <sys/sysexits.h> #endif -#if PHP_SIGCHILD -#if HAVE_SIGNAL_H -#include <signal.h> -#endif -#endif - #include "php_mail.h" #include "php_ini.h" #include "safe_mode.h" @@ -95,8 +89,8 @@ PHP_FUNCTION(mail) { char *to=NULL, *message=NULL, *headers=NULL; char *subject=NULL, *extra_cmd=NULL; - int to_len, message_len, headers_len = 0; - int subject_len, extra_cmd_len = 0, i; + int to_len, message_len, headers_len; + int subject_len, extra_cmd_len, i; char *force_extra_parameters = INI_STR("mail.force_extra_parameters"); char *to_r, *subject_r; char *p, *e; @@ -199,9 +193,6 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char int ret; char *sendmail_path = INI_STR("sendmail_path"); char *sendmail_cmd = NULL; -#if PHP_SIGCHILD - void (*sig_handler)() = NULL; -#endif if (!sendmail_path) { #if (defined PHP_WIN32 || defined NETWARE) @@ -226,16 +217,6 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char sendmail_cmd = sendmail_path; } -#if PHP_SIGCHILD - /* Set signal handler of SIGCHLD to default to prevent other signal handlers - * from being called and reaping the return code when our child exits. - * The original handler needs to be restored after pclose() */ - sig_handler = (void *)signal(SIGCHLD, SIG_DFL); - if (sig_handler == SIG_ERR) { - sig_handler = NULL; - } -#endif - #ifdef PHP_WIN32 sendmail = popen(sendmail_cmd, "wb"); #else @@ -254,13 +235,6 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char if (EACCES == errno) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Permission denied: unable to execute shell to run mail delivery binary '%s'", sendmail_path); pclose(sendmail); -#if PHP_SIGCHILD - /* Restore handler in case of error on Windows - Not sure if this applicable on Win but just in case. */ - if (sig_handler) { - signal(SIGCHLD, sig_handler); - } -#endif return 0; } #endif @@ -272,12 +246,6 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char fprintf(sendmail, "\n%s\n", message); ret = pclose(sendmail); -#if PHP_SIGCHILD - if (sig_handler) { - signal(SIGCHLD, sig_handler); - } -#endif - #ifdef PHP_WIN32 if (ret == -1) #else @@ -296,11 +264,6 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char } } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path); -#if PHP_SIGCHILD - if (sig_handler) { - signal(SIGCHLD, sig_handler); - } -#endif return 0; } diff --git a/ext/standard/math.c b/ext/standard/math.c index 3d76a6ee0d..ac9c206437 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -24,181 +24,31 @@ #include "php.h" #include "php_math.h" #include "zend_multiply.h" -#include "zend_float.h" #include <math.h> #include <float.h> #include <stdlib.h> -/* {{{ php_intlog10abs - Returns floor(log10(fabs(val))), uses fast binary search */ -static inline int php_intlog10abs(double value) { - int result; - value = fabs(value); - - if (value < 1e-8 || value > 1e23) { - result = (int)floor(log10(value)); - } else { - static const double values[] = { - 1e-8, 1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, - 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, - 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22}; - /* Do a binary search with 5 steps */ - result = 16; - if (value < values[result]) { - result -= 8; - } else { - result += 8; - } - if (value < values[result]) { - result -= 4; - } else { - result += 4; - } - if (value < values[result]) { - result -= 2; - } else { - result += 2; - } - if (value < values[result]) { - result -= 1; - } else { - result += 1; - } - if (value < values[result]) { - result -= 1; - } - result -= 8; - } - return result; -} -/* }}} */ - -/* {{{ php_intpow10 - Returns pow(10.0, (double)power), uses fast lookup table for exact powers */ -static inline double php_intpow10(int power) { - static const double powers[] = { - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, - 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, - 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22}; - - /* Not in lookup table */ - if (power < 0 || power > 22) { - return pow(10.0, (double)power); - } - return powers[power]; -} -/* }}} */ - -/* {{{ php_round_helper - Actually performs the rounding of a value to integer in a certain mode */ -static inline double php_round_helper(double value, int mode) { - ZEND_FLOAT_DECLARE - double tmp_value; - - ZEND_FLOAT_ENSURE(); - if (value >= 0.0) { - tmp_value = floor(value + 0.5); - if ((mode == PHP_ROUND_HALF_DOWN && value == (-0.5 + tmp_value)) || - (mode == PHP_ROUND_HALF_EVEN && value == (0.5 + 2 * floor(tmp_value/2.0))) || - (mode == PHP_ROUND_HALF_ODD && value == (0.5 + 2 * floor(tmp_value/2.0) - 1.0))) - { - tmp_value = tmp_value - 1.0; - } - } else { - tmp_value = ceil(value - 0.5); - if ((mode == PHP_ROUND_HALF_DOWN && value == (0.5 + tmp_value)) || - (mode == PHP_ROUND_HALF_EVEN && value == (-0.5 + 2 * ceil(tmp_value/2.0))) || - (mode == PHP_ROUND_HALF_ODD && value == (-0.5 + 2 * ceil(tmp_value/2.0) + 1.0))) - { - tmp_value = tmp_value + 1.0; - } - } - - ZEND_FLOAT_RETURN(tmp_value); -} -/* }}} */ - -/* {{{ _php_math_round */ -/* - * Rounds a number to a certain number of decimal places in a certain rounding - * mode. For the specifics of the algorithm, see http://wiki.php.net/rfc/rounding - */ -PHPAPI double _php_math_round(double value, int places, int mode) { - ZEND_FLOAT_DECLARE - double f1, f2; - double tmp_value; - int precision_places; - - ZEND_FLOAT_ENSURE(); - - precision_places = 14 - php_intlog10abs(value); - - f1 = php_intpow10(abs(places)); - - /* If the decimal precision guaranteed by FP arithmetic is higher than - the requested places BUT is small enough to make sure a non-zero value - is returned, pre-round the result to the precision */ - if (precision_places > places && precision_places - places < 15) { - f2 = php_intpow10(abs(precision_places)); - if (precision_places >= 0) { - tmp_value = value * f2; - } else { - tmp_value = value / f2; - } - /* preround the result (tmp_value will always be something * 1e14, - thus never larger than 1e15 here) */ - tmp_value = php_round_helper(tmp_value, mode); - /* now correctly move the decimal point */ - f2 = php_intpow10(abs(places - precision_places)); - /* because places < precision_places */ - tmp_value = tmp_value / f2; - } else { - /* adjust the value */ - if (places >= 0) { - tmp_value = value * f1; - } else { - tmp_value = value / f1; - } - /* This value is beyond our precision, so rounding it is pointless */ - if (fabs(tmp_value) >= 1e15) { - ZEND_FLOAT_RETURN(value); - } - } +#ifndef PHP_ROUND_FUZZ +# ifndef PHP_WIN32 +# define PHP_ROUND_FUZZ 0.50000000001 +# else +# define PHP_ROUND_FUZZ 0.5 +# endif +#endif - /* round the temp value */ - tmp_value = php_round_helper(tmp_value, mode); - - /* see if it makes sense to use simple division to round the value */ - if (abs(places) < 23) { - if (places > 0) { - tmp_value = tmp_value / f1; - } else { - tmp_value = tmp_value * f1; - } - } else { - /* Simple division can't be used since that will cause wrong results. - Instead, the number is converted to a string and back again using - strtod(). strtod() will return the nearest possible FP value for - that string. */ - - /* 40 Bytes should be more than enough for this format string. The - float won't be larger than 1e15 anyway. But just in case, use - snprintf() and make sure the buffer is zero-terminated */ - char buf[40]; - snprintf(buf, 39, "%15fe%d", tmp_value, -places); - buf[39] = '\0'; - tmp_value = zend_strtod(buf, NULL); - /* couldn't convert to string and back */ - if (!zend_finite(tmp_value) || zend_isnan(tmp_value)) { - tmp_value = value; - } - } +#define PHP_ROUND_WITH_FUZZ(val, places) { \ + double tmp_val=val, f = pow(10.0, (double) places); \ + tmp_val *= f; \ + if (tmp_val >= 0.0) { \ + tmp_val = floor(tmp_val + PHP_ROUND_FUZZ); \ + } else { \ + tmp_val = ceil(tmp_val - PHP_ROUND_FUZZ); \ + } \ + tmp_val /= f; \ + val = !zend_isnan(tmp_val) ? tmp_val : val; \ +} \ - ZEND_FLOAT_RETURN(tmp_value); -} -/* }}} */ /* {{{ php_asinh */ @@ -326,21 +176,20 @@ PHP_FUNCTION(floor) } /* }}} */ -/* {{{ proto float round(float number [, int precision [, int mode]]) +/* {{{ proto float round(float number [, int precision]) Returns the number rounded to specified precision */ PHP_FUNCTION(round) { zval **value; int places = 0; long precision = 0; - long mode = PHP_ROUND_HALF_UP; double return_val; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|ll", &value, &precision, &mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|l", &value, &precision) == FAILURE) { return; } - if (ZEND_NUM_ARGS() >= 2) { + if (ZEND_NUM_ARGS() == 2) { places = (int) precision; } convert_scalar_to_number_ex(value); @@ -355,7 +204,7 @@ PHP_FUNCTION(round) case IS_DOUBLE: return_val = (Z_TYPE_PP(value) == IS_LONG) ? (double)Z_LVAL_PP(value) : Z_DVAL_PP(value); - return_val = _php_math_round(return_val, places, mode); + PHP_ROUND_WITH_FUZZ(return_val, places); RETURN_DOUBLE(return_val); break; @@ -1092,7 +941,7 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho } dec = MAX(0, dec); - d = _php_math_round(d, dec, PHP_ROUND_HALF_UP); + PHP_ROUND_WITH_FUZZ(d, dec); tmplen = spprintf(&tmpbuf, 0, "%.*F", dec, d); @@ -1191,7 +1040,7 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho PHP_FUNCTION(number_format) { double num; - long dec = 0; + long dec; char *thousand_sep = NULL, *dec_point = NULL; char thousand_sep_chr = ',', dec_point_chr = '.'; int thousand_sep_len = 0, dec_point_len = 0; diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 6aaac4b7a9..7ed59cbe28 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -48,11 +48,17 @@ static int php_stream_output_close(php_stream *stream, int close_handle TSRMLS_D return 0; } +static int php_stream_output_flush(php_stream *stream TSRMLS_DC) +{ + sapi_flush(TSRMLS_C); + return 0; +} + php_stream_ops php_stream_output_ops = { php_stream_output_write, php_stream_output_read, php_stream_output_close, - NULL, /* flush */ + php_stream_output_flush, "Output", NULL, /* seek */ NULL, /* cast */ @@ -171,21 +177,11 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch return NULL; } } - if (strpbrk(mode, "wa+")) { - mode_rw = TEMP_STREAM_DEFAULT; - } else { - mode_rw = TEMP_STREAM_READONLY; - } - return php_stream_temp_create(mode_rw, max_memory); + return php_stream_temp_create(TEMP_STREAM_DEFAULT, max_memory); } if (!strcasecmp(path, "memory")) { - if (strpbrk(mode, "wa+")) { - mode_rw = TEMP_STREAM_DEFAULT; - } else { - mode_rw = TEMP_STREAM_READONLY; - } - return php_stream_memory_create(mode_rw); + return php_stream_memory_create(TEMP_STREAM_DEFAULT); } if (!strcasecmp(path, "output")) { @@ -295,23 +291,9 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch return NULL; } -#if defined(S_IFSOCK) && !defined(WIN32) && !defined(__BEOS__) - do { - struct stat st; - memset(&st, 0, sizeof(st)); - if (fstat(fd, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { - stream = php_stream_sock_open_from_socket(fd, NULL); - if (stream) { - stream->ops = &php_stream_socket_ops; - return stream; - } - } - } while (0); -#endif - if (file) { stream = php_stream_fopen_from_file(file, mode); - } else { + } else { stream = php_stream_fopen_from_fd(fd, mode, NULL); if (stream == NULL) { close(fd); diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h index 1f12076ad5..268c154ac0 100644 --- a/ext/standard/php_incomplete_class.h +++ b/ext/standard/php_incomplete_class.h @@ -31,10 +31,6 @@ if (Z_OBJ_HT_P(struc)->get_class_entry && \ Z_OBJCE_P(struc) == BG(incomplete_class)) { \ class_name = php_lookup_class_name(struc, &name_len); \ - if (!class_name) { \ - name_len = sizeof(INCOMPLETE_CLASS) - 1; \ - class_name = estrndup(INCOMPLETE_CLASS, name_len); \ - } \ free_class_name = 1; \ incomplete_class = 1; \ } else { \ diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h index d18bc6e1f9..b3fd245e75 100644 --- a/ext/standard/php_math.h +++ b/ext/standard/php_math.h @@ -152,21 +152,4 @@ PHP_FUNCTION(atanh); #define M_SQRT3 1.73205080756887729352 /* sqrt(3) */ #endif -/* Define rounding modes (all are round-to-nearest) */ -#ifndef PHP_ROUND_HALF_UP -#define PHP_ROUND_HALF_UP 0x01 /* Arithmetic rounding, up == away from zero */ -#endif - -#ifndef PHP_ROUND_HALF_DOWN -#define PHP_ROUND_HALF_DOWN 0x02 /* Down == towards zero */ -#endif - -#ifndef PHP_ROUND_HALF_EVEN -#define PHP_ROUND_HALF_EVEN 0x03 /* Banker's rounding */ -#endif - -#ifndef PHP_ROUND_HALF_ODD -#define PHP_ROUND_HALF_ODD 0x04 -#endif - #endif /* PHP_MATH_H */ diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index 718f96ec9a..e74609d79b 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -76,7 +76,6 @@ PHP_FUNCTION(nl_langinfo); PHP_FUNCTION(stristr); PHP_FUNCTION(chunk_split); PHP_FUNCTION(parse_str); -PHP_FUNCTION(str_getcsv); PHP_FUNCTION(bin2hex); PHP_FUNCTION(similar_text); PHP_FUNCTION(strip_tags); diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 230cca0f29..b8b2bb3bb3 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -466,7 +466,7 @@ struct php_proc_open_descriptor_item { PHP_FUNCTION(proc_open) { char *command, *cwd=NULL; - int command_len, cwd_len = 0; + int command_len, cwd_len; zval *descriptorspec; zval *pipes; zval *environment = NULL; diff --git a/ext/standard/rand.c b/ext/standard/rand.c index f8a9aafda4..d04094b00f 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -138,6 +138,14 @@ PHPAPI long php_rand(TSRMLS_D) LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + The original code included the following notice: + + When you use this, send an email to: matumoto@math.keio.ac.jp + with an appropriate reference to your work. + + It would be nice to CC: rjwagner@writeme.com and Cokus@math.washington.edu + when you write. */ #define N MT_N /* length of state vector */ @@ -230,7 +238,7 @@ PHPAPI php_uint32 php_mt_rand(TSRMLS_D) Seeds random number generator */ PHP_FUNCTION(srand) { - long seed = 0; + long seed; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE) return; @@ -246,7 +254,7 @@ PHP_FUNCTION(srand) Seeds Mersenne Twister random number generator */ PHP_FUNCTION(mt_srand) { - long seed = 0; + long seed; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE) return; diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index fd8520016f..d836db7f49 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -69,11 +69,6 @@ PHP_FUNCTION(stream_socket_pair) s1 = php_stream_sock_open_from_socket(pair[0], 0); s2 = php_stream_sock_open_from_socket(pair[1], 0); - /* set the __exposed flag. - * php_stream_to_zval() does, add_next_index_resource() does not */ - php_stream_auto_cleanup(s1); - php_stream_auto_cleanup(s2); - add_next_index_resource(return_value, php_stream_get_resource_id(s1)); add_next_index_resource(return_value, php_stream_get_resource_id(s2)); } @@ -99,7 +94,7 @@ PHP_FUNCTION(stream_socket_client) RETVAL_FALSE; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zzdlr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zzd!lr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) { RETURN_FALSE; } @@ -416,21 +411,23 @@ PHP_FUNCTION(stream_get_contents) php_stream_from_zval(stream, &zsrc); - if ((pos > 0 || (pos == 0 && ZEND_NUM_ARGS() > 2)) && php_stream_seek(stream, pos, SEEK_SET) < 0) { + if (pos > 0 && php_stream_seek(stream, pos, SEEK_SET) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream", pos); RETURN_FALSE; } - len = php_stream_copy_to_mem(stream, &contents, maxlen, 0); - - if (contents) { - if (len && PG(magic_quotes_runtime)) { + if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) { + + if (PG(magic_quotes_runtime)) { contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */ len = newlen; } + RETVAL_STRINGL(contents, len, 0); - } else { + } else if (len == 0) { RETVAL_EMPTY_STRING(); + } else { + RETVAL_FALSE; } } /* }}} */ @@ -534,14 +531,13 @@ PHP_FUNCTION(stream_get_transports) } if ((stream_xport_hash = php_stream_xport_get_hash())) { - HashPosition pos; array_init(return_value); - zend_hash_internal_pointer_reset_ex(stream_xport_hash, &pos); + zend_hash_internal_pointer_reset(stream_xport_hash); while (zend_hash_get_current_key_ex(stream_xport_hash, &stream_xport, &stream_xport_len, - &num_key, 0, &pos) == HASH_KEY_IS_STRING) { + &num_key, 0, NULL) == HASH_KEY_IS_STRING) { add_next_index_stringl(return_value, stream_xport, stream_xport_len - 1, 1); - zend_hash_move_forward_ex(stream_xport_hash, &pos); + zend_hash_move_forward(stream_xport_hash); } } else { RETURN_FALSE; @@ -563,11 +559,10 @@ PHP_FUNCTION(stream_get_wrappers) } if ((url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash())) { - HashPosition pos; array_init(return_value); - for(zend_hash_internal_pointer_reset_ex(url_stream_wrappers_hash, &pos); - (key_flags = zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, &stream_protocol_len, &num_key, 0, &pos)) != HASH_KEY_NON_EXISTANT; - zend_hash_move_forward_ex(url_stream_wrappers_hash, &pos)) { + for(zend_hash_internal_pointer_reset(url_stream_wrappers_hash); + (key_flags = zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, &stream_protocol_len, &num_key, 0, NULL)) != HASH_KEY_NON_EXISTANT; + zend_hash_move_forward(url_stream_wrappers_hash)) { if (key_flags == HASH_KEY_IS_STRING) { add_next_index_stringl(return_value, stream_protocol, stream_protocol_len - 1, 1); } @@ -797,12 +792,6 @@ PHP_FUNCTION(stream_select) retval = stream_array_emulate_read_fd_set(r_array TSRMLS_CC); if (retval > 0) { - if (w_array != NULL) { - zend_hash_clean(Z_ARRVAL_P(w_array)); - } - if (e_array != NULL) { - zend_hash_clean(Z_ARRVAL_P(e_array)); - } RETURN_LONG(retval); } } @@ -838,13 +827,12 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco INIT_ZVAL(zvs[i]); ps[i] = &zvs[i]; ptps[i] = &ps[i]; - MAKE_STD_ZVAL(ps[i]); } ZVAL_LONG(ps[0], notifycode); ZVAL_LONG(ps[1], severity); if (xmsg) { - ZVAL_STRING(ps[2], xmsg, 1); + ZVAL_STRING(ps[2], xmsg, 0); } else { ZVAL_NULL(ps[2]); } @@ -855,9 +843,6 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, ptps, 0, NULL TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call user notifier"); } - for (i = 0; i < 6; i++) { - zval_ptr_dtor(&ps[i]); - } if (retval) { zval_ptr_dtor(&retval); } @@ -1038,34 +1023,6 @@ PHP_FUNCTION(stream_context_set_params) } /* }}} */ -/* {{{ proto array stream_context_get_params(resource context|resource stream) - Get parameters of a file context */ -PHP_FUNCTION(stream_context_get_params) -{ - zval *zcontext, *options; - php_stream_context *context; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zcontext) == FAILURE) { - RETURN_FALSE; - } - - context = decode_context_param(zcontext TSRMLS_CC); - if (!context) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter"); - RETURN_FALSE; - } - - array_init(return_value); - if (context->notifier && context->notifier->ptr && context->notifier->func == user_space_stream_notifier) { - add_assoc_zval_ex(return_value, ZEND_STRS("notification"), context->notifier->ptr); - Z_ADDREF_P(context->notifier->ptr); - } - ALLOC_INIT_ZVAL(options); - ZVAL_ZVAL(options, context->options, 1, 0); - add_assoc_zval_ex(return_value, ZEND_STRS("options"), options); -} -/* }}} */ - /* {{{ proto resource stream_context_get_default([array options]) Get a handle on the default file/stream context and optionally set parameters */ PHP_FUNCTION(stream_context_get_default) @@ -1318,7 +1275,7 @@ PHP_FUNCTION(stream_set_blocking) PHP_FUNCTION(stream_set_timeout) { zval *socket; - long seconds, microseconds = 0; + long seconds, microseconds; struct timeval t; php_stream *stream; int argc = ZEND_NUM_ARGS(); @@ -1388,7 +1345,7 @@ PHP_FUNCTION(stream_set_write_buffer) Enable or disable a specific kind of crypto on the stream */ PHP_FUNCTION(stream_socket_enable_crypto) { - long cryptokind = 0; + long cryptokind; zval *zstream, *zsessstream = NULL; php_stream *stream, *sessstream = NULL; zend_bool enable; diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h index 65d679b928..90105919c6 100644 --- a/ext/standard/streamsfuncs.h +++ b/ext/standard/streamsfuncs.h @@ -46,7 +46,6 @@ PHP_FUNCTION(stream_wrapper_unregister); PHP_FUNCTION(stream_wrapper_restore); PHP_FUNCTION(stream_context_create); PHP_FUNCTION(stream_context_set_params); -PHP_FUNCTION(stream_context_get_params); PHP_FUNCTION(stream_context_set_option); PHP_FUNCTION(stream_context_get_options); PHP_FUNCTION(stream_context_get_default); diff --git a/ext/standard/string.c b/ext/standard/string.c index d3a6fdffd8..dd8f3d5b34 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -50,9 +50,6 @@ #include "TSRM.h" #endif -/* For str_getcsv() support */ -#include "ext/standard/file.h" - #define STR_PAD_LEFT 0 #define STR_PAD_RIGHT 1 #define STR_PAD_BOTH 2 @@ -207,8 +204,10 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior) / { char *s11, *s22; int len1, len2; - long start = 0, len = 0; + long start, len; + start = 0; + len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ll", &s11, &len1, &s22, &len2, &start, &len) == FAILURE) { return; @@ -2061,7 +2060,7 @@ static char *php_chunk_split(char *src, int srclen, char *end, int endlen, int c Returns split line */ PHP_FUNCTION(chunk_split) { - zval **p_chunklen = NULL, **p_ending = NULL; + zval **p_chunklen, **p_ending; char *str; char *result; char *end = "\r\n"; @@ -2120,7 +2119,7 @@ PHP_FUNCTION(chunk_split) PHP_FUNCTION(substr) { char *str; - long l = 0, f; + long l, f; int str_len; int argc = ZEND_NUM_ARGS(); @@ -2721,8 +2720,8 @@ static void php_strtr_array(zval *return_value, char *str, int slen, HashTable * PHP_FUNCTION(strtr) { zval **from; - char *str, *to = NULL; - int str_len, to_len = 0; + char *str, *to; + int str_len, to_len; int ac = ZEND_NUM_ARGS(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ|s", &str, &str_len, &from, &to, &to_len) == FAILURE) { @@ -2834,7 +2833,7 @@ static int php_similar_char(const char *txt1, int len1, const char *txt2, int le PHP_FUNCTION(similar_text) { char *t1, *t2; - zval **percent = NULL; + zval **percent; int ac = ZEND_NUM_ARGS(); int sim; int t1_len, t2_len; @@ -3611,7 +3610,7 @@ static void php_str_replace_in_subject(zval *search, zval *replace, zval **subje */ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensitivity) { - zval **subject, **search, **replace, **subject_entry, **zcount = NULL; + zval **subject, **search, **replace, **subject_entry, **zcount; zval *result; char *string_key; uint string_key_len; @@ -4353,10 +4352,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, case '"': case '\'': - if (state == 4) { - /* Inside <!-- comment --> */ - break; - } else if (state == 2 && *(p-1) != '\\') { + if (state == 2 && *(p-1) != '\\') { if (lc == c) { lc = '\0'; } else if (lc != '\\') { @@ -4462,27 +4458,6 @@ reg_char: } /* }}} */ -/* {{{ proto array str_getcsv(string input[, string delimiter[, string enclosure[, string escape]]]) -Parse a CSV string into an array */ -PHP_FUNCTION(str_getcsv) -{ - char *str, delim = ',', enc = '"', esc = '\\'; - char *delim_str = NULL, *enc_str = NULL, *esc_str = NULL; - int str_len = 0, delim_len = 0, enc_len = 0, esc_len = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sss", &str, &str_len, &delim_str, &delim_len, - &enc_str, &enc_len, &esc_str, &esc_len) == FAILURE) { - return; - } - - delim = delim_len ? delim_str[0] : delim; - enc = enc_len ? enc_str[0] : enc; - esc = esc_len ? esc_str[0] : esc; - - php_fgetcsv(NULL, delim, enc, esc, str_len, str, return_value TSRMLS_CC); -} -/* }}} */ - /* {{{ proto string str_repeat(string input, int mult) Returns the input string repeat mult times */ PHP_FUNCTION(str_repeat) @@ -4727,7 +4702,7 @@ PHP_FUNCTION(strnatcasecmp) PHP_FUNCTION(substr_count) { char *haystack, *needle; - long offset = 0, length = 0; + long offset = 0, length; int ac = ZEND_NUM_ARGS(); int count = 0; int haystack_len, needle_len; @@ -4969,7 +4944,7 @@ PHP_FUNCTION(str_shuffle) PHP_FUNCTION(str_word_count) { char *buf, *str, *char_list = NULL, *p, *e, *s, ch[256]; - int str_len, char_list_len = 0, word_count = 0; + int str_len, char_list_len, word_count = 0; long type = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len, &type, &char_list, &char_list_len) == FAILURE) { diff --git a/ext/standard/tests/array/array_count_values_variation.phpt b/ext/standard/tests/array/array_count_values_variation.phpt index efd3c81cc2..89d7f37b1f 100644 --- a/ext/standard/tests/array/array_count_values_variation.phpt +++ b/ext/standard/tests/array/array_count_values_variation.phpt @@ -33,6 +33,10 @@ echo "\n"; echo "Done"; ?> +--CLEAN-- +<?php +unlink("array_count_file"); +?> --EXPECTF-- *** Testing array_count_values() : parameter variations *** array(3) { @@ -44,4 +48,4 @@ array(3) { int(1) } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/array_intersect_assoc_variation5.phpt b/ext/standard/tests/array/array_intersect_assoc_variation5.phpt index 7d8e09eb2d..b85dd7cee9 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation5.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation5.phpt @@ -20,6 +20,17 @@ echo "*** Testing array_intersect_assoc() : assoc array with diff keys to \$arr1 $unset_var = 10; unset ($unset_var); +// get a resource variable +$fp = fopen(__FILE__, "r"); + +// get a class +class classA +{ + public function __toString(){ + return "Class A object"; + } +} + // get a heredoc string $heredoc = <<<EOT Hello world @@ -50,18 +61,18 @@ $arrays = array ( array("hello", $heredoc => "string"), // heredoc // array with object, unset variable and resource variable -/*10*/ array(@$unset_var => "hello"), +/*10*/ array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'), // array with mixed keys -/*11*/ array('hello' => 1, "fruit" => 2.2, - 133 => "int", 444.432 => "float", +/*11*/ array('hello' => 1, new classA() => 2, "fruit" => 2.2, + $fp => 'resource', 133 => "int", 444.432 => "float", @$unset_var => "unset", $heredoc => "heredoc") ); // array to be passsed to $arr2 argument $arr2 = array(0 => 0, 2 => "float", 4 => "f3", 33333333 => "f4", "\tHello" => 111, 2.2, 'color', "Hello world" => "string", - "pen\n" => 33, 133 => "int"); + "pen\n" => 33, new classA() => 11, 133 => "int"); // loop through each sub-array within $arrrays to check the behavior of array_intersect_assoc() $iterator = 1; @@ -77,10 +88,23 @@ foreach($arrays as $arr1) { $iterator++; } +// close the file resource used +fclose($fp); + echo "Done"; ?> --EXPECTF-- *** Testing array_intersect_assoc() : assoc array with diff keys to $arr1 argument *** + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d -- Iteration 1 -- array(0) { } diff --git a/ext/standard/tests/array/array_intersect_assoc_variation6.phpt b/ext/standard/tests/array/array_intersect_assoc_variation6.phpt index 75806225ca..ed96d3276f 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation6.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation6.phpt @@ -20,6 +20,17 @@ echo "*** Testing array_intersect_assoc() : assoc array with diff keys to \$arr2 $unset_var = 10; unset ($unset_var); +// get a resource variable +$fp = fopen(__FILE__, "r"); + +// get a class +class classA +{ + public function __toString(){ + return "Class A object"; + } +} + // get a heredoc string $heredoc = <<<EOT Hello world @@ -49,19 +60,19 @@ $arrays = array ( "\v\fworld" => 2.2, "pen\n" => 33), array("hello", $heredoc => "string"), // heredoc - // array with unset variable -/*10*/ array( @$unset_var => "hello"), + // array with object, unset variable and resource variable +/*10*/ array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'), // array with mixed keys -/*11*/ array('hello' => 1, "fruit" => 2.2, - 133 => "int", 444.432 => "float", +/*11*/ array('hello' => 1, new classA() => 2, "fruit" => 2.2, + $fp => 'resource', 133 => "int", 444.432 => "float", @$unset_var => "unset", $heredoc => "heredoc") ); // array to be passsed to $arr1 argument $arr1 = array(0 => 0, 2 => "float", 4 => "f3", 33333333 => "f4", "\tHello" => 111, 2.2, 'color', "Hello world" => "string", - "pen\n" => 33, 133 => "int"); + "pen\n" => 33, new classA() => 11, 133 => "int"); // loop through each sub-array within $arrrays to check the behavior of array_intersect_assoc() $iterator = 1; @@ -77,10 +88,23 @@ foreach($arrays as $arr2) { $iterator++; } +// close the file resource used +fclose($fp); + echo "Done"; ?> --EXPECTF-- *** Testing array_intersect_assoc() : assoc array with diff keys to $arr2 argument *** + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d -- Iteration 1 -- array(0) { } diff --git a/ext/standard/tests/array/array_intersect_variation5.phpt b/ext/standard/tests/array/array_intersect_variation5.phpt index 9aaedeb382..7f36ee3f2e 100644 --- a/ext/standard/tests/array/array_intersect_variation5.phpt +++ b/ext/standard/tests/array/array_intersect_variation5.phpt @@ -19,6 +19,17 @@ echo "*** Testing array_intersect() : assoc array with diff keys to \$arr1 argum $unset_var = 10; unset ($unset_var); +// get a resource variable +$fp = fopen(__FILE__, "r"); + +// get a class +class classA +{ + public function __toString(){ + return "Class A object"; + } +} + // get a heredoc string $heredoc = <<<EOT Hello world @@ -48,12 +59,12 @@ $arrays = array ( "\v\fworld" => 2.2, "pen\n" => 33), array("hello", $heredoc => "string"), // heredoc - // array with unset variable -/*10*/ array( @$unset_var => "hello"), + // array with object, unset variable and resource variable +/*10*/ array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'), // array with mixed keys -/*11*/ array('hello' => 1, "fruit" => 2.2, - 133 => "int", 444.432 => "float", +/*11*/ array('hello' => 1, new classA() => 2, "fruit" => 2.2, + $fp => 'resource', 133 => "int", 444.432 => "float", @$unset_var => "unset", $heredoc => "heredoc") ); @@ -74,10 +85,21 @@ foreach($arrays as $arr1) { $iterator++; } +// close the file resource used +fclose($fp); + echo "Done"; ?> --EXPECTF-- *** Testing array_intersect() : assoc array with diff keys to $arr1 argument *** + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d -- Iterator 1 -- array(0) { } diff --git a/ext/standard/tests/array/array_intersect_variation6.phpt b/ext/standard/tests/array/array_intersect_variation6.phpt index 48d01f7d54..cecde34db8 100644 --- a/ext/standard/tests/array/array_intersect_variation6.phpt +++ b/ext/standard/tests/array/array_intersect_variation6.phpt @@ -19,6 +19,17 @@ echo "*** Testing array_intersect() : assoc array with diff keys to \$arr2 argum $unset_var = 10; unset ($unset_var); +// get a resource variable +$fp = fopen(__FILE__, "r"); + +// get a class +class classA +{ + public function __toString(){ + return "Class A object"; + } +} + // get a heredoc string $heredoc = <<<EOT Hello world @@ -48,12 +59,12 @@ $arrays = array ( "\v\fworld" => 2.2, "pen\n" => 33), array("hello", $heredoc => "string"), // heredoc - // array with unset variable -/*10*/ array( @$unset_var => "hello"), + // array with object, unset variable and resource variable +/*10*/ array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'), // array with mixed keys -/*11*/ array('hello' => 1, "fruit" => 2.2, - 133 => "int", 444.432 => "float", +/*11*/ array('hello' => 1, new classA() => 2, "fruit" => 2.2, + $fp => 'resource', 133 => "int", 444.432 => "float", @$unset_var => "unset", $heredoc => "heredoc") ); @@ -74,10 +85,21 @@ foreach($arrays as $arr2) { $iterator++; } +// close the file resource used +fclose($fp); + echo "Done"; ?> --EXPECTF-- *** Testing array_intersect() : assoc array with diff keys to $arr2 argument *** + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d + +Warning: Illegal offset type in %s on line %d -- Iterator 1 -- array(0) { } diff --git a/ext/standard/tests/array/array_key_exists.phpt b/ext/standard/tests/array/array_key_exists.phpt index f433e12562..40bd54fd94 100644 --- a/ext/standard/tests/array/array_key_exists.phpt +++ b/ext/standard/tests/array/array_key_exists.phpt @@ -280,13 +280,23 @@ Warning: array_key_exists(): The first argument should be either a string or an bool(false) *** Testing operation on objects *** -bool(false) -bool(false) -bool(true) -bool(false) -bool(true) + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL bool(true) -Warning: array_key_exists(): The first argument should be either a string or an integer in %s on line %d -bool(false) +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL Done diff --git a/ext/standard/tests/array/array_key_exists_object1.phpt b/ext/standard/tests/array/array_key_exists_object1.phpt index 3b263df474..8a6120599c 100644 --- a/ext/standard/tests/array/array_key_exists_object1.phpt +++ b/ext/standard/tests/array/array_key_exists_object1.phpt @@ -52,11 +52,15 @@ echo "Done"; -- Do not assign a value to $class1->var3 -- $key = var1: -bool(true) + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL $key = var3: -bool(true) + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL $class1: -object(myClass)#1 (3) { +object(myClass)#%d (3) { ["var1"]=> string(1) "a" ["var2"]=> @@ -67,9 +71,11 @@ object(myClass)#1 (3) { -- Assign a value to $class2->var3 -- $key = var3: -bool(true) + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL $class2: -object(myClass)#2 (3) { +object(myClass)#%d (3) { ["var1"]=> string(1) "x" ["var2"]=> diff --git a/ext/standard/tests/array/array_key_exists_object2.phpt b/ext/standard/tests/array/array_key_exists_object2.phpt index 4a790e9d37..c810f868f2 100644 --- a/ext/standard/tests/array/array_key_exists_object2.phpt +++ b/ext/standard/tests/array/array_key_exists_object2.phpt @@ -54,13 +54,19 @@ echo "Done"; -- Do not assign a value to $class1->var3 -- $key = var1: -bool(true) + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL $key = var2: -bool(false) + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL $key = var3: -bool(false) + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL $class1: -object(myClass)#1 (3) { +object(myClass)#%d (3) { ["var1"]=> string(1) "a" ["var2":protected]=> @@ -71,9 +77,11 @@ object(myClass)#1 (3) { -- Assign a value to $class2->var3 -- $key = var3: -bool(false) + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL $class2: -object(myClass)#2 (3) { +object(myClass)#%d (3) { ["var1"]=> string(1) "x" ["var2":protected]=> diff --git a/ext/standard/tests/array/array_key_exists_variation2.phpt b/ext/standard/tests/array/array_key_exists_variation2.phpt index a6e9cd2bbf..9d26d37640 100644 --- a/ext/standard/tests/array/array_key_exists_variation2.phpt +++ b/ext/standard/tests/array/array_key_exists_variation2.phpt @@ -206,7 +206,9 @@ Warning: array_key_exists() expects parameter 2 to be array, string given in %s NULL -- Iteration 22 -- -bool(false) + +Warning: array_key_exists() expects parameter 2 to be array, object given in %s on line %d +NULL -- Iteration 23 -- diff --git a/ext/standard/tests/array/array_rand_variation4.phpt b/ext/standard/tests/array/array_rand_variation4.phpt index be4302d33f..72b6c55cf3 100644 --- a/ext/standard/tests/array/array_rand_variation4.phpt +++ b/ext/standard/tests/array/array_rand_variation4.phpt @@ -38,7 +38,7 @@ $asso_arrays = array( // array with special chars as keys /*6*/ array('##' => "key1", '&$r' => 'key2', '!' => "key3", '<>' =>'key4', - "NULL" => 'key5', + "NULL" => 'key5', "\n" => 'newline as key', "\t" => "tab as key", "'" => 'single quote as key', '"' => 'double quote as key', "\0" => "null char as key") ); @@ -165,3 +165,4 @@ array\(2\) { string\([0-9]*\) "[#&!N <\n\t'"\0]*[U#$>]*[rL]*[L]*" } Done + diff --git a/ext/standard/tests/array/array_slice_variation1.phpt b/ext/standard/tests/array/array_slice_variation1.phpt index 4c7a148c88..daed1d84fc 100644 --- a/ext/standard/tests/array/array_slice_variation1.phpt +++ b/ext/standard/tests/array/array_slice_variation1.phpt @@ -1,227 +1,61 @@ --TEST-- -Test array_slice() function : usage variations - Pass different data types as $input arg +Test array_slice() - Third parameter (NULL vs 0) --FILE-- <?php -/* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]]) - * Description: Returns elements specified by offset and length - * Source code: ext/standard/array.c - */ -/* - * Pass different arguments as $input argument to array_slice() to test behaviour - */ +var_dump(array_slice(range(1, 3), 0, NULL, 1)); +var_dump(array_slice(range(1, 3), 0, 0, 1)); +var_dump(array_slice(range(1, 3), 0, NULL)); +var_dump(array_slice(range(1, 3), 0, 0)); -echo "*** Testing array_slice() : usage variations ***\n"; +var_dump(array_slice(range(1, 3), -1, 0)); +var_dump(array_slice(range(1, 3), -1, 0, 1)); +var_dump(array_slice(range(1, 3), -1, NULL)); +var_dump(array_slice(range(1, 3), -1, NULL, 1)); -// Initialise function arguments not being substituted -$offset = 2; -//get an unset variable -$unset_var = 10; -unset ($unset_var); +$a = 'foo'; +var_dump(array_slice(range(1, 3), 0, $a)); +var_dump(array_slice(range(1, 3), 0, $a)); +var_dump($a); -// get a class -class classA -{ - public function __toString() { - return "Class A object"; - } -} - -// heredoc string -$heredoc = <<<EOT -hello world -EOT; - -// get a resource variable -$fp = fopen(__FILE__, "r"); - -// unexpected values to be passed to $input argument -$inputs = array( - - // int data -/*1*/ 0, - 1, - 12345, - -2345, - - // float data -/*5*/ 10.5, - -10.5, - 12.3456789000e10, - 12.3456789000E-10, - .5, - - // null data -/*10*/ NULL, - null, - - // boolean data -/*12*/ true, - false, - TRUE, - FALSE, - - // empty data -/*16*/ "", - '', - array(), - - // string data -/*19*/ "string", - 'string', - $heredoc, - - // object data -/*22*/ new classA(), - - // undefined data -/*23*/ @$undefined_var, - - // unset data -/*24*/ @$unset_var, - - // resource variable -/*25*/ $fp -); - -// loop through each element of $inputs to check the behavior of array_slice() -$iterator = 1; -foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump( array_slice($input, $offset) ); - $iterator++; -}; - -fclose($fp); - -echo "Done"; ?> --EXPECTF-- -*** Testing array_slice() : usage variations *** - --- Iteration 1 -- - -Warning: array_slice() expects parameter 1 to be array, integer given in %s on line %d -NULL - --- Iteration 2 -- - -Warning: array_slice() expects parameter 1 to be array, integer given in %s on line %d -NULL - --- Iteration 3 -- - -Warning: array_slice() expects parameter 1 to be array, integer given in %s on line %d -NULL - --- Iteration 4 -- - -Warning: array_slice() expects parameter 1 to be array, integer given in %s on line %d -NULL - --- Iteration 5 -- - -Warning: array_slice() expects parameter 1 to be array, double given in %s on line %d -NULL - --- Iteration 6 -- - -Warning: array_slice() expects parameter 1 to be array, double given in %s on line %d -NULL - --- Iteration 7 -- - -Warning: array_slice() expects parameter 1 to be array, double given in %s on line %d -NULL - --- Iteration 8 -- - -Warning: array_slice() expects parameter 1 to be array, double given in %s on line %d -NULL - --- Iteration 9 -- - -Warning: array_slice() expects parameter 1 to be array, double given in %s on line %d -NULL - --- Iteration 10 -- - -Warning: array_slice() expects parameter 1 to be array, null given in %s on line %d -NULL - --- Iteration 11 -- - -Warning: array_slice() expects parameter 1 to be array, null given in %s on line %d -NULL - --- Iteration 12 -- - -Warning: array_slice() expects parameter 1 to be array, boolean given in %s on line %d -NULL - --- Iteration 13 -- - -Warning: array_slice() expects parameter 1 to be array, boolean given in %s on line %d -NULL - --- Iteration 14 -- - -Warning: array_slice() expects parameter 1 to be array, boolean given in %s on line %d -NULL - --- Iteration 15 -- - -Warning: array_slice() expects parameter 1 to be array, boolean given in %s on line %d -NULL - --- Iteration 16 -- - -Warning: array_slice() expects parameter 1 to be array, string given in %s on line %d -NULL - --- Iteration 17 -- - -Warning: array_slice() expects parameter 1 to be array, string given in %s on line %d -NULL - --- Iteration 18 -- +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} array(0) { } - --- Iteration 19 -- - -Warning: array_slice() expects parameter 1 to be array, string given in %s on line %d -NULL - --- Iteration 20 -- - -Warning: array_slice() expects parameter 1 to be array, string given in %s on line %d -NULL - --- Iteration 21 -- - -Warning: array_slice() expects parameter 1 to be array, string given in %s on line %d -NULL - --- Iteration 22 -- - -Warning: array_slice() expects parameter 1 to be array, object given in %s on line %d -NULL - --- Iteration 23 -- - -Warning: array_slice() expects parameter 1 to be array, null given in %s on line %d -NULL - --- Iteration 24 -- - -Warning: array_slice() expects parameter 1 to be array, null given in %s on line %d -NULL - --- Iteration 25 -- - -Warning: array_slice() expects parameter 1 to be array, resource given in %s on line %d -NULL -Done
\ No newline at end of file +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +array(0) { +} +array(0) { +} +array(0) { +} +array(1) { + [0]=> + int(3) +} +array(1) { + [2]=> + int(3) +} +array(0) { +} +array(0) { +} +string(3) "foo" diff --git a/ext/standard/tests/array/array_unshift_variation1.phpt b/ext/standard/tests/array/array_unshift_variation1.phpt index 4d0c8c2069..f75bf6055f 100644 --- a/ext/standard/tests/array/array_unshift_variation1.phpt +++ b/ext/standard/tests/array/array_unshift_variation1.phpt @@ -330,9 +330,9 @@ NULL -- Iteration 24 -- Warning: array_unshift() expects parameter 1 to be array, resource given in %s on line %d NULL -resource(%d) of type (stream) +resource(5) of type (stream) Warning: array_unshift() expects parameter 1 to be array, resource given in %s on line %d NULL -resource(%d) of type (stream) +resource(5) of type (stream) Done diff --git a/ext/standard/tests/array/array_walk_object1.phpt b/ext/standard/tests/array/array_walk_object1.phpt Binary files differindex 9a76410c62..f6cbce018f 100644 --- a/ext/standard/tests/array/array_walk_object1.phpt +++ b/ext/standard/tests/array/array_walk_object1.phpt diff --git a/ext/standard/tests/array/array_walk_objects.phpt b/ext/standard/tests/array/array_walk_objects.phpt Binary files differindex 83915af7c3..a90e3e2829 100644 --- a/ext/standard/tests/array/array_walk_objects.phpt +++ b/ext/standard/tests/array/array_walk_objects.phpt diff --git a/ext/standard/tests/array/array_walk_rec_objects.phpt b/ext/standard/tests/array/array_walk_rec_objects.phpt Binary files differindex 8a819bc03e..efee37c3d5 100644 --- a/ext/standard/tests/array/array_walk_rec_objects.phpt +++ b/ext/standard/tests/array/array_walk_rec_objects.phpt diff --git a/ext/standard/tests/array/array_walk_recursive_object1.phpt b/ext/standard/tests/array/array_walk_recursive_object1.phpt Binary files differindex cc1b51ca78..16a56d37d0 100644 --- a/ext/standard/tests/array/array_walk_recursive_object1.phpt +++ b/ext/standard/tests/array/array_walk_recursive_object1.phpt diff --git a/ext/standard/tests/array/arsort_variation3.phpt b/ext/standard/tests/array/arsort_variation3.phpt index eab3b45f62..609155ca73 100644 --- a/ext/standard/tests/array/arsort_variation3.phpt +++ b/ext/standard/tests/array/arsort_variation3.phpt @@ -1,9 +1,5 @@ --TEST-- Test arsort() function : usage variations - sort integer/float values ---SKIPIF-- -<?php -if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); -?> --FILE-- <?php /* Prototype : bool arsort ( array &$array [, int $sort_flags] ) @@ -63,7 +59,7 @@ foreach ($various_arrays as $array) { echo "Done\n"; ?> ---EXPECT-- +--EXPECTF-- *** Testing arsort() : usage variations *** -- Testing arsort() by supplying various integer/float arrays -- @@ -277,7 +273,7 @@ array(11) { bool(true) array(7) { [2]=> - float(2147483648) + %s(2147483648) [1]=> int(2147483647) [6]=> @@ -287,15 +283,15 @@ array(7) { [3]=> int(-2147483647) [4]=> - float(-2147483648) + %s(-2147483648) [7]=> - float(-2147483649) + %s(-2147483649) } - Sort_flag = SORT_REGULAR - bool(true) array(7) { [2]=> - float(2147483648) + %s(2147483648) [1]=> int(2147483647) [6]=> @@ -305,15 +301,15 @@ array(7) { [3]=> int(-2147483647) [4]=> - float(-2147483648) + %s(-2147483648) [7]=> - float(-2147483649) + %s(-2147483649) } - Sort_flag = SORT_NUMERIC - bool(true) array(7) { [2]=> - float(2147483648) + %s(2147483648) [1]=> int(2147483647) [6]=> @@ -323,8 +319,8 @@ array(7) { [3]=> int(-2147483647) [4]=> - float(-2147483648) + %s(-2147483648) [7]=> - float(-2147483649) + %s(-2147483649) } Done
\ No newline at end of file diff --git a/ext/standard/tests/array/current_variation1.phpt b/ext/standard/tests/array/current_variation1.phpt index 111b8de4f7..6afed34d45 100644 --- a/ext/standard/tests/array/current_variation1.phpt +++ b/ext/standard/tests/array/current_variation1.phpt @@ -198,6 +198,8 @@ Warning: current() expects parameter 1 to be array, string given in %s on line % NULL -- Iteration 21 -- + +Warning: current() expects parameter 1 to be array, object given in %s on line %d NULL -- Iteration 22 -- diff --git a/ext/standard/tests/array/each_error.phpt b/ext/standard/tests/array/each_error.phpt index 0806bee674..0834435610 100644 --- a/ext/standard/tests/array/each_error.phpt +++ b/ext/standard/tests/array/each_error.phpt @@ -39,5 +39,4 @@ NULL Warning: each() expects exactly 1 parameter, 2 given in %s on line %d NULL -Done - +Done
\ No newline at end of file diff --git a/ext/standard/tests/array/each_variation4.phpt b/ext/standard/tests/array/each_variation4.phpt index 16b6096396..6ac57a736e 100644 --- a/ext/standard/tests/array/each_variation4.phpt +++ b/ext/standard/tests/array/each_variation4.phpt @@ -1,5 +1,7 @@ --TEST-- Test each() function : usage variations - Referenced variables +--INI-- +allow_call_time_pass_reference=on --FILE-- <?php /* Prototype : array each(array $arr) @@ -85,4 +87,4 @@ array(3) { [2]=> string(3) "two" } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/end_variation1.phpt b/ext/standard/tests/array/end_variation1.phpt index 79354aba4f..eb10b5e583 100644 --- a/ext/standard/tests/array/end_variation1.phpt +++ b/ext/standard/tests/array/end_variation1.phpt @@ -201,7 +201,9 @@ Warning: end() expects parameter 1 to be array, string given in %s on line %d NULL -- Iteration 22 -- -string(12) "hello, world" + +Warning: end() expects parameter 1 to be array, object given in %s on line %d +NULL -- Iteration 23 -- diff --git a/ext/standard/tests/array/key_variation1.phpt b/ext/standard/tests/array/key_variation1.phpt index a0c59b4956..9aade55f1b 100644 --- a/ext/standard/tests/array/key_variation1.phpt +++ b/ext/standard/tests/array/key_variation1.phpt @@ -201,7 +201,9 @@ Warning: key() expects parameter 1 to be array, string given in %s on line %d NULL -- Iteration 22 -- -string(4) "var1" + +Warning: key() expects parameter 1 to be array, object given in %s on line %d +NULL -- Iteration 23 -- diff --git a/ext/standard/tests/array/natcasesort_variation1.phpt b/ext/standard/tests/array/natcasesort_variation1.phpt index 59eadedf66..04e3c05da6 100644 --- a/ext/standard/tests/array/natcasesort_variation1.phpt +++ b/ext/standard/tests/array/natcasesort_variation1.phpt @@ -220,4 +220,3 @@ NULL Warning: natcasesort() expects parameter 1 to be array, resource given in %s on line %d NULL Done - diff --git a/ext/standard/tests/array/natcasesort_variation3.phpt b/ext/standard/tests/array/natcasesort_variation3.phpt index 77f83e1d09..f151508433 100644 --- a/ext/standard/tests/array/natcasesort_variation3.phpt +++ b/ext/standard/tests/array/natcasesort_variation3.phpt @@ -132,4 +132,4 @@ array(7) { [1]=> float(2147483648) } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/next_variation1.phpt b/ext/standard/tests/array/next_variation1.phpt index 5f477b442e..313add035a 100644 --- a/ext/standard/tests/array/next_variation1.phpt +++ b/ext/standard/tests/array/next_variation1.phpt @@ -200,7 +200,9 @@ Warning: next() expects parameter 1 to be array, string given in %s on line %d NULL -- Iteration 22 -- -bool(false) + +Warning: next() expects parameter 1 to be array, object given in %s on line %d +NULL -- Iteration 23 -- diff --git a/ext/standard/tests/array/reset_variation1.phpt b/ext/standard/tests/array/reset_variation1.phpt index b6cddf0cb5..1c19c95de7 100644 --- a/ext/standard/tests/array/reset_variation1.phpt +++ b/ext/standard/tests/array/reset_variation1.phpt @@ -200,7 +200,9 @@ Warning: reset() expects parameter 1 to be array, string given in %s on line %d NULL -- Iteration 22 -- -bool(false) + +Warning: reset() expects parameter 1 to be array, object given in %s on line %d +NULL -- Iteration 23 -- diff --git a/ext/standard/tests/array/rsort_variation3.phpt b/ext/standard/tests/array/rsort_variation3.phpt index f8c002a6f7..798e148c7b 100644 --- a/ext/standard/tests/array/rsort_variation3.phpt +++ b/ext/standard/tests/array/rsort_variation3.phpt @@ -322,4 +322,4 @@ array(7) { [6]=> float(-2147483649) } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/rsort_variation4.phpt b/ext/standard/tests/array/rsort_variation4.phpt index abbed35bad..4cab1a9334 100644 --- a/ext/standard/tests/array/rsort_variation4.phpt +++ b/ext/standard/tests/array/rsort_variation4.phpt @@ -1,5 +1,7 @@ --TEST-- Test rsort() function : usage variations - referenced variables +--INI-- +allow_call_time_pass_reference=on --FILE-- <?php /* Prototype : bool rsort(array &$array_arg [, int $sort_flags]) @@ -75,4 +77,4 @@ array(3) { [2]=> &int(33) } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/file/001-win32.phpt b/ext/standard/tests/file/001-win32.phpt index ee520940e4..d6709e8d04 100644 --- a/ext/standard/tests/file/001-win32.phpt +++ b/ext/standard/tests/file/001-win32.phpt @@ -1,7 +1,5 @@ --TEST-- File type functions ---CREDITS-- -Dave Kelsey <d_kelsey@uk.ibm.com> --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) != 'WIN') { @@ -12,6 +10,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { <?php chdir(dirname(__FILE__)); @unlink('test.file'); +@unlink('test.link'); if (file_exists('test.file')) { echo "test.file exists\n"; } else { @@ -24,11 +23,22 @@ if (file_exists('test.file')) { } else { echo "test.file does not exist\n"; } +sleep (2); +if (file_exists('test.link')) { + echo "test.link exists\n"; +} else { + echo "test.link does not exist\n"; +} if (is_link('test.file')) { echo "test.file is a symlink\n"; } else { echo "test.file is not a symlink\n"; } +if (is_link('test.link')) { + echo "test.link is a symlink\n"; +} else { + echo "test.link is not a symlink\n"; +} if (file_exists('test.file')) { echo "test.file exists\n"; } else { @@ -42,6 +52,7 @@ for ($i = 0; $i <= 12; $i++) { } } echo "test.file is " . filetype('test.file') . "\n"; +echo "test.link is <" . filetype('test.link') . ">\n"; printf ("test.file permissions are 0%o\n", 0777 & fileperms('test.file')); echo "test.file size is " . filesize('test.file') . "\n"; if (is_writeable('test.file')) { @@ -59,6 +70,16 @@ if (is_file('test.file')) { } else { echo "test.file is not a regular file\n"; } +if (is_file('test.link')) { + echo "test.link is a regular file\n"; +} else { + echo "test.link is not a regular file\n"; +} +if (is_dir('test.link')) { + echo "test.link is a directory\n"; +} else { + echo "test.link is not a directory\n"; +} if (is_dir('../file')) { echo "../file is a directory\n"; } else { @@ -82,19 +103,25 @@ if (file_exists('test.file')) { echo "test.file does not exist\n"; } ?> ---EXPECT-- +--EXPECTF-- test.file does not exist test.file exists +test.link does not exist test.file is not a symlink +test.link is not a symlink test.file exists test.file is file + +Warning: filetype(): Lstat failed for test.link in %s +test.link is <> test.file permissions are 0666 test.file size is 0 test.file is writeable test.file is readable test.file is a regular file +test.link is not a regular file +test.link is not a directory ../file is a directory test.file is not a directory test.file does not exist test.file does not exist - diff --git a/ext/standard/tests/file/006_error.phpt b/ext/standard/tests/file/006_error.phpt index bef7a89f44..04cc274ecc 100644 --- a/ext/standard/tests/file/006_error.phpt +++ b/ext/standard/tests/file/006_error.phpt @@ -11,7 +11,7 @@ $fp = fopen($filename, 'w'); fclose($fp); if(fileowner($filename) == 0) { unlink ($filename); - die('skip...cannot be run as root\n'); + die('skip cannot be run as root'); } unlink($filename); @@ -68,13 +68,13 @@ unlink( dirname(__FILE__)."/006_error.tmp"); --EXPECTF-- *** Testing error conditions for fileperms(), chmod() *** -Warning: chmod(): Operation not permitted in %s on line %d +Warning: chmod(): %s in %s on line %d bool(false) -%d +100%d44 -Warning: chmod(): Operation not permitted in %s on line %d +Warning: chmod(): %s in %s on line %d bool(false) -%d +40755 Warning: chmod(): No such file or directory in %s on line %d bool(false) @@ -105,4 +105,3 @@ Warning: fileperms() expects exactly 1 parameter, 2 given in %s on line %d NULL *** Done *** - diff --git a/ext/standard/tests/file/006_variation2.phpt b/ext/standard/tests/file/006_variation2.phpt index 9c9707664e..d56207a349 100644 --- a/ext/standard/tests/file/006_variation2.phpt +++ b/ext/standard/tests/file/006_variation2.phpt @@ -11,7 +11,7 @@ $fp = fopen($filename, 'w'); fclose($fp); if(fileowner($filename) == 0) { unlink ($filename); - die('skip...cannot be run as root\n'); + die('skip cannot be run as root'); } unlink($filename); @@ -94,94 +94,93 @@ rmdir(dirname(__FILE__)."/006_variation2"); *** Testing fileperms(), chmod() with miscellaneous permissions *** -- Iteration 1 -- bool(true) -%d +107777 bool(true) -%d +47777 -- Iteration 2 -- bool(true) -%d +100000 bool(true) -%d +40000 -- Iteration 3 -- bool(true) -%d +101000 bool(true) -%d +41000 -- Iteration 4 -- bool(true) -%d +101111 bool(true) -%d +41111 -- Iteration 5 -- bool(true) -%d +107001 bool(true) -%d +47001 -- Iteration 6 -- bool(true) -%d +100001 bool(true) -%d +40001 -- Iteration 7 -- bool(true) -%d +101411 bool(true) -%d +41411 -- Iteration 8 -- bool(true) -%d +107141 bool(true) -%d +47141 -- Iteration 9 -- bool(true) -%d +100637 bool(true) -%d +40637 -- Iteration 10 -- bool(true) -%d +103567 bool(true) -%d +43567 -- Iteration 11 -- bool(true) -%d +103567 bool(true) -%d +43567 -- Iteration 12 -- Warning: chmod() expects parameter 2 to be long, string given in %s on line %d NULL -%d +103567 Warning: chmod() expects parameter 2 to be long, string given in %s on line %d NULL -%d +43567 -- Iteration 13 -- Warning: chmod() expects parameter 2 to be long, string given in %s on line %d NULL -%d +103567 Warning: chmod() expects parameter 2 to be long, string given in %s on line %d NULL -%d +43567 -- Iteration 14 -- Warning: chmod() expects parameter 2 to be long, string given in %s on line %d NULL -%d +103567 Warning: chmod() expects parameter 2 to be long, string given in %s on line %d NULL -%d +43567 -- Iteration 15 -- Warning: chmod() expects parameter 2 to be long, string given in %s on line %d NULL -%d +103567 Warning: chmod() expects parameter 2 to be long, string given in %s on line %d NULL -%d +43567 *** Done *** - diff --git a/ext/standard/tests/file/007_error.phpt b/ext/standard/tests/file/007_error.phpt index ecec336f84..cc986ebdae 100644 --- a/ext/standard/tests/file/007_error.phpt +++ b/ext/standard/tests/file/007_error.phpt @@ -1,7 +1,5 @@ --TEST-- Test fopen, fclose() & feof() functions: error conditions ---CREDITS-- -Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php /* @@ -46,6 +44,7 @@ var_dump( feof($fp, "handle")); fclose($fp); /* test invalid arguments : non-resources */ +chdir(dirname(__FILE__)); echo "-- Testing fopen(), fclose() & feof() with invalid arguments --\n"; $invalid_args = array ( "string", @@ -79,7 +78,7 @@ bool(false) Warning: fclose(): 5 is not a valid stream resource in %s on line %d bool(false) -Warning: fclose() expects parameter 1 to be resource, string given in %s on line %d +Warning: fclose() expects parameter 1 to be resource, string given %s on line %d bool(false) Warning: fclose() expects exactly 1 parameter, 0 given in %s on line %d @@ -88,7 +87,7 @@ bool(false) Warning: feof(): 5 is not a valid stream resource in %s on line %d bool(false) -Warning: feof() expects parameter 1 to be resource, string given in %s on line %d +Warning: feof() expects parameter 1 to be resource, string given %s on line %d bool(false) Warning: feof() expects exactly 1 parameter, 0 given in %s on line %d @@ -179,4 +178,3 @@ bool(false) Warning: feof() expects parameter 1 to be resource, string given in %s on line %d bool(false) - diff --git a/ext/standard/tests/file/bug41655_1.phpt b/ext/standard/tests/file/bug41655_1.phpt index 62d64dfb1e..d02de7066a 100644 --- a/ext/standard/tests/file/bug41655_1.phpt +++ b/ext/standard/tests/file/bug41655_1.phpt @@ -1,15 +1,12 @@ --TEST-- Bug #41655 (open_basedir bypass via glob()) 1/2 ---CREDITS-- -Dave Kelsey <d_kelsey@uk.ibm.com> --INI-- open_basedir=/tmp --FILE-- <?php -$a=glob("./*.jpeg"); -var_dump($a); + $a=glob("./*.jpeg"); + echo "Done\n"; ?> --EXPECT-- -bool(false) Done
\ No newline at end of file diff --git a/ext/standard/tests/file/copy_variation13.phpt b/ext/standard/tests/file/copy_variation13.phpt index 779f82b6f6..a71c597e41 100644 --- a/ext/standard/tests/file/copy_variation13.phpt +++ b/ext/standard/tests/file/copy_variation13.phpt @@ -1,5 +1,5 @@ --TEST-- -Test copy() function: usage variations - src as dir and dest as an existing file(Bug #42243) +Test copy() function: usage variations - src as dir and dest as an existing file (Bug #42243) --FILE-- <?php /* Prototype: bool copy ( string $source, string $dest ); diff --git a/ext/standard/tests/file/copy_variation15.phpt b/ext/standard/tests/file/copy_variation15.phpt index fbf5e7bf9e..a6404fcd8d 100644 --- a/ext/standard/tests/file/copy_variation15.phpt +++ b/ext/standard/tests/file/copy_variation15.phpt @@ -2,8 +2,8 @@ Test copy() function: usage variations - destination dir access perms --SKIPIF-- <?php -if(substr(PHP_OS, 0, 3) == 'WIN') - die("skip do not run on Windows"); +if( (stristr(PHP_OS, "Darwin")) || (stristr(PHP_OS, "Win")) ) + die("skip do not run on MacOS/Windows"); // Skip if being run by root (files are always readable, writeable and executable) $filename = dirname(__FILE__)."/copy_variation15_root_check.tmp"; $fp = fopen($filename, 'w'); diff --git a/ext/standard/tests/file/copy_variation18.phpt b/ext/standard/tests/file/copy_variation18.phpt index 53467af8a3..65c1dc2ef6 100644 --- a/ext/standard/tests/file/copy_variation18.phpt +++ b/ext/standard/tests/file/copy_variation18.phpt @@ -16,7 +16,7 @@ require($file_path."/file.inc"); echo "*** Test copy() function: stat of file before and after copy ***\n"; $src_file_name = $file_path."/copy_variation18.tmp"; $file_handle = fopen($src_file_name, "w"); -fwrite($file_handle, str_repeat("Hello2world...\n", 100)); +fwrite($file_handle, str_repeat(b"Hello2world...\n", 100)); fclose($file_handle); $dest_file_name = $file_path."/copy_copy_variation18.tmp"; @@ -32,13 +32,8 @@ var_dump( copy($src_file_name, $dest_file_name) ); $stat_after_copy = stat($src_file_name); clearstatcache(); -// compare all stat fields except access time -$stat_keys_to_compare = array("dev", "ino", "mode", "nlink", "uid", "gid", - "rdev", "size", "mtime", "ctime", - "blksize", "blocks"); - echo "Comparing the stats of file before and after copy operation => "; -var_dump( compare_stats($stat_before_copy, $stat_after_copy, $stat_keys_to_compare) ); +var_dump( compare_stats($stat_before_copy, $stat_after_copy, $all_stat_keys) ); echo "*** Done ***\n"; ?> @@ -48,7 +43,6 @@ echo "*** Done ***\n"; unlink(dirname(__FILE__)."/copy_copy_variation18.tmp"); unlink(dirname(__FILE__)."/copy_variation18.tmp"); ?> - --EXPECTF-- *** Test copy() function: stat of file before and after copy *** Copy operation => bool(true) diff --git a/ext/standard/tests/file/copy_variation9.phpt b/ext/standard/tests/file/copy_variation9.phpt index 824bed0c76..d5a0587de4 100644 --- a/ext/standard/tests/file/copy_variation9.phpt +++ b/ext/standard/tests/file/copy_variation9.phpt @@ -2,8 +2,8 @@ Test copy() function: usage variations - destination file access perms --SKIPIF-- <?php -if(substr(PHP_OS, 0, 3) == 'WIN') - die("skip do not run on Windows"); +if( (stristr(PHP_OS, "Darwin")) || (stristr(PHP_OS, "Win")) ) + die("skip do not run on MacOS/Windows"); // Skip if being run by root (files are always readable, writeable and executable) $filename = dirname(__FILE__)."/copy_variation9_root_check.tmp"; diff --git a/ext/standard/tests/file/disk.phpt b/ext/standard/tests/file/disk.phpt index e1a74fc984..6eef4b4a77 100644 --- a/ext/standard/tests/file/disk.phpt +++ b/ext/standard/tests/file/disk.phpt @@ -37,8 +37,8 @@ bool(false) Warning: disk_total_space(): No such file or directory in %s on line %d bool(false) -float(%f) -float(%f) +float(%d) +float(%d) Warning: disk_free_space(): No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt index cae37bad59..f8684e92a9 100644 --- a/ext/standard/tests/file/disk_free_space_basic.phpt +++ b/ext/standard/tests/file/disk_free_space_basic.phpt @@ -7,26 +7,27 @@ memory_limit=32M /* * Prototype: float disk_free_space( string directory ) * Description: Given a string containing a directory, this function - * will return the number of bytes available on the corresponding - * filesystem or disk partition + * will return the number of bytes available on the corresponding + * filesystem or disk partition */ $file_path = dirname(__FILE__); -include($file_path."/file.inc"); echo "*** Testing with existing directory ***\n"; var_dump( disk_free_space($file_path) ); var_dump( diskfreespace($file_path) ); -$dir = "/disk_free_space"; echo "*** Testing with newly created directory ***\n"; +$dir = "/disk_free_space"; mkdir($file_path.$dir); echo" \n Free Space before writing to a file\n"; $space1 = disk_free_space($file_path.$dir); -var_dump($space1); +var_dump( $space1 ); -fill_buffer($buffer, "text", 3000000); -file_put_contents($file_path.$dir."/disk_free_space.tmp", $buffer); +$fh = fopen($file_path.$dir."/disk_free_space.tmp", "a"); +for( $i=1; $i<=1000; $i++) +fwrite($fh, (binary)"x"); +fclose($fh); echo "\n Free Space after writing to a file\n"; $space2 = disk_free_space($file_path.$dir); @@ -37,29 +38,33 @@ if( $space1 > $space2 ) else echo "\n Free Space Value Is Incorrect\n"; -echo"\n-- Done --"; +echo "*** Testing with Binary Input ***\n"; +var_dump( disk_free_space(b"$file_path") ); + +echo"\n--- Done ---"; ?> --CLEAN-- <?php $file_path = dirname(__FILE__); -$dir = "/disk_free_space"; -unlink($file_path.$dir."/disk_free_space.tmp"); -rmdir($file_path.$dir); +unlink($file_path."/disk_free_space/disk_free_space.tmp"); +rmdir($file_path."/disk_free_space"); ?> --EXPECTF-- *** Testing with existing directory *** -float(%f) -float(%f) +float(%d) +float(%d) *** Testing with newly created directory *** Free Space before writing to a file -float(%f) +float(%d) Free Space after writing to a file -float(%f) +float(%d) Free Space Value Is Correct +*** Testing with Binary Input *** +float(%d) --- Done -- +--- Done --- diff --git a/ext/standard/tests/file/disk_free_space_error.phpt b/ext/standard/tests/file/disk_free_space_error.phpt index 945b7b9c84..ddd25a35db 100644 --- a/ext/standard/tests/file/disk_free_space_error.phpt +++ b/ext/standard/tests/file/disk_free_space_error.phpt @@ -1,15 +1,15 @@ --TEST-- -Test disk_free_space and its alias diskfreespace() functions : error conditions +Test disk_free_space and its alias diskfreespace() functions : error conditions. --SKIPIF-- <?php -if(substr(PHP_OS, 0, 3) == 'WIN' ) - die("skip Not Valid for Windows"); +if(substr(PHP_OS, 0, 3) == 'WIN') + die("skip Not valid on Windows"); ?> --FILE-- <?php /* * Prototype: float disk_free_space( string directory ) - * Description: Given a string containing a directory, this function will + * Description: Given a string containing a directory, this function will * return the number of bytes available on the corresponding * filesystem or disk partition */ @@ -27,7 +27,7 @@ var_dump( disk_free_space( $file_path."/dir1" )); // Invalid directory var_dump( diskfreespace( $file_path."/dir1" )); $fh = fopen( $file_path."/disk_free_space.tmp", "w" ); -fwrite( $fh, " Garbage data for the temporary file" ); +fwrite( $fh, (binary)" Garbage data for the temporary file" ); var_dump( disk_free_space( $file_path."/disk_free_space.tmp" )); // file input instead of directory var_dump( diskfreespace( $file_path."/disk_free_space.tmp" )); fclose($fh); @@ -55,12 +55,13 @@ NULL Warning: diskfreespace() expects exactly 1 parameter, 2 given in %s on line %d NULL -Warning: disk_free_space(): %s in %s on line %d +Warning: disk_free_space(): No such file or directory in %s on line %d bool(false) -Warning: diskfreespace(): %s in %s on line %d +Warning: diskfreespace(): No such file or directory in %s on line %d bool(false) -float(%f) -float(%f) +float(%d) +float(%d) -- Done -- + diff --git a/ext/standard/tests/file/disk_free_space_variation.phpt b/ext/standard/tests/file/disk_free_space_variation.phpt index 01fa183735..c1809986fd 100644 --- a/ext/standard/tests/file/disk_free_space_variation.phpt +++ b/ext/standard/tests/file/disk_free_space_variation.phpt @@ -1,5 +1,5 @@ --TEST-- -Test disk_free_space and its alias diskfreespace() functions : usage variations +Test disk_free_space and its alias diskfreespace() functions : Usage Variations --FILE-- <?php /* @@ -11,16 +11,15 @@ Test disk_free_space and its alias diskfreespace() functions : usage variations $file_path = dirname(__FILE__); -echo "*** Testing disk_free_space() function with a directory ***\n"; +echo "*** Testing with a directory ***\n"; var_dump( disk_free_space($file_path."/..") ); var_dump( diskfreespace($file_path."/..") ); -echo "\n*** Testing for the return type ***\n"; +echo "\nTesting for the return type ***\n"; $return_value = disk_free_space($file_path); var_dump( is_float($return_value) ); -echo "\n*** Testing disk_free_space() function with different styles of file and directory ***"; - +echo "\n*** Testing with different directory combinations ***"; $dir = "/disk_free_space"; mkdir($file_path.$dir); @@ -42,15 +41,15 @@ $dirs_arr = array( $file_path.$dir.chr(0), $file_path."/.".$dir.chr(0), ".".chr(0).$file_path.$dir, - ".".chr(0).$file_path.$dir.chr(0) + ".".chr(0).$file_path.$dir.chr(0) ); $count = 1; /* loop through to test each element the above array */ -foreach($dirs_arr as $dir) { +foreach($dirs_arr as $dir1) { echo "\n-- Iteration $count --\n"; - var_dump( disk_free_space( $dir ) ); - var_dump( diskfreespace( $dir ) ); + var_dump( disk_free_space( $dir1 ) ); + var_dump( diskfreespace( $dir1 ) ); $count++; } @@ -59,65 +58,66 @@ echo"\n--- Done ---"; --CLEAN-- <?php -$file_path = dirname(__FILE__)."/disk_free_space"; -rmdir($file_path); +$file_path = dirname(__FILE__); +rmdir($file_path."/disk_free_space"); ?> + --EXPECTF-- -*** Testing disk_free_space() function with a directory *** -float(%f) -float(%f) +*** Testing with a directory *** +float(%d) +float(%d) -*** Testing for the return type *** +Testing for the return type *** bool(true) -*** Testing disk_free_space() function with different styles of file and directory *** +*** Testing with different directory combinations *** -- Iteration 1 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 2 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 3 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 4 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 5 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 6 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 7 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 8 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 9 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 10 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 11 -- -float(%f) -float(%f) +float(%d) +float(%d) -- Iteration 12 -- -float(%f) -float(%f) +float(%d) +float(%d) --- Done --- diff --git a/ext/standard/tests/file/disk_total_space_basic.phpt b/ext/standard/tests/file/disk_total_space_basic.phpt index 8f3a2f21c3..d211f39437 100644 --- a/ext/standard/tests/file/disk_total_space_basic.phpt +++ b/ext/standard/tests/file/disk_total_space_basic.phpt @@ -4,31 +4,31 @@ Test disk_total_space() function : basic functionality <?php /* * Prototype: float disk_total_space( string $directory ); - * Description: given a string containing a directory, this - * function will return the total number of bytes - * on the corresponding filesyatem or disk partition. + * Description: given a string containing a directory, this function will + * return the total number of bytes on the corresponding filesyatem + * or disk partition. */ $file_path = dirname(__FILE__); -echo "*** Testing with existing directory ***\n"; +echo "*** Testing with normal directory ***\n"; var_dump( disk_total_space($file_path) ); echo "*** Testing with newly created directory ***\n"; -mkdir($file_path."/disk_total_space"); -var_dump( disk_total_space($file_path."/disk_total_space") ); +$dir = "/disk_total_space"; -$fh = fopen($file_path."/disk_total_space/disk_total_space.tmp", "w"); -fwrite($fh, "Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data"); +mkdir($file_path.$dir); +var_dump( disk_total_space($file_path.$dir) ); +$fh = fopen($file_path.$dir."/disk_total_space.tmp", "w"); +fwrite($fh, (binary)"Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data"); fclose($fh); -echo" \n Total Space after writing to a file\n"; -var_dump( disk_total_space($file_path."/disk_total_space") ); +echo"\nTotal Space after writing to a file\n"; +var_dump( disk_total_space($file_path.$dir) ); -echo"\n--- Done ---"; +echo"\n-- Done --"; ?> - --CLEAN-- <?php $file_path = dirname(__FILE__); @@ -37,12 +37,12 @@ rmdir($file_path."/disk_total_space"); ?> --EXPECTF-- -*** Testing with existing directory *** -float(%f) +*** Testing with normal directory *** +float(%d) *** Testing with newly created directory *** -float(%f) - - Total Space after writing to a file -float(%f) +float(%d) + +Total Space after writing to a file +float(%d) ---- Done --- +-- Done -- diff --git a/ext/standard/tests/file/disk_total_space_error.phpt b/ext/standard/tests/file/disk_total_space_error.phpt index 196028007e..d986f779ba 100644 --- a/ext/standard/tests/file/disk_total_space_error.phpt +++ b/ext/standard/tests/file/disk_total_space_error.phpt @@ -2,14 +2,14 @@ Test disk_total_space() function : error conditions --SKIPIF-- <?php -if(substr(PHP_OS, 0, 3) == 'WIN' ) - die("skip Not Valid for Windows"); +if(substr(PHP_OS, 0, 3) == 'WIN') + die("skip Not valid on Windows"); ?> --FILE-- <?php /* * Prototype: float disk_total_space( string $directory ); - * Description: given a string containing a directory, this function + * Description: given a string containing a directory, this function * will return the total number of bytes on the corresponding * filesystem or disk partition */ @@ -24,7 +24,7 @@ var_dump( disk_total_space( $file_path, "extra argument") ); // More than valid var_dump( disk_total_space( $file_path."/dir1" )); // Invalid directory $fh = fopen( $file_path."/disk_total_space.tmp", "w" ); -fwrite( $fh, " Garbage data for the temporary file" ); +fwrite( $fh, (binary)" Garbage data for the temporary file" ); var_dump( disk_total_space( $file_path."/disk_total_space.tmp" )); // file input instead of directory fclose($fh); @@ -46,6 +46,7 @@ NULL Warning: disk_total_space(): No such file or directory in %s on line %d bool(false) -float(%f) +float(%d) --- Done --- + diff --git a/ext/standard/tests/file/disk_total_space_variation.phpt b/ext/standard/tests/file/disk_total_space_variation.phpt index 6cd96cd872..c03ba594bd 100644 --- a/ext/standard/tests/file/disk_total_space_variation.phpt +++ b/ext/standard/tests/file/disk_total_space_variation.phpt @@ -1,5 +1,5 @@ --TEST-- -Test disk_total_space() functions : usage variations +Testing disk_total_space() functions : Usage Variations. --FILE-- <?php /* @@ -18,9 +18,9 @@ echo "\nTesting for the return type ***\n"; $return_value = disk_total_space($file_path); var_dump( is_float($return_value) ); -echo "\n*** Testing disk_total_space() function with different directory combinations ***"; - +echo "\n*** Testing with different directory combinations ***"; $dir = "/disk_total_space"; + mkdir($file_path.$dir); $dirs_arr = array( @@ -29,7 +29,7 @@ $dirs_arr = array( $file_path."/.".$dir, /* Testing a file trailing slash */ - $file_path.$dir."/", + $file_path."".$dir."/", $file_path."/.".$dir."/", /* Testing file with double trailing slashes */ @@ -44,6 +44,7 @@ $dirs_arr = array( ".".chr(0).$file_path.$dir.chr(0) ); + $count = 1; /* loop through to test each element the above array */ foreach($dirs_arr as $dir1) { @@ -52,57 +53,63 @@ foreach($dirs_arr as $dir1) { $count++; } +echo "*** Testing with Binary Input ***\n"; +var_dump( disk_total_space(b"$file_path") ); + echo"\n--- Done ---"; ?> --CLEAN-- <?php $file_path = dirname(__FILE__); -$dir = "/disk_total_space"; -rmdir($file_path.$dir); +rmdir($file_path."/disk_total_space"); ?> + + --EXPECTF-- *** Testing with a directory *** -float(%f) +float(%d) Testing for the return type *** bool(true) -*** Testing disk_total_space() function with different directory combinations *** +*** Testing with different directory combinations *** -- Iteration 1 -- -float(%f) +float(%d) -- Iteration 2 -- -float(%f) +float(%d) -- Iteration 3 -- -float(%f) +float(%d) -- Iteration 4 -- -float(%f) +float(%d) -- Iteration 5 -- -float(%f) +float(%d) -- Iteration 6 -- -float(%f) +float(%d) -- Iteration 7 -- -float(%f) +float(%d) -- Iteration 8 -- -float(%f) +float(%d) -- Iteration 9 -- -float(%f) +float(%d) -- Iteration 10 -- -float(%f) +float(%d) -- Iteration 11 -- -float(%f) +float(%d) -- Iteration 12 -- -float(%f) +float(%d) +*** Testing with Binary Input *** +float(%d) --- Done --- diff --git a/ext/standard/tests/file/fflush_error.phpt b/ext/standard/tests/file/fflush_error.phpt index 9f745e5202..6d7f731763 100644 --- a/ext/standard/tests/file/fflush_error.phpt +++ b/ext/standard/tests/file/fflush_error.phpt @@ -24,10 +24,9 @@ if($file_handle == false) var_dump( fflush($file_handle, $file_handle) ); fclose($file_handle); -fflush($file_handle); // test invalid arguments : non-resources -echo "\n-- Testing fflush(): with invalid arguments --\n"; +echo "-- Testing fflush(): with invalid arguments --\n"; $invalid_args = array ( "string", 10, @@ -42,7 +41,7 @@ for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { echo "-- Iteration $loop_counter --\n"; var_dump( fflush($invalid_args[$loop_counter - 1]) ); } -echo "Done\n"; +echo "\n*** Done ***"; ?> --CLEAN-- @@ -61,9 +60,6 @@ bool(false) Warning: fflush() expects exactly 1 parameter, 2 given in %s on line %d bool(false) - -Warning: fflush(): %d is not a valid stream resource in %s on line %d - -- Testing fflush(): with invalid arguments -- -- Iteration 1 -- @@ -89,5 +85,6 @@ bool(false) Warning: fflush() expects parameter 1 to be resource, object given in %s on line %d bool(false) -Done + +*** Done *** diff --git a/ext/standard/tests/file/fgets_error.phpt b/ext/standard/tests/file/fgets_error.phpt index 51ae3c6a37..a55c53f9bf 100644 --- a/ext/standard/tests/file/fgets_error.phpt +++ b/ext/standard/tests/file/fgets_error.phpt @@ -99,10 +99,9 @@ bool(false) Warning: fgets() expects parameter 1 to be resource, object given in %s on line %d bool(false) -- Testing fgets() with closed/unset file handle -- -Warning: fgets(): %d is not a valid stream resource in %s on line %d +Warning: fgets(): 5 is not a valid stream resource in %s on line %d bool(false) Warning: fgets() expects parameter 1 to be resource, null given in %s on line %d bool(false) Done - diff --git a/ext/standard/tests/file/fgets_variation2.phpt b/ext/standard/tests/file/fgets_variation2.phpt index 964216bf8c..b24956a59d 100644 --- a/ext/standard/tests/file/fgets_variation2.phpt +++ b/ext/standard/tests/file/fgets_variation2.phpt @@ -43,10 +43,10 @@ echo "Done"; *** Testing fgets() : usage variations *** -- Testing fgets() with closed handle -- -Warning: fgets(): %d is not a valid stream resource in %s on line %d +Warning: fgets(): 6 is not a valid stream resource in %s on line %d bool(false) -Warning: fgets(): %d is not a valid stream resource in %s on line %d +Warning: fgets(): 6 is not a valid stream resource in %s on line %d bool(false) -- Testing fgets() with unset handle -- @@ -60,4 +60,3 @@ Notice: Undefined variable: file_handle in %s on line %d Warning: fgets() expects parameter 1 to be resource, null given in %s on line %d bool(false) Done - diff --git a/ext/standard/tests/file/file.inc b/ext/standard/tests/file/file.inc index efb425ca42..a18fd2ceb4 100644 --- a/ext/standard/tests/file/file.inc +++ b/ext/standard/tests/file/file.inc @@ -7,7 +7,7 @@ delete_links() : delete links fill_files() : fill file with specified contents change_file_perms() : Change permission of files - fill_buffer() : fills buffer with specified contents + fill_buffer() : fill buffer with specified contents compare_self_stat() : compares the first 13 elements of the stat with the corresponding named key values of the same stat. @@ -80,7 +80,7 @@ function fill_buffer(&$buffer, $fill_type, $fill_size) { } /* - Function : bool fill_file(resource $file_handle, string $fill_type, string $file_size); + Function : bool fill_file(resource $file_handle, string $fill_type, int $file_size); Description: Fills the file with data as specified with requested size. $file_handle = file handle, opened with write options, $fill_type: @@ -638,6 +638,8 @@ function compare_stats($stat1, $stat2, $fields, $op = "==", $flag = false ) { // if the result is false(i.e values are not as expected), // dump the stat array so that easy to figure out the error if ( $result == false ) { + echo "\n Dumping diff between stat array 1 and 2...\n"; + var_dump(array_diff($stat1, $stat2)); echo "\n Dumping stat array 1...\n"; var_dump($stat1); echo "\n Dumping stat array 2...\n"; diff --git a/ext/standard/tests/file/filesize_variation1.phpt b/ext/standard/tests/file/filesize_variation1.phpt index 0a490cd7e6..a8a4d4e7f5 100644 --- a/ext/standard/tests/file/filesize_variation1.phpt +++ b/ext/standard/tests/file/filesize_variation1.phpt @@ -3,7 +3,7 @@ Test filesize() function: usage variations - size of files --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip Not valid on Windows'); + die('skip only valid for Linux'); } --FILE-- <?php @@ -32,14 +32,14 @@ echo "Done\n"; --EXPECTF-- *** Testing filesize(): usage variations *** *** Checking filesize() with different size of files *** -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) +int(1024) +int(1025024) +int(2049024) +int(3073024) +int(4097024) +int(5121024) +int(6145024) +int(7169024) +int(8193024) +int(9217024) Done diff --git a/ext/standard/tests/file/flock_error.phpt b/ext/standard/tests/file/flock_error.phpt index fe61e2a173..077e5430ba 100644 --- a/ext/standard/tests/file/flock_error.phpt +++ b/ext/standard/tests/file/flock_error.phpt @@ -94,7 +94,7 @@ NULL Warning: flock() expects parameter 2 to be long, string given in %s on line %d NULL -Warning: flock(): %d is not a valid stream resource in %s on line %d +Warning: flock(): 6 is not a valid stream resource in %s on line %d bool(false) Warning: flock() expects parameter 1 to be resource, string given in %s on line %d diff --git a/ext/standard/tests/file/flock_variation.phpt b/ext/standard/tests/file/flock_variation.phpt index 339f10cb9f..af67ab402a 100644 --- a/ext/standard/tests/file/flock_variation.phpt +++ b/ext/standard/tests/file/flock_variation.phpt @@ -1,45 +1,371 @@ --TEST-- -Test flock() function: usage variations +Test flock() function: Variations --FILE-- <?php /* Prototype: bool flock(resource $handle, int $operation [, int &$wouldblock]); -Description: PHP supports a portable way of locking complete files in an advisory way +Description: PHP supports a portable way of locking complete files + in an advisory way */ -echo "*** Test flock() function: with the operations given as numeric values ***\n"; +echo "*** Testing flock() fun with the various operation and + wouldblock values ***\n"; +$file = dirname(__FILE__)."/flock.tmp"; +$fp = fopen($file, "w"); -$filename = dirname(__FILE__)."/flock_variation.tmp"; -$file_handle = fopen($filename, "w"); - -/* array of operations */ +/* array of operatons */ $operations = array( - 1, //nothing but LOCK_SH - 2, //nothing but LOCK_EX - 2.234, //nothing but LOCK_EX - TRUE //nothing but LOCK_SH + LOCK_SH, + LOCK_EX, + LOCK_SH|LOCK_NB, + LOCK_EX|LOCK_NB, + LOCK_SH|LOCK_EX, + LOCK_UN, + 1, + 2, + 2.234, + TRUE +); + +/* array of wouldblocks */ +$wouldblocks = array( + 0, + 1, + 2, + 1.234, + TRUE, + FALSE, + NULL, + array(1,2,3), + array(), + "string", + "", + /* binary input */ + b"string", + b"", + "\0" ); $i = 0; foreach($operations as $operation) { - var_dump(flock($file_handle, $operation)); - var_dump(flock($file_handle, 3)); //nothing but LOCK_UN + echo "--- Outer iteration $i ---\n"; + var_dump(flock($fp, $operation)); + $j = 0; + foreach($wouldblocks as $wouldblock) { + echo "-- Inner iteration $j in $i --\n"; + var_dump(flock($fp, $operation, $wouldblock)); + $j++; + } $i++; } -fclose($file_handle); -unlink($filename); +fclose($fp); +@unlink($file); -echo "*** Done ***\n"; +echo "\n*** Done ***\n"; ?> --EXPECTF-- -*** Test flock() function: with the operations given as numeric values *** +*** Testing flock() fun with the various operation and + wouldblock values *** +--- Outer iteration 0 --- +bool(true) +-- Inner iteration 0 in 0 -- +bool(true) +-- Inner iteration 1 in 0 -- +bool(true) +-- Inner iteration 2 in 0 -- +bool(true) +-- Inner iteration 3 in 0 -- +bool(true) +-- Inner iteration 4 in 0 -- +bool(true) +-- Inner iteration 5 in 0 -- +bool(true) +-- Inner iteration 6 in 0 -- +bool(true) +-- Inner iteration 7 in 0 -- +bool(true) +-- Inner iteration 8 in 0 -- +bool(true) +-- Inner iteration 9 in 0 -- +bool(true) +-- Inner iteration 10 in 0 -- +bool(true) +-- Inner iteration 11 in 0 -- +bool(true) +-- Inner iteration 12 in 0 -- +bool(true) +-- Inner iteration 13 in 0 -- +bool(true) +--- Outer iteration 1 --- +bool(true) +-- Inner iteration 0 in 1 -- +bool(true) +-- Inner iteration 1 in 1 -- +bool(true) +-- Inner iteration 2 in 1 -- +bool(true) +-- Inner iteration 3 in 1 -- +bool(true) +-- Inner iteration 4 in 1 -- +bool(true) +-- Inner iteration 5 in 1 -- +bool(true) +-- Inner iteration 6 in 1 -- +bool(true) +-- Inner iteration 7 in 1 -- +bool(true) +-- Inner iteration 8 in 1 -- +bool(true) +-- Inner iteration 9 in 1 -- +bool(true) +-- Inner iteration 10 in 1 -- +bool(true) +-- Inner iteration 11 in 1 -- +bool(true) +-- Inner iteration 12 in 1 -- +bool(true) +-- Inner iteration 13 in 1 -- +bool(true) +--- Outer iteration 2 --- +bool(true) +-- Inner iteration 0 in 2 -- +bool(true) +-- Inner iteration 1 in 2 -- +bool(true) +-- Inner iteration 2 in 2 -- +bool(true) +-- Inner iteration 3 in 2 -- +bool(true) +-- Inner iteration 4 in 2 -- +bool(true) +-- Inner iteration 5 in 2 -- +bool(true) +-- Inner iteration 6 in 2 -- +bool(true) +-- Inner iteration 7 in 2 -- +bool(true) +-- Inner iteration 8 in 2 -- +bool(true) +-- Inner iteration 9 in 2 -- +bool(true) +-- Inner iteration 10 in 2 -- +bool(true) +-- Inner iteration 11 in 2 -- +bool(true) +-- Inner iteration 12 in 2 -- +bool(true) +-- Inner iteration 13 in 2 -- +bool(true) +--- Outer iteration 3 --- +bool(true) +-- Inner iteration 0 in 3 -- +bool(true) +-- Inner iteration 1 in 3 -- +bool(true) +-- Inner iteration 2 in 3 -- +bool(true) +-- Inner iteration 3 in 3 -- +bool(true) +-- Inner iteration 4 in 3 -- +bool(true) +-- Inner iteration 5 in 3 -- +bool(true) +-- Inner iteration 6 in 3 -- +bool(true) +-- Inner iteration 7 in 3 -- +bool(true) +-- Inner iteration 8 in 3 -- +bool(true) +-- Inner iteration 9 in 3 -- +bool(true) +-- Inner iteration 10 in 3 -- +bool(true) +-- Inner iteration 11 in 3 -- +bool(true) +-- Inner iteration 12 in 3 -- +bool(true) +-- Inner iteration 13 in 3 -- +bool(true) +--- Outer iteration 4 --- +bool(true) +-- Inner iteration 0 in 4 -- +bool(true) +-- Inner iteration 1 in 4 -- +bool(true) +-- Inner iteration 2 in 4 -- +bool(true) +-- Inner iteration 3 in 4 -- +bool(true) +-- Inner iteration 4 in 4 -- +bool(true) +-- Inner iteration 5 in 4 -- +bool(true) +-- Inner iteration 6 in 4 -- +bool(true) +-- Inner iteration 7 in 4 -- +bool(true) +-- Inner iteration 8 in 4 -- +bool(true) +-- Inner iteration 9 in 4 -- bool(true) +-- Inner iteration 10 in 4 -- bool(true) +-- Inner iteration 11 in 4 -- bool(true) +-- Inner iteration 12 in 4 -- bool(true) +-- Inner iteration 13 in 4 -- bool(true) +--- Outer iteration 5 --- bool(true) +-- Inner iteration 0 in 5 -- bool(true) +-- Inner iteration 1 in 5 -- bool(true) +-- Inner iteration 2 in 5 -- +bool(true) +-- Inner iteration 3 in 5 -- +bool(true) +-- Inner iteration 4 in 5 -- +bool(true) +-- Inner iteration 5 in 5 -- +bool(true) +-- Inner iteration 6 in 5 -- +bool(true) +-- Inner iteration 7 in 5 -- +bool(true) +-- Inner iteration 8 in 5 -- +bool(true) +-- Inner iteration 9 in 5 -- +bool(true) +-- Inner iteration 10 in 5 -- +bool(true) +-- Inner iteration 11 in 5 -- +bool(true) +-- Inner iteration 12 in 5 -- +bool(true) +-- Inner iteration 13 in 5 -- +bool(true) +--- Outer iteration 6 --- +bool(true) +-- Inner iteration 0 in 6 -- +bool(true) +-- Inner iteration 1 in 6 -- +bool(true) +-- Inner iteration 2 in 6 -- +bool(true) +-- Inner iteration 3 in 6 -- +bool(true) +-- Inner iteration 4 in 6 -- +bool(true) +-- Inner iteration 5 in 6 -- +bool(true) +-- Inner iteration 6 in 6 -- +bool(true) +-- Inner iteration 7 in 6 -- +bool(true) +-- Inner iteration 8 in 6 -- +bool(true) +-- Inner iteration 9 in 6 -- +bool(true) +-- Inner iteration 10 in 6 -- +bool(true) +-- Inner iteration 11 in 6 -- +bool(true) +-- Inner iteration 12 in 6 -- +bool(true) +-- Inner iteration 13 in 6 -- +bool(true) +--- Outer iteration 7 --- +bool(true) +-- Inner iteration 0 in 7 -- +bool(true) +-- Inner iteration 1 in 7 -- +bool(true) +-- Inner iteration 2 in 7 -- +bool(true) +-- Inner iteration 3 in 7 -- +bool(true) +-- Inner iteration 4 in 7 -- +bool(true) +-- Inner iteration 5 in 7 -- +bool(true) +-- Inner iteration 6 in 7 -- +bool(true) +-- Inner iteration 7 in 7 -- +bool(true) +-- Inner iteration 8 in 7 -- +bool(true) +-- Inner iteration 9 in 7 -- +bool(true) +-- Inner iteration 10 in 7 -- +bool(true) +-- Inner iteration 11 in 7 -- +bool(true) +-- Inner iteration 12 in 7 -- +bool(true) +-- Inner iteration 13 in 7 -- +bool(true) +--- Outer iteration 8 --- +bool(true) +-- Inner iteration 0 in 8 -- +bool(true) +-- Inner iteration 1 in 8 -- +bool(true) +-- Inner iteration 2 in 8 -- +bool(true) +-- Inner iteration 3 in 8 -- +bool(true) +-- Inner iteration 4 in 8 -- +bool(true) +-- Inner iteration 5 in 8 -- +bool(true) +-- Inner iteration 6 in 8 -- +bool(true) +-- Inner iteration 7 in 8 -- +bool(true) +-- Inner iteration 8 in 8 -- +bool(true) +-- Inner iteration 9 in 8 -- +bool(true) +-- Inner iteration 10 in 8 -- +bool(true) +-- Inner iteration 11 in 8 -- +bool(true) +-- Inner iteration 12 in 8 -- +bool(true) +-- Inner iteration 13 in 8 -- +bool(true) +--- Outer iteration 9 --- +bool(true) +-- Inner iteration 0 in 9 -- +bool(true) +-- Inner iteration 1 in 9 -- +bool(true) +-- Inner iteration 2 in 9 -- +bool(true) +-- Inner iteration 3 in 9 -- +bool(true) +-- Inner iteration 4 in 9 -- +bool(true) +-- Inner iteration 5 in 9 -- +bool(true) +-- Inner iteration 6 in 9 -- +bool(true) +-- Inner iteration 7 in 9 -- +bool(true) +-- Inner iteration 8 in 9 -- +bool(true) +-- Inner iteration 9 in 9 -- +bool(true) +-- Inner iteration 10 in 9 -- +bool(true) +-- Inner iteration 11 in 9 -- +bool(true) +-- Inner iteration 12 in 9 -- +bool(true) +-- Inner iteration 13 in 9 -- +bool(true) + *** Done *** diff --git a/ext/standard/tests/file/fnmatch_basic.phpt b/ext/standard/tests/file/fnmatch_basic.phpt index 4eb567c392..322362e8bf 100644 --- a/ext/standard/tests/file/fnmatch_basic.phpt +++ b/ext/standard/tests/file/fnmatch_basic.phpt @@ -2,11 +2,8 @@ Test fnmatch() function: Basic functionality --SKIPIF-- <?php -if (substr(PHP_OS, 0, 3) == 'WIN') - die("skip do not run on Windows"); - -if (!function_exists('fnmatch')) - die("skip fnmatch() function is not available"); +if( (stristr(PHP_OS, "Mac")) || (stristr(PHP_OS, "Win")) ) + die("skip do not run on MacOS/Windows"); ?> --FILE-- <?php diff --git a/ext/standard/tests/file/fnmatch_error.phpt b/ext/standard/tests/file/fnmatch_error.phpt index d139064115..9876133169 100644 --- a/ext/standard/tests/file/fnmatch_error.phpt +++ b/ext/standard/tests/file/fnmatch_error.phpt @@ -2,11 +2,8 @@ Test fnmatch() function: Error conditions --SKIPIF-- <?php -if (substr(PHP_OS, 0, 3) == 'WIN') - die("skip do not run on Windows"); - -if (!function_exists('fnmatch')) - die("skip fnmatch() function is not available"); +if( (stristr(PHP_OS, "Mac")) || (stristr(PHP_OS, "Win")) ) + die("skip do not run on MacOS/Windows"); ?> --FILE-- <?php diff --git a/ext/standard/tests/file/fnmatch_variation.phpt b/ext/standard/tests/file/fnmatch_variation.phpt index 0e82e37430..c2d9932dd3 100644 --- a/ext/standard/tests/file/fnmatch_variation.phpt +++ b/ext/standard/tests/file/fnmatch_variation.phpt @@ -2,11 +2,8 @@ Test fnmatch() function: Variations --SKIPIF-- <?php -if (substr(PHP_OS, 0, 3) == 'WIN') - die("skip do not run on Windows"); - -if (!function_exists('fnmatch')) - die("skip fnmatch() function is not available"); +if( (stristr(PHP_OS, "Mac")) || (stristr(PHP_OS, "Win")) ) + die("skip do not run on MacOS/Windows"); ?> --FILE-- <?php diff --git a/ext/standard/tests/file/fpassthru_error.phpt b/ext/standard/tests/file/fpassthru_error.phpt index 16dacfada9..958397b0e5 100644 --- a/ext/standard/tests/file/fpassthru_error.phpt +++ b/ext/standard/tests/file/fpassthru_error.phpt @@ -20,11 +20,6 @@ var_dump( fpassthru() ); /* No.of args greaer than expected */ var_dump( fpassthru("", "") ); -/* fpassthru on a closed file */ -$h = fopen(__FILE__,'r'); -fclose($h); -fpassthru($h); - echo "\n*** Done ***\n"; ?> @@ -42,7 +37,4 @@ bool(false) Warning: fpassthru() expects exactly 1 parameter, 2 given in %s on line %d bool(false) -Warning: fpassthru(): 5 is not a valid stream resource in %s on line %d - *** Done *** - diff --git a/ext/standard/tests/file/fread_error.phpt b/ext/standard/tests/file/fread_error.phpt index c6259b6642..4bba8ecd7a 100644 --- a/ext/standard/tests/file/fread_error.phpt +++ b/ext/standard/tests/file/fread_error.phpt @@ -103,7 +103,7 @@ bool(false) Notice: Undefined variable: file_content_type in %s on line %d -Warning: fread(): %d is not a valid stream resource in %s on line %d +Warning: fread(): 5 is not a valid stream resource in %s on line %d bool(false) Warning: fread() expects parameter 1 to be resource, null given in %s on line %d @@ -112,4 +112,3 @@ bool(false) Warning: fclose() expects parameter 1 to be resource, null given in %s on line %d bool(false) Done - diff --git a/ext/standard/tests/file/fseek_dir_basic.phpt b/ext/standard/tests/file/fseek_dir_basic.phpt index cde0bf2579..c6d0816e91 100644 --- a/ext/standard/tests/file/fseek_dir_basic.phpt +++ b/ext/standard/tests/file/fseek_dir_basic.phpt @@ -42,7 +42,7 @@ var_dump(rmdir($path)); ?> --EXPECTF-- call readdir(): -resource(%d) of type (stream) +resource(12) of type (stream) array(6) { [0]=> bool(false) diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt index 23eb991ebe..0af71e65fc 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt @@ -91,10 +91,9 @@ bool(false) Warning: fseek() expects parameter 1 to be resource, object given in %s on line %d bool(false) -- Testing fseek() with closed/unset file handle -- -Warning: fseek(): %d is not a valid stream resource in %s on line %d +Warning: fseek(): 5 is not a valid stream resource in %s on line %d bool(false) Warning: fseek() expects parameter 1 to be resource, null given in %s on line %d bool(false) Done - diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt index af14dbb270..31c9be70be 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt @@ -87,10 +87,9 @@ bool(false) Warning: ftell() expects parameter 1 to be resource, object given in %s on line %d bool(false) -- Testing ftell with closed/unset file handle -- -Warning: ftell(): %d is not a valid stream resource in %s on line %d +Warning: ftell(): 5 is not a valid stream resource in %s on line %d bool(false) Warning: ftell() expects parameter 1 to be resource, null given in %s on line %d bool(false) Done - diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt index 2d8f52768e..09ed54374d 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt @@ -87,10 +87,9 @@ bool(false) Warning: rewind() expects parameter 1 to be resource, object given in %s on line %d bool(false) -- Testing rewind() with closed/unset file handle -- -Warning: rewind(): %d is not a valid stream resource in %s on line %d +Warning: rewind(): 5 is not a valid stream resource in %s on line %d bool(false) Warning: rewind() expects parameter 1 to be resource, null given in %s on line %d bool(false) Done - diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt index 2f22d4e25f..a28095bc2d 100644 --- a/ext/standard/tests/file/ftruncate_error.phpt +++ b/ext/standard/tests/file/ftruncate_error.phpt @@ -11,7 +11,7 @@ echo "*** Testing ftruncate() : error conditions ***\n"; $filename = dirname(__FILE__)."/ftruncate_error.tmp"; $file_handle = fopen($filename, "w" ); -fwrite($file_handle, "Testing ftruncate error conditions \n"); +fwrite($file_handle, (binary)"Testing ftruncate error conditions \n"); fflush($file_handle); echo "\n Initial file size = ".filesize($filename)."\n"; @@ -23,14 +23,12 @@ var_dump( ftruncate() ); // arguments less than expected numbers var_dump( ftruncate( $file_handle ) ); // check the first size -clearstatcache(); var_dump( filesize($filename) ); echo "-- Testing ftruncate() with more than expected number of arguments --\n"; // more than expected number of arguments var_dump( ftruncate($file_handle, 10, 20) ); -// check the first size -clearstatcache(); +// check the first size var_dump( filesize($filename) ); // test invalid arguments : non-resources @@ -55,16 +53,14 @@ echo "-- Testing ftruncate() with closed/unset file handle --\n"; // ftruncate on close file handle fclose($file_handle); var_dump( ftruncate($file_handle,10) ); -// check the first size -clearstatcache(); +// check the first size var_dump( filesize($filename) ); // ftruncate on a file handle which is unset $fp = fopen($filename, "w"); unset($fp); //unset file handle var_dump( ftruncate(@$fp,10)); -// check the first size -clearstatcache(); +// check the first size var_dump( filesize($filename) ); echo "Done\n"; @@ -118,12 +114,11 @@ Warning: ftruncate() expects parameter 1 to be resource, object given in %s on l bool(false) -- Testing ftruncate() with closed/unset file handle -- -Warning: ftruncate(): %d is not a valid stream resource in %s on line %d +Warning: ftruncate(): 5 is not a valid stream resource in %s on line %d bool(false) int(36) Warning: ftruncate() expects parameter 1 to be resource, null given in %s on line %d bool(false) -int(0) +int(36) Done - diff --git a/ext/standard/tests/file/fwrite_error.phpt b/ext/standard/tests/file/fwrite_error.phpt index 988d618c66..2177c94b25 100644 --- a/ext/standard/tests/file/fwrite_error.phpt +++ b/ext/standard/tests/file/fwrite_error.phpt @@ -112,10 +112,9 @@ Warning: fwrite() expects parameter 1 to be resource, object given in %s on line bool(false) -- Testing fwrite() with closed/unset file handle -- -Warning: fwrite(): %d is not a valid stream resource in %s on line %d +Warning: fwrite(): 6 is not a valid stream resource in %s on line %d bool(false) Warning: fwrite() expects parameter 1 to be resource, null given in %s on line %d bool(false) Done - diff --git a/ext/standard/tests/file/glob_basic.phpt b/ext/standard/tests/file/glob_basic.phpt index fc269c442f..68e1bc74b1 100755 --- a/ext/standard/tests/file/glob_basic.phpt +++ b/ext/standard/tests/file/glob_basic.phpt @@ -25,19 +25,14 @@ $fp = fopen("$dirname/file.text", "w"); fclose($fp); // glob() with default arguments -sort_var_dump( glob($dirname."/*") ); -sort_var_dump( glob($dirname."/*.txt") ); -sort_var_dump( glob($dirname."/*.t?t") ); -sort_var_dump( glob($dirname."/*.t*t") ); -sort_var_dump( glob($dirname."/*.?") ); -sort_var_dump( glob($dirname."/*.*") ); +var_dump( glob($dirname."/*") ); +var_dump( glob($dirname."/*.txt") ); +var_dump( glob($dirname."/*.t?t") ); +var_dump( glob($dirname."/*.t*t") ); +var_dump( glob($dirname."/*.?") ); +var_dump( glob($dirname."/*.*") ); echo "Done\n"; - -function sort_var_dump($results) { - sort($results); - var_dump($results); -} ?> --CLEAN-- <?php diff --git a/ext/standard/tests/file/is_dir_variation2.phpt b/ext/standard/tests/file/is_dir_variation2.phpt index 8817256793..022e06bb40 100644 --- a/ext/standard/tests/file/is_dir_variation2.phpt +++ b/ext/standard/tests/file/is_dir_variation2.phpt @@ -14,7 +14,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { /* Testing is_dir() with dir, soft & hard link to dir, and with file, soft & hard link to file */ - + $file_path = dirname(__FILE__); echo "*** Testing is_dir() with dir and links to dir ***\n"; @@ -70,7 +70,7 @@ bool(true) -- With symlink -- bool(true) -- With hardlink -- -Warning: link(): %s +Warning: link(): %s in %s on line %d bool(false) *** Testing is_dir() with file and links to a file *** diff --git a/ext/standard/tests/file/is_dir_variation3.phpt b/ext/standard/tests/file/is_dir_variation3.phpt index 2df297843b..9c2cdf885a 100644 --- a/ext/standard/tests/file/is_dir_variation3.phpt +++ b/ext/standard/tests/file/is_dir_variation3.phpt @@ -1,5 +1,5 @@ --TEST-- -Test is_dir() function: usage variations - invalid arguments +Test is_dir() function: usage variations - invalid arguments --FILE-- <?php /* Prototype: bool is_dir ( string $dirname ); @@ -18,10 +18,9 @@ $dirnames = array( TRUE, FALSE, NULL, - " ", $dir_handle, - /* scalars */ + /* Non-existing dirnames */ 0, 1234 ); @@ -40,7 +39,6 @@ bool(false) bool(false) bool(false) bool(false) -bool(false) Warning: is_dir() expects parameter 1 to be string, resource given in %s on line %d NULL @@ -48,4 +46,3 @@ bool(false) bool(false) *** Done *** - diff --git a/ext/standard/tests/file/is_executable_variation3.phpt b/ext/standard/tests/file/is_executable_variation3.phpt index 634ce1f40c..4ec53a5ab2 100644 --- a/ext/standard/tests/file/is_executable_variation3.phpt +++ b/ext/standard/tests/file/is_executable_variation3.phpt @@ -5,16 +5,6 @@ Test is_executable() function: usage variations - invalid file names if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip not for windows'); } -// Skip if being run by root (files are always readable, writeable and executable) -$filename = dirname(__FILE__)."/is_executable_root_check.tmp"; -$fp = fopen($filename, 'w'); -fclose($fp); -if(fileowner($filename) == 0) { - unlink ($filename); - die('skip cannot be run as root'); -} - -unlink($filename); ?> --FILE-- <?php @@ -37,7 +27,6 @@ $invalid_files = array( TRUE, FALSE, NULL, - " ", @array(), @$file_handle ); @@ -60,10 +49,8 @@ bool(false) bool(false) bool(false) bool(false) -bool(false) Warning: is_executable() expects parameter 1 to be string, array given in %s on line %d NULL bool(false) Done - diff --git a/ext/standard/tests/file/is_file_variation3.phpt b/ext/standard/tests/file/is_file_variation3.phpt index 917fa5acc8..fd952fa096 100644 --- a/ext/standard/tests/file/is_file_variation3.phpt +++ b/ext/standard/tests/file/is_file_variation3.phpt @@ -1,5 +1,5 @@ --TEST-- -Test is_file() function: usage variations - invalid filenames +Test is_file() function: usage variations - invalid arguments --FILE-- <?php /* Prototype: bool is_file ( string $filename ); @@ -16,18 +16,17 @@ echo "*** Testing Invalid file types ***\n"; $filenames = array( /* Invalid filenames */ -2.34555, - " ", "", TRUE, FALSE, NULL, $file_handle, - + /* scalars */ 1234, 0 ); - + /* loop through to test each element the above array */ foreach( $filenames as $filename ) { var_dump( is_file($filename) ); @@ -49,7 +48,6 @@ bool(false) bool(false) bool(false) bool(false) -bool(false) Warning: is_file() expects parameter 1 to be string, resource given in %s on line %d NULL @@ -57,4 +55,3 @@ bool(false) bool(false) *** Done *** - diff --git a/ext/standard/tests/file/is_file_variation4.phpt b/ext/standard/tests/file/is_file_variation4.phpt index 55aeedfaad..fc0cab85cc 100644 --- a/ext/standard/tests/file/is_file_variation4.phpt +++ b/ext/standard/tests/file/is_file_variation4.phpt @@ -1,5 +1,5 @@ --TEST-- -Test is_file() function: usage variations - diff. path notations (Bug #42027) +Test is_file() function: usage variations - diff. path notations (Bug #42027, #42638) --FILE-- <?php /* Prototype: bool is_file ( string $filename ); diff --git a/ext/standard/tests/file/is_readable_variation1.phpt b/ext/standard/tests/file/is_readable_variation1.phpt index a1310327b8..76eafd0b5a 100644 --- a/ext/standard/tests/file/is_readable_variation1.phpt +++ b/ext/standard/tests/file/is_readable_variation1.phpt @@ -2,16 +2,8 @@ Test is_readable() function: usage variations - diff. file notations --SKIPIF-- <?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - // Skip if being run by root (files are always readable, writeable and executable) - $filename = dirname(__FILE__)."/is_readable_root_check.tmp"; - $fp = fopen($filename, 'w'); - fclose($fp); - if(fileowner($filename) == 0) { - unlink ($filename); - die('skip cannot be run as root'); - } - unlink($filename); +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip not for windows'); } ?> --FILE-- diff --git a/ext/standard/tests/file/is_readable_variation3.phpt b/ext/standard/tests/file/is_readable_variation3.phpt index dde47cc3b5..fefd7a2c4c 100644 --- a/ext/standard/tests/file/is_readable_variation3.phpt +++ b/ext/standard/tests/file/is_readable_variation3.phpt @@ -2,17 +2,8 @@ Test is_readable() function: usage variations - invalid file names --SKIPIF-- <?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - - // Skip if being run by root (files are always readable, writeable and executable) - $filename = dirname(__FILE__)."/is_readable_root_check.tmp"; - $fp = fopen($filename, 'w'); - fclose($fp); - if(fileowner($filename) == 0) { - unlink ($filename); - die('skip cannot be run as root'); - } - unlink($filename); +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip not for windows'); } ?> --FILE-- @@ -36,7 +27,6 @@ $misc_files = array( TRUE, FALSE, NULL, - " ", @array(), @$file_handle ); @@ -59,10 +49,8 @@ bool(false) bool(false) bool(false) bool(false) -bool(false) Warning: is_readable() expects parameter 1 to be string, array given in %s on line %d NULL bool(false) Done - diff --git a/ext/standard/tests/file/is_writable_variation1.phpt b/ext/standard/tests/file/is_writable_variation1.phpt index bf3e7e1171..97232b4320 100644 --- a/ext/standard/tests/file/is_writable_variation1.phpt +++ b/ext/standard/tests/file/is_writable_variation1.phpt @@ -2,18 +2,8 @@ Test is_writable() and its alias is_writeable() function: usage variations - diff. path notations --SKIPIF-- <?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - - // Skip if being run by root (files are always readable, writeable and executable) - $filename = dirname(__FILE__)."/is_writable_root_check.tmp"; - $fp = fopen($filename, 'w'); - fclose($fp); - if(fileowner($filename) == 0) { - unlink ($filename); - die('skip cannot be run as root'); - } - - unlink($filename); +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip.. only on LINUX'); } ?> --FILE-- @@ -110,4 +100,4 @@ bool(true) -- Iteration 11 -- bool(true) bool(true) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/file/is_writable_variation3.phpt b/ext/standard/tests/file/is_writable_variation3.phpt index 4c5bfa9082..e2cc13c33a 100644 --- a/ext/standard/tests/file/is_writable_variation3.phpt +++ b/ext/standard/tests/file/is_writable_variation3.phpt @@ -2,16 +2,8 @@ Test is_writable() and its alias is_writeable() function: usage variations - invalid file names --SKIPIF-- <?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - // Skip if being run by root (files are always readable, writeable and executable) - $filename = dirname(__FILE__)."/is_writable_root_check.tmp"; - $fp = fopen($filename, 'w'); - fclose($fp); - if(fileowner($filename) == 0) { - unlink ($filename); - die('skip cannot be run as root'); - } - unlink($filename); +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip.. only on LINUX'); } ?> --FILE-- @@ -34,7 +26,6 @@ $misc_files = array( TRUE, FALSE, NULL, - " ", @array(), @$file_handle ); @@ -64,8 +55,6 @@ bool(false) bool(false) bool(false) bool(false) -bool(false) -bool(false) Warning: is_writable() expects parameter 1 to be string, array given in %s on line %d NULL @@ -75,4 +64,3 @@ NULL bool(false) bool(false) Done - diff --git a/ext/standard/tests/file/lstat_stat_variation2.phpt b/ext/standard/tests/file/lstat_stat_variation2.phpt index e7d704a20b..c845bb478a 100755 --- a/ext/standard/tests/file/lstat_stat_variation2.phpt +++ b/ext/standard/tests/file/lstat_stat_variation2.phpt @@ -21,12 +21,13 @@ $file_path = dirname(__FILE__); require("file.inc"); /* create temp directory */ -mkdir("$file_path/lstat_stat_variation1/"); // temp dir +@rmdir("$file_path/lstat_stat_variation2/"); //ensure that dir doesn't exists +mkdir("$file_path/lstat_stat_variation2/"); // temp dir // renaming a directory and check stat echo "*** Testing stat() for directory after being renamed ***\n"; -$old_dirname = "$file_path/lstat_stat_variation1"; -$new_dirname = "$file_path/lstat_stat_variation1a"; +$old_dirname = "$file_path/lstat_stat_variation2"; +$new_dirname = "$file_path/lstat_stat_variation2a"; $old_stat = stat($old_dirname); clearstatcache(); var_dump( rename($old_dirname, $new_dirname) ); @@ -36,11 +37,8 @@ $new_stat = stat($new_dirname); var_dump( compare_self_stat($old_stat) ); var_dump( compare_self_stat($new_stat) ); -// compare the two stats - all except ctime -$keys_to_compare = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, - "dev", "ino", "mode", "nlink", "uid", "gid", - "rdev", "size", "atime", "mtime", "blksize", "blocks"); -var_dump( compare_stats($old_stat, $new_stat, $keys_to_compare) ); +// compare the two stats +var_dump( compare_stats($old_stat, $new_stat, $all_stat_keys) ); // clear the cache clearstatcache(); @@ -50,7 +48,7 @@ echo "\n--- Done ---"; --CLEAN-- <?php $file_path = dirname(__FILE__); -rmdir("$file_path/lstat_stat_variation1a"); +rmdir("$file_path/lstat_stat_variation2a"); ?> --EXPECTF-- *** Testing stat() for directory after being renamed *** diff --git a/ext/standard/tests/file/popen_pclose_error-sunos.phpt b/ext/standard/tests/file/popen_pclose_error-sunos.phpt index b63dbeb7ea..4c85c9e494 100644 --- a/ext/standard/tests/file/popen_pclose_error-sunos.phpt +++ b/ext/standard/tests/file/popen_pclose_error-sunos.phpt @@ -2,8 +2,8 @@ Test popen() and pclose function: error conditions --SKIPIF-- <?php -if( substr(PHP_OS, 0, 3) != 'Sun') - die("skip Only valid for Sun Solaris"); +if(substr(PHP_OS, 0, 3) != 'Sun' ) + die("skip Only Valid for Sun Solaris"); ?> --FILE-- @@ -35,13 +35,13 @@ unlink($file_path."/popen.tmp"); --EXPECTF-- *** Testing for error conditions *** -Warning: Wrong parameter count for popen() in %s on line %d +Warning: popen() expects exactly 2 parameters, 0 given in %s on line %d NULL -Warning: Wrong parameter count for popen() in %s on line %d +Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d NULL -sh: abc.txt: not found resource(%d) of type (stream) +sh: abc.txt: not found Warning: Wrong parameter count for pclose() in %s on line %d NULL diff --git a/ext/standard/tests/file/readlink_realpath_basic1.phpt b/ext/standard/tests/file/readlink_realpath_basic1.phpt index 99195e2b24..e2a076c947 100644 --- a/ext/standard/tests/file/readlink_realpath_basic1.phpt +++ b/ext/standard/tests/file/readlink_realpath_basic1.phpt @@ -39,6 +39,9 @@ $linknames = array ( "$file_path/readlink_realpath_basic1/home/test/readlink_realpath_basic1_link.tmp", "$file_path/readlink_realpath_basic1//home/test//../test/./readlink_realpath_basic1_link.tmp", + // checking for binary safe + b"$file_path/readlink_realpath_basic1/home/readlink_realpath_basic1_link.tmp", + /* linknames with invalid linkpath */ "$file_path///readlink_realpath_basic1/home//..//././test//readlink_realpath_basic1_link.tmp", "$file_path/readlink_realpath_basic1/home/../home/../test/../readlink_realpath_basic1_link.tmp", @@ -86,24 +89,28 @@ string(%d) "%s/readlink_realpath_basic1/home/test/readlink_realpath_basic1.tmp" string(%d) "%s/readlink_realpath_basic1/home/test/readlink_realpath_basic1.tmp" -- Iteration 4 -- +string(%d) "%s/readlink_realpath_basic1/home/readlink_realpath_basic1.tmp" +string(%d) "%s/readlink_realpath_basic1/home/readlink_realpath_basic1.tmp" + +-- Iteration 5 -- Warning: readlink(): No such file or directory in %s on line %d bool(false) bool(false) --- Iteration 5 -- +-- Iteration 6 -- Warning: readlink(): No such file or directory in %s on line %d bool(false) bool(false) --- Iteration 6 -- +-- Iteration 7 -- Warning: readlink(): No such file or directory in %s on line %d bool(false) %s --- Iteration 7 -- +-- Iteration 8 -- Warning: readlink(): %s in %s on line %d bool(false) diff --git a/ext/standard/tests/file/readlink_realpath_basic2.phpt b/ext/standard/tests/file/readlink_realpath_basic2.phpt index 91955cd4f5..7a9e741ef0 100644 --- a/ext/standard/tests/file/readlink_realpath_basic2.phpt +++ b/ext/standard/tests/file/readlink_realpath_basic2.phpt @@ -34,6 +34,9 @@ $filenames = array ( "$file_path/readlink_realpath_basic2//home/test//../test/./readlink_realpath_basic2.tmp", "$file_path/readlink_realpath_basic2/home//../././readlink_realpath_basic2.tmp", + // checking for binary safe + b"$file_path/readlink_realpath_basic2/home/readlink_realpath_basic2.tmp", + /* filenames with invalid path */ "$file_path///readlink_realpath_basic2/home//..//././test//readlink_realpath_basic2.tmp", "$file_path/readlink_realpath_basic2/home/../home/../test/../readlink_realpath_basic2.tmp", @@ -76,11 +79,14 @@ string(%d) "%s/readlink_realpath_basic2/home/test/readlink_realpath_basic2.tmp" string(%d) "%s/readlink_realpath_basic2/readlink_realpath_basic2.tmp" -- Iteration 5 -- -bool(false) +string(%d) "%s/readlink_realpath_basic2/home/readlink_realpath_basic2.tmp" -- Iteration 6 -- bool(false) -- Iteration 7 -- +bool(false) + +-- Iteration 8 -- %s Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt index 98ce6211da..3bee688d87 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt @@ -5,7 +5,7 @@ Test symlink(), linkinfo(), link() and is_link() functions : error conditions - if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip no symlinks on Windows'); } -if (PHP_INT_SIZE != 4) { +if (PHP_INT_SIZE != 4 ) { die("skip this test is for 32bit platform only"); } ?> @@ -42,7 +42,6 @@ var_dump( link($filename, $linkname, false) ); //invalid arguments var_dump( link(NULL, $linkname) ); // NULL as filename var_dump( link('', $linkname) ); // empty string as filename -var_dump( link(' ', $linkname) ); // space as filename var_dump( link(false, $linkname) ); // boolean false as filename var_dump( link($filename, NULL) ); // NULL as linkname var_dump( link($filename, '') ); // '' as linkname @@ -58,7 +57,6 @@ var_dump( is_link($linkname, "/") ); //invalid arguments var_dump( is_link(NULL) ); // NULL as linkname var_dump( is_link('') ); // empty string as linkname -var_dump( is_link(' ') ); // space as linkname var_dump( is_link(false) ); // boolean false as linkname var_dump( is_link($filename) ); // file given to is_link @@ -77,25 +75,22 @@ NULL Warning: link() expects exactly 2 parameters, 3 given in %s on line %d NULL -Warning: link(): No such file or directory in %s on line %d +Warning: link(): %s in %s on line %d bool(false) -Warning: link(): No such file or directory in %s on line %d +Warning: link(): %s in %s on line %d bool(false) -Warning: link(): No such file or directory in %s on line %d +Warning: link(): %s in %s on line %d bool(false) -Warning: link(): No such file or directory in %s on line %d +Warning: link(): %s in %s on line %d bool(false) -Warning: link(): No such file or directory in %s on line %d +Warning: link(): %s in %s on line %d bool(false) -Warning: link(): No such file or directory in %s on line %d -bool(false) - -Warning: link(): No such file or directory in %s on line %d +Warning: link(): %s in %s on line %d bool(false) *** Testing is_link() for error conditions *** @@ -109,6 +104,4 @@ bool(false) bool(false) bool(false) bool(false) -bool(false) Done - diff --git a/ext/standard/tests/file/tempnam_variation1-win32.phpt b/ext/standard/tests/file/tempnam_variation1-win32.phpt index a3dd7e9d62..9075950330 100644 --- a/ext/standard/tests/file/tempnam_variation1-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation1-win32.phpt @@ -3,7 +3,7 @@ Test tempnam() function: usage variations - creating files --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) != "WIN") - die("skip Only valid for Windows"); + die("skip Run only on Windows"); ?> --FILE-- <?php @@ -13,8 +13,7 @@ if(substr(PHP_OS, 0, 3) != "WIN") /* Creating number of unique files by passing a file name as prefix */ -$file_path = dirname(__FILE__)."/tempnamVar1"; -mkdir($file_path); +$file_path = dirname(__FILE__); echo "*** Testing tempnam() in creation of unique files ***\n"; for($i=1; $i<=10; $i++) { @@ -32,19 +31,6 @@ for($i=1; $i<=10; $i++) { echo "\n"; clearstatcache(); - echo "File created in => "; - $file_dir = dirname($files[$i]); - - if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } - else if (realpath($file_dir) == realpath($file_path) || realpath($file_dir."\\") == realpath($file_path)) { - echo "directory specified\n"; - } - else { - echo "unknown location\n"; - } - clearstatcache(); } else { print("- File is not created -"); @@ -53,51 +39,39 @@ for($i=1; $i<=10; $i++) { for($i=1; $i<=10; $i++) { unlink($files[$i]); } -rmdir($file_path); - echo "*** Done ***\n"; ?> --EXPECTF-- *** Testing tempnam() in creation of unique files *** -- Iteration 1 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 2 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 3 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 4 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 5 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 6 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 7 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 8 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 9 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 10 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => directory specified *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation1.phpt b/ext/standard/tests/file/tempnam_variation1.phpt index 0745f5397c..c94a65ba21 100644 --- a/ext/standard/tests/file/tempnam_variation1.phpt +++ b/ext/standard/tests/file/tempnam_variation1.phpt @@ -13,8 +13,7 @@ if(substr(PHP_OS, 0, 3) == "WIN") /* Creating number of unique files by passing a file name as prefix */ -$file_path = dirname(__FILE__)."/tempnamVar1"; -mkdir($file_path); +$file_path = dirname(__FILE__); echo "*** Testing tempnam() in creation of unique files ***\n"; for($i=1; $i<=10; $i++) { @@ -35,19 +34,6 @@ for($i=1; $i<=10; $i++) { echo "File inode is => "; print_r( fileinode($files[$i]) ); //checking inodes echo "\n"; - - echo "File created in => "; - $file_dir = dirname($files[$i]); - - if ($file_dir == sys_get_temp_dir()) { - echo "temp dir\n"; - } - else if ($file_dir == $file_path) { - echo "directory specified\n"; - } - else { - echo "unknown location\n"; - } clearstatcache(); } else { @@ -58,59 +44,48 @@ for($i=1; $i<=10; $i++) { unlink($files[$i]); } -rmdir($file_path); echo "*** Done ***\n"; ?> --EXPECTF-- *** Testing tempnam() in creation of unique files *** -- Iteration 1 -- -File name is => %s%etempnam_variation1.tmp%s +File name is => %s File permissions are => 100600 File inode is => %d -File created in => directory specified -- Iteration 2 -- -File name is => %s%etempnam_variation1.tmp%s +File name is => %s File permissions are => 100600 File inode is => %d -File created in => directory specified -- Iteration 3 -- -File name is => %s%etempnam_variation1.tmp%s +File name is => %s File permissions are => 100600 File inode is => %d -File created in => directory specified -- Iteration 4 -- -File name is => %s%etempnam_variation1.tmp%s +File name is => %s File permissions are => 100600 File inode is => %d -File created in => directory specified -- Iteration 5 -- -File name is => %s%etempnam_variation1.tmp%s +File name is => %s File permissions are => 100600 File inode is => %d -File created in => directory specified -- Iteration 6 -- -File name is => %s%etempnam_variation1.tmp%s +File name is => %s File permissions are => 100600 File inode is => %d -File created in => directory specified -- Iteration 7 -- -File name is => %s%etempnam_variation1.tmp%s +File name is => %s File permissions are => 100600 File inode is => %d -File created in => directory specified -- Iteration 8 -- -File name is => %s%etempnam_variation1.tmp%s +File name is => %s File permissions are => 100600 File inode is => %d -File created in => directory specified -- Iteration 9 -- -File name is => %s%etempnam_variation1.tmp%s +File name is => %s File permissions are => 100600 File inode is => %d -File created in => directory specified -- Iteration 10 -- -File name is => %s%etempnam_variation1.tmp%s +File name is => %s File permissions are => 100600 File inode is => %d -File created in => directory specified *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation2-win32.phpt b/ext/standard/tests/file/tempnam_variation2-win32.phpt index 4224966daf..a9fe4fd2d6 100644 --- a/ext/standard/tests/file/tempnam_variation2-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation2-win32.phpt @@ -1,9 +1,9 @@ --TEST-- -Test tempnam() function: usage variations - various absolute and relative paths +Test tempnam() function: usage variations - relative paths --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) != "WIN") - die("skip Only valid for Windows"); + die("skip Run only on Windows"); ?> --FILE-- <?php @@ -13,7 +13,7 @@ if(substr(PHP_OS, 0, 3) != "WIN") /* Creating unique files in various dirs by passing relative paths to $dir arg */ -echo "*** Testing tempnam() with absolute and relative paths ***\n"; +echo "*** Testing tempnam() with relative paths ***\n"; $dir_name = dirname(__FILE__)."/tempnam_variation2"; mkdir($dir_name); $dir_path = $dir_name."/tempnam_variation2_sub"; @@ -23,24 +23,14 @@ $old_dir_path = getcwd(); chdir(dirname(__FILE__)); $dir_paths = array( - // absolute paths "$dir_path", "$dir_path/", "$dir_path/..", "$dir_path//../", "$dir_path/../.././tempnam_variation2", "$dir_path/..///tempnam_variation2_sub//..//../tempnam_variation2", - "$dir_path/BADDIR", - - - // relative paths ".", - "tempname_variation2", - "tempname_variation2/", - "tempnam_variation2/tempnam_variation2_sub", - "tempnam_variation2//tempnam_variation2_sub", - "./tempnam_variation2/../tempnam_variation2/tempnam_variation2_sub", - "BADDIR", + "./tempnam_variation2/../tempnam_variation2/tempnam_variation2_sub" ); for($i = 0; $i<count($dir_paths); $i++) { @@ -57,28 +47,10 @@ for($i = 0; $i<count($dir_paths); $i++) { echo "File permissions are => "; printf("%o", fileperms($file_name) ); echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - $dir_req = $dir_paths[$i]; - - if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } - else if (realpath($file_dir) == realpath($dir_req) || realpath($file_dir."\\") == realpath($dir_req)) { - echo "directory specified\n"; - } - else { - echo "unknown location\n"; - } - - } - else { + else echo "-- File is not created --"; - } - - unlink($file_name); + unlink($file_name); } chdir($old_dir_path); @@ -88,76 +60,38 @@ rmdir($dir_name); echo "\n*** Done ***\n"; ?> --EXPECTF-- -*** Testing tempnam() with absolute and relative paths *** +*** Testing tempnam() with relative paths *** -- Iteration 1 -- -File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 2 -- -File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 3 -- -File name is => %s\tempnam_variation2\t%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 4 -- -File name is => %s\tempnam_variation2\t%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 5 -- -File name is => %s\tempnam_variation2\t%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 6 -- -File name is => %s\tempnam_variation2\t%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 7 -- -File name is => %s\t%s +File name is => %s File permissions are => 100666 -File created in => temp dir -- Iteration 8 -- -File name is => %s\t%s -File permissions are => 100666 -File created in => directory specified - --- Iteration 9 -- -File name is => %s\t%s -File permissions are => 100666 -File created in => temp dir - --- Iteration 10 -- -File name is => %s\t%s -File permissions are => 100666 -File created in => temp dir - --- Iteration 11 -- -File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s -File permissions are => 100666 -File created in => directory specified - --- Iteration 12 -- -File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s -File permissions are => 100666 -File created in => directory specified - --- Iteration 13 -- -File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s -File permissions are => 100666 -File created in => directory specified - --- Iteration 14 -- -File name is => %s\t%s +File name is => %s File permissions are => 100666 -File created in => temp dir -*** Done ***
\ No newline at end of file +*** Done *** diff --git a/ext/standard/tests/file/tempnam_variation2.phpt b/ext/standard/tests/file/tempnam_variation2.phpt index b7e5cdc058..6d85e25628 100644 --- a/ext/standard/tests/file/tempnam_variation2.phpt +++ b/ext/standard/tests/file/tempnam_variation2.phpt @@ -1,5 +1,5 @@ --TEST-- -Test tempnam() function: usage variations - various absolute and relative paths +Test tempnam() function: usage variations - relative paths --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) == "WIN") @@ -13,7 +13,7 @@ if(substr(PHP_OS, 0, 3) == "WIN") /* Creating unique files in various dirs by passing relative paths to $dir arg */ -echo "*** Testing tempnam() with absolute and relative paths ***\n"; +echo "*** Testing tempnam() with relative paths ***\n"; $dir_name = dirname(__FILE__)."/tempnam_variation2"; mkdir($dir_name); $dir_path = $dir_name."/tempnam_variation2_sub"; @@ -23,24 +23,14 @@ $old_dir_path = getcwd(); chdir(dirname(__FILE__)); $dir_paths = array( - // absolute paths "$dir_path", "$dir_path/", "$dir_path/..", "$dir_path//../", "$dir_path/../.././tempnam_variation2", "$dir_path/..///tempnam_variation2_sub//..//../tempnam_variation2", - "$dir_path/BADDIR", - - - // relative paths ".", - "tempname_variation2", - "tempname_variation2/", - "tempnam_variation2/tempnam_variation2_sub", - "tempnam_variation2//tempnam_variation2_sub", - "./tempnam_variation2/../tempnam_variation2/tempnam_variation2_sub", - "BADDIR", + "./tempnam_variation2/../tempnam_variation2/tempnam_variation2_sub" ); for($i = 0; $i<count($dir_paths); $i++) { @@ -57,28 +47,10 @@ for($i = 0; $i<count($dir_paths); $i++) { echo "File permissions are => "; printf("%o", fileperms($file_name) ); echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - $dir_req = $dir_paths[$i]; - - if (realpath($file_dir) == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } - else if ($file_dir == realpath($dir_req)) { - echo "directory specified\n"; - } - else { - echo "unknown location\n"; - } - - } - else { + else echo "-- File is not created --"; - } - - unlink($file_name); + unlink($file_name); } chdir($old_dir_path); @@ -88,76 +60,38 @@ rmdir($dir_name); echo "\n*** Done ***\n"; ?> --EXPECTF-- -*** Testing tempnam() with absolute and relative paths *** +*** Testing tempnam() with relative paths *** -- Iteration 1 -- -File name is => %s/tempnam_variation2/tempnam_variation2_sub/tempnam_variation2.tmp%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 2 -- -File name is => %s/tempnam_variation2/tempnam_variation2_sub/tempnam_variation2.tmp%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 3 -- -File name is => %s/tempnam_variation2/tempnam_variation2.tmp%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 4 -- -File name is => %s/tempnam_variation2/tempnam_variation2.tmp%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 5 -- -File name is => %s/tempnam_variation2/tempnam_variation2.tmp%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 6 -- -File name is => %s/tempnam_variation2/tempnam_variation2.tmp%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 7 -- -File name is => %s/tempnam_variation2.tmp%s +File name is => %s File permissions are => 100600 -File created in => temp dir -- Iteration 8 -- -File name is => %s/tempnam_variation2.tmp%s -File permissions are => 100600 -File created in => directory specified - --- Iteration 9 -- -File name is => %s/tempnam_variation2.tmp%s -File permissions are => 100600 -File created in => temp dir - --- Iteration 10 -- -File name is => %s/tempnam_variation2.tmp%s -File permissions are => 100600 -File created in => temp dir - --- Iteration 11 -- -File name is => %s/tempnam_variation2/tempnam_variation2_sub/tempnam_variation2.tmp%s -File permissions are => 100600 -File created in => directory specified - --- Iteration 12 -- -File name is => %s/tempnam_variation2/tempnam_variation2_sub/tempnam_variation2.tmp%s -File permissions are => 100600 -File created in => directory specified - --- Iteration 13 -- -File name is => %s/tempnam_variation2/tempnam_variation2_sub/tempnam_variation2.tmp%s -File permissions are => 100600 -File created in => directory specified - --- Iteration 14 -- -File name is => %s/tempnam_variation2.tmp%s +File name is => %s File permissions are => 100600 -File created in => temp dir -*** Done ***
\ No newline at end of file +*** Done *** diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt index ec7718f970..4e9eb76b5c 100644 --- a/ext/standard/tests/file/tempnam_variation3-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt @@ -1,9 +1,9 @@ --TEST-- -Test tempnam() function: usage variations - obscure prefixes +Test tempnam() function: usage variations - invalid/non-existing file --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) != "WIN") - die("skip run only on Windows"); + die("skip Run only on Windows"); ?> --FILE-- <?php @@ -13,11 +13,10 @@ if(substr(PHP_OS, 0, 3) != "WIN") /* Passing invalid/non-existing args for $prefix */ -echo "*** Testing tempnam() with obscure prefixes ***\n"; -$file_path = dirname(__FILE__)."/tempnamVar3"; -mkdir($file_path); +echo "*** Testing tempnam() with invalid/non-existing file names ***\n"; +$file_path = dirname(__FILE__); -/* An array of prefixes */ +/* An array of names, which will be passed as a file name */ $names_arr = array( /* Invalid args */ -1, @@ -26,16 +25,16 @@ $names_arr = array( NULL, "", " ", - "\0", + "/0", array(), - /* prefix with path separator of a non existing directory*/ + /* Non-existing dirs */ "/no/such/file/dir", - "php/php" + "php" ); -for( $i=0; $i<count($names_arr); $i++ ) { +for( $i=1; $i<count($names_arr); $i++ ) { echo "-- Iteration $i --\n"; $file_name = tempnam("$file_path", $names_arr[$i]); @@ -48,73 +47,46 @@ for( $i=0; $i<count($names_arr); $i++ ) { echo "File permissions are => "; printf("%o", fileperms($file_name) ); echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } - else if (realpath($file_dir) == realpath($file_path) || realpath($file_dir."\\") == realpath($file_path)) { - echo "directory specified\n"; - } - else { - echo "unknown location\n"; - } } - else { + else echo "-- File is not created --\n"; - } unlink($file_name); } -rmdir($file_path); echo "\n*** Done ***\n"; ?> --EXPECTF-- -*** Testing tempnam() with obscure prefixes *** --- Iteration 0 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +*** Testing tempnam() with invalid/non-existing file names *** -- Iteration 1 -- -File name is => %s\%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 2 -- -File name is => %s\%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 3 -- -File name is => %s\%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 4 -- -File name is => %s\%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 5 -- -File name is => %s\%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 6 -- -File name is => %s\%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 7 -- Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d -- File is not created -- -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d -- Iteration 8 -- -File name is => %s\di%s +File name is => %s File permissions are => 100666 -File created in => directory specified -- Iteration 9 -- -File name is => %s\ph%s +File name is => %s File permissions are => 100666 -File created in => directory specified *** Done *** - diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt index a0b9511b63..cbc8e85239 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -1,5 +1,5 @@ --TEST-- -Test tempnam() function: usage variations - obscure prefixes +Test tempnam() function: usage variations - invalid/non-existing file --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) == "WIN") @@ -13,11 +13,10 @@ if(substr(PHP_OS, 0, 3) == "WIN") /* Passing invalid/non-existing args for $prefix */ -echo "*** Testing tempnam() with obscure prefixes ***\n"; -$file_path = dirname(__FILE__)."/tempnamVar3"; -mkdir($file_path); +echo "*** Testing tempnam() with invalid/non-existing file names ***\n"; +$file_path = dirname(__FILE__); -/* An array of prefixes */ +/* An array of names, which will be passed as a file name */ $names_arr = array( /* Invalid args */ -1, @@ -26,16 +25,16 @@ $names_arr = array( NULL, "", " ", - "\0", + "/0", array(), - /* prefix with path separator of a non existing directory*/ + /* Non-existing dirs */ "/no/such/file/dir", - "php/php" + "php" ); -for( $i=0; $i<count($names_arr); $i++ ) { +for( $i=1; $i<count($names_arr); $i++ ) { echo "-- Iteration $i --\n"; $file_name = tempnam("$file_path", $names_arr[$i]); @@ -48,75 +47,46 @@ for( $i=0; $i<count($names_arr); $i++ ) { echo "File permissions are => "; printf("%o", fileperms($file_name) ); echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - - if ($file_dir == sys_get_temp_dir()) { - echo "temp dir\n"; - } - else if ($file_dir == $file_path) { - echo "directory specified\n"; - } - else { - echo "unknown location\n"; - } - } - else { + else echo "-- File is not created --\n"; - } unlink($file_name); } -rmdir($file_path); echo "\n*** Done ***\n"; ?> --EXPECTF-- -*** Testing tempnam() with obscure prefixes *** --- Iteration 0 -- -File name is => %s/%s -File permissions are => 100600 -File created in => directory specified +*** Testing tempnam() with invalid/non-existing file names *** -- Iteration 1 -- -File name is => %s/%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 2 -- -File name is => %s/%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 3 -- -File name is => %s/%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 4 -- -File name is => %s/%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 5 -- -File name is => %s/%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 6 -- -File name is => %s/%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 7 -- Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d -- File is not created -- -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d -- Iteration 8 -- -File name is => %s/dir%s +File name is => %s File permissions are => 100600 -File created in => directory specified -- Iteration 9 -- -File name is => %s/php%s +File name is => %s File permissions are => 100600 -File created in => directory specified *** Done *** - diff --git a/ext/standard/tests/file/tempnam_variation4.phpt b/ext/standard/tests/file/tempnam_variation4.phpt index 8fec4019fc..491eae7343 100644 --- a/ext/standard/tests/file/tempnam_variation4.phpt +++ b/ext/standard/tests/file/tempnam_variation4.phpt @@ -20,34 +20,22 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { echo "*** Testing tempnam() with dir of permissions from 0000 to 0777 ***\n"; $file_path = dirname(__FILE__); $dir_name = $file_path."/tempnam_variation4"; -$prefix = "tempnamVar4."; - mkdir($dir_name); -for($mode = 0000; $mode <= 0777; $mode++) { +for($mode = 0000; $mode<=0777; $mode++) { echo "-- dir perms "; printf("%o", $mode); echo " --\n"; chmod($dir_name, $mode); - $file_name = tempnam($dir_name, $prefix); + $file_name = tempnam($dir_name, "tempnam_variation4.tmp"); if(file_exists($file_name) ) { - if (realpath(dirname($file_name)) == realpath(sys_get_temp_dir())) { - $msg = " created in temp directory"; - } - else if (dirname($file_name) == $dir_name) { - $msg = " created in requested directory"; - } - else { - $msg = " created in unexpected directory"; - } - - echo basename($file_name).$msg."\n"; - unlink($file_name); - } - else { - print("FAILED: File is not created\n"); + print($file_name); + echo "\n"; } + else + print("-- File is not created --"); + unlink($file_name); } rmdir($dir_name); @@ -57,1027 +45,1027 @@ echo "*** Done ***\n"; --EXPECTF-- *** Testing tempnam() with dir of permissions from 0000 to 0777 *** -- dir perms 0 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 1 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 2 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 3 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 4 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 5 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 6 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 7 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 10 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 11 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 12 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 13 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 14 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 15 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 16 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 17 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 20 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 21 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 22 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 23 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 24 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 25 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 26 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 27 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 30 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 31 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 32 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 33 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 34 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 35 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 36 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 37 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 40 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 41 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 42 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 43 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 44 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 45 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 46 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 47 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 50 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 51 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 52 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 53 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 54 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 55 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 56 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 57 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 60 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 61 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 62 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 63 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 64 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 65 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 66 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 67 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 70 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 71 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 72 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 73 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 74 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 75 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 76 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 77 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 100 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 101 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 102 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 103 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 104 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 105 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 106 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 107 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 110 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 111 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 112 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 113 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 114 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 115 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 116 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 117 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 120 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 121 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 122 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 123 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 124 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 125 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 126 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 127 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 130 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 131 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 132 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 133 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 134 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 135 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 136 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 137 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 140 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 141 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 142 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 143 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 144 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 145 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 146 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 147 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 150 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 151 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 152 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 153 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 154 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 155 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 156 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 157 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 160 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 161 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 162 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 163 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 164 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 165 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 166 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 167 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 170 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 171 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 172 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 173 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 174 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 175 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 176 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 177 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 200 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 201 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 202 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 203 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 204 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 205 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 206 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 207 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 210 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 211 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 212 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 213 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 214 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 215 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 216 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 217 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 220 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 221 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 222 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 223 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 224 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 225 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 226 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 227 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 230 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 231 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 232 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 233 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 234 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 235 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 236 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 237 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 240 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 241 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 242 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 243 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 244 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 245 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 246 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 247 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 250 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 251 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 252 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 253 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 254 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 255 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 256 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 257 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 260 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 261 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 262 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 263 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 264 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 265 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 266 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 267 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 270 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 271 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 272 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 273 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 274 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 275 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 276 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 277 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 300 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 301 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 302 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 303 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 304 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 305 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 306 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 307 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 310 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 311 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 312 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 313 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 314 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 315 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 316 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 317 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 320 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 321 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 322 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 323 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 324 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 325 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 326 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 327 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 330 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 331 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 332 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 333 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 334 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 335 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 336 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 337 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 340 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 341 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 342 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 343 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 344 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 345 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 346 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 347 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 350 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 351 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 352 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 353 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 354 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 355 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 356 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 357 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 360 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 361 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 362 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 363 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 364 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 365 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 366 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 367 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 370 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 371 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 372 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 373 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 374 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 375 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 376 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 377 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 400 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 401 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 402 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 403 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 404 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 405 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 406 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 407 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 410 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 411 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 412 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 413 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 414 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 415 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 416 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 417 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 420 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 421 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 422 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 423 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 424 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 425 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 426 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 427 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 430 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 431 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 432 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 433 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 434 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 435 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 436 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 437 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 440 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 441 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 442 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 443 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 444 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 445 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 446 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 447 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 450 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 451 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 452 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 453 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 454 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 455 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 456 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 457 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 460 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 461 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 462 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 463 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 464 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 465 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 466 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 467 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 470 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 471 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 472 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 473 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 474 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 475 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 476 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 477 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 500 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 501 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 502 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 503 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 504 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 505 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 506 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 507 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 510 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 511 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 512 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 513 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 514 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 515 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 516 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 517 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 520 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 521 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 522 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 523 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 524 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 525 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 526 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 527 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 530 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 531 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 532 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 533 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 534 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 535 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 536 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 537 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 540 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 541 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 542 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 543 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 544 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 545 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 546 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 547 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 550 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 551 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 552 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 553 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 554 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 555 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 556 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 557 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 560 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 561 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 562 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 563 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 564 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 565 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 566 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 567 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 570 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 571 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 572 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 573 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 574 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 575 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 576 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 577 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 600 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 601 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 602 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 603 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 604 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 605 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 606 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 607 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 610 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 611 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 612 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 613 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 614 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 615 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 616 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 617 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 620 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 621 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 622 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 623 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 624 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 625 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 626 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 627 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 630 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 631 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 632 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 633 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 634 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 635 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 636 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 637 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 640 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 641 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 642 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 643 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 644 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 645 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 646 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 647 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 650 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 651 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 652 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 653 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 654 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 655 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 656 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 657 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 660 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 661 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 662 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 663 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 664 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 665 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 666 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 667 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 670 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 671 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 672 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 673 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 674 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 675 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 676 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 677 -- -tempnamVar4.%s created in temp directory +%s -- dir perms 700 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 701 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 702 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 703 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 704 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 705 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 706 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 707 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 710 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 711 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 712 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 713 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 714 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 715 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 716 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 717 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 720 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 721 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 722 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 723 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 724 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 725 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 726 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 727 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 730 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 731 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 732 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 733 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 734 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 735 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 736 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 737 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 740 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 741 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 742 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 743 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 744 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 745 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 746 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 747 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 750 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 751 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 752 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 753 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 754 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 755 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 756 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 757 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 760 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 761 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 762 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 763 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 764 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 765 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 766 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 767 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 770 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 771 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 772 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 773 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 774 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 775 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 776 -- -tempnamVar4.%s created in requested directory +%s -- dir perms 777 -- -tempnamVar4.%s created in requested directory -*** Done ***
\ No newline at end of file +%s +*** Done *** diff --git a/ext/standard/tests/file/tempnam_variation5.phpt b/ext/standard/tests/file/tempnam_variation5.phpt index 26c3f91f1f..2d5f53dcd3 100644 --- a/ext/standard/tests/file/tempnam_variation5.phpt +++ b/ext/standard/tests/file/tempnam_variation5.phpt @@ -1,10 +1,5 @@ --TEST-- Test tempnam() function: usage variations - existing file ---SKIPIF-- -<?php -if(substr(PHP_OS, 0, 3) == "WIN") - die("skip Do not run on Windows"); -?> --FILE-- <?php /* Prototype: string tempnam ( string $dir, string $prefix ); @@ -18,7 +13,7 @@ $file_path = dirname(__FILE__); echo "*** Test tempnam() function: by passing an existing filename as prefix ***\n"; $dir_name = $file_path."/tempnam_variation6"; mkdir($dir_name); -$h = fopen($dir_name."/tempnam_variation6.tmp", "w"); +fopen($dir_name."/tempnam_variation6.tmp", "w"); for($i=1; $i<=3; $i++) { echo "-- Iteration $i --\n"; @@ -34,7 +29,6 @@ for($i=1; $i<=3; $i++) { unlink($created_file); } -fclose($h); unlink($dir_name."/tempnam_variation6.tmp"); rmdir($dir_name); @@ -43,10 +37,10 @@ echo "\n*** Done ***\n"; --EXPECTF-- *** Test tempnam() function: by passing an existing filename as prefix *** -- Iteration 1 -- -File name is => %stempnam_variation6%etempnam_variation6.tmp%s +File name is => %s -- Iteration 2 -- -File name is => %stempnam_variation6%etempnam_variation6.tmp%s +File name is => %s -- Iteration 3 -- -File name is => %stempnam_variation6%etempnam_variation6.tmp%s +File name is => %s *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation6.phpt b/ext/standard/tests/file/tempnam_variation6.phpt index 5eb6e6fc86..51ecde9a73 100644 --- a/ext/standard/tests/file/tempnam_variation6.phpt +++ b/ext/standard/tests/file/tempnam_variation6.phpt @@ -1,10 +1,5 @@ --TEST-- -Test tempnam() function: usage variations - Using previous unique filename ---SKIPIF-- -<?php -if(substr(PHP_OS, 0, 3) == "WIN") - die("skip Do not run on Windows"); -?> +Test tempnam() function: usage variations - Using previous unique filename --FILE-- <?php /* Prototype: string tempnam ( string $dir, string $prefix ); @@ -25,20 +20,7 @@ for($i=1; $i<=3; $i++) { echo "File name is => "; print($file_name); echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - - if ($file_dir == sys_get_temp_dir()) { - echo "temp dir\n"; - } - else if ($file_dir == $file_path) { - echo "directory specified\n"; - } - else { - echo "unknown location\n"; - } - } + } unlink($file_name); } @@ -48,13 +30,10 @@ echo "\n*** Done ***\n"; --EXPECTF-- *** Test tempnam(): by passing previously created filenames *** -- Iteration 1 -- -File name is => %s%etempnam_variation6.tmp%s -File created in => directory specified +File name is => %s -- Iteration 2 -- -File name is => %s%etempnam_variation6.tmp%s -File created in => directory specified +File name is => %s -- Iteration 3 -- -File name is => %s%etempnam_variation6.tmp%s -File created in => directory specified +File name is => %s *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt index 5096934e03..486240146f 100644 --- a/ext/standard/tests/file/tempnam_variation7-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt @@ -3,7 +3,7 @@ Test tempnam() function: usage variations - invalid/non-existing dir --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) != "WIN") - die("skip Only run on Windows"); + die("skip Run only on Windows"); ?> --FILE-- <?php @@ -15,6 +15,8 @@ if(substr(PHP_OS, 0, 3) != "WIN") hence the unique files will be created in temporary dir */ echo "*** Testing tempnam() with invalid/non-existing directory names ***\n"; +$file_path = dirname(__FILE__); + /* An array of names, which will be passed as a dir name */ $names_arr = array( /* Invalid args */ @@ -24,7 +26,7 @@ $names_arr = array( NULL, "", " ", - "\0", + "/0", array(), /* Non-existing dirs */ @@ -33,7 +35,7 @@ $names_arr = array( ); -for( $i=0; $i<count($names_arr); $i++ ) { +for( $i=1; $i<count($names_arr); $i++ ) { echo "-- Iteration $i --\n"; $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp"); @@ -46,19 +48,9 @@ for( $i=0; $i<count($names_arr); $i++ ) { echo "File permissions are => "; printf("%o", fileperms($file_name) ); echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } - else { - echo "unknown location\n"; - } } - else { + else echo "-- File is not created --\n"; - } unlink($file_name); } @@ -67,34 +59,24 @@ echo "\n*** Done ***\n"; ?> --EXPECTF-- *** Testing tempnam() with invalid/non-existing directory names *** --- Iteration 0 -- -File name is => %s%et%s -File permissions are => 100666 -File created in => temp dir -- Iteration 1 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => temp dir -- Iteration 2 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => temp dir -- Iteration 3 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => temp dir -- Iteration 4 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => temp dir -- Iteration 5 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => temp dir -- Iteration 6 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => temp dir -- Iteration 7 -- Warning: tempnam() expects parameter 1 to be string, array given in %s on line %d @@ -102,13 +84,10 @@ Warning: tempnam() expects parameter 1 to be string, array given in %s on line % Warning: unlink(): No such file or directory in %s on line %d -- Iteration 8 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => temp dir -- Iteration 9 -- -File name is => %s%et%s +File name is => %s File permissions are => 100666 -File created in => temp dir *** Done *** - diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt index 0e314dabe3..ebecd1601f 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -3,7 +3,7 @@ Test tempnam() function: usage variations - invalid/non-existing dir --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) == "WIN") - die("skip Do not run on Windows"); + die("skip DO not run on Windows"); ?> --FILE-- <?php @@ -15,6 +15,8 @@ if(substr(PHP_OS, 0, 3) == "WIN") hence the unique files will be created in temporary dir */ echo "*** Testing tempnam() with invalid/non-existing directory names ***\n"; +$file_path = dirname(__FILE__); + /* An array of names, which will be passed as a dir name */ $names_arr = array( /* Invalid args */ @@ -24,7 +26,7 @@ $names_arr = array( NULL, "", " ", - "\0", + "/0", array(), /* Non-existing dirs */ @@ -33,7 +35,7 @@ $names_arr = array( ); -for( $i=0; $i<count($names_arr); $i++ ) { +for( $i=1; $i<count($names_arr); $i++ ) { echo "-- Iteration $i --\n"; $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp"); @@ -46,21 +48,9 @@ for( $i=0; $i<count($names_arr); $i++ ) { echo "File permissions are => "; printf("%o", fileperms($file_name) ); echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - - if (realpath($file_dir) == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } - else { - echo "unknown location\n"; - } - } - else { + else echo "-- File is not created --\n"; - } unlink($file_name); } @@ -69,34 +59,24 @@ echo "\n*** Done ***\n"; ?> --EXPECTF-- *** Testing tempnam() with invalid/non-existing directory names *** --- Iteration 0 -- -File name is => %s%etempnam_variation3.tmp%s -File permissions are => 100600 -File created in => temp dir -- Iteration 1 -- -File name is => %s%etempnam_variation3.tmp%s +File name is => %s File permissions are => 100600 -File created in => temp dir -- Iteration 2 -- -File name is => %s%etempnam_variation3.tmp%s +File name is => %s File permissions are => 100600 -File created in => temp dir -- Iteration 3 -- -File name is => %s%etempnam_variation3.tmp%s +File name is => %s File permissions are => 100600 -File created in => temp dir -- Iteration 4 -- -File name is => %s%etempnam_variation3.tmp%s +File name is => %s File permissions are => 100600 -File created in => temp dir -- Iteration 5 -- -File name is => %s%etempnam_variation3.tmp%s +File name is => %s File permissions are => 100600 -File created in => temp dir -- Iteration 6 -- -File name is => %s%etempnam_variation3.tmp%s +File name is => %s File permissions are => 100600 -File created in => temp dir -- Iteration 7 -- Warning: tempnam() expects parameter 1 to be string, array given in %s on line %d @@ -104,13 +84,10 @@ Warning: tempnam() expects parameter 1 to be string, array given in %s on line % Warning: unlink(): No such file or directory in %s on line %d -- Iteration 8 -- -File name is => %s%etempnam_variation3.tmp%s +File name is => %s File permissions are => 100600 -File created in => temp dir -- Iteration 9 -- -File name is => %s%etempnam_variation3.tmp%s +File name is => %s File permissions are => 100600 -File created in => temp dir *** Done *** - diff --git a/ext/standard/tests/file/touch.phpt b/ext/standard/tests/file/touch.phpt index c6c270d065..aea68b0d44 100644 --- a/ext/standard/tests/file/touch.phpt +++ b/ext/standard/tests/file/touch.phpt @@ -1,16 +1,8 @@ --TEST-- touch() tests ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. only for Non Windows.'); -} -?> --FILE-- <?php -// This doesn't work for windows, time, atime usage results in very different -// output to linux. This could be a php.net bug on windows or a windows querk. $filename = dirname(__FILE__)."/touch.dat"; var_dump(touch()); @@ -52,7 +44,6 @@ int(100) bool(true) int(100) -Warning: touch(): Unable to create file /no/such/file/or/directory because %s in %s on line %d +Warning: touch(): Unable to create file /no/such/file/or/directory because No such file or directory in %s on line %d bool(false) Done - diff --git a/ext/standard/tests/general_functions/008.phpt b/ext/standard/tests/general_functions/008.phpt index f76c73572b..bb633c334d 100644 --- a/ext/standard/tests/general_functions/008.phpt +++ b/ext/standard/tests/general_functions/008.phpt @@ -34,7 +34,7 @@ array(14) { [11]=> float(123456789012) [12]=> - float(1.23456789012E+12) + float(1234567890120) [13]=> float(1.23456789012E+19) }
\ No newline at end of file diff --git a/ext/standard/tests/general_functions/parse_ini_basic.data b/ext/standard/tests/general_functions/parse_ini_basic.data index fdbd55cbf9..05b515ee60 100644 --- a/ext/standard/tests/general_functions/parse_ini_basic.data +++ b/ext/standard/tests/general_functions/parse_ini_basic.data @@ -127,6 +127,3 @@ ini_with-hyphen = with hyphen and underscore ini.with-hyphen = dot and hyphen ini-with.hyphen = hyphen and dot -[windows paths] -winpath1="c:\some windows\path\test\new\r\quote \" here\single ' quote\some more" -winpath2="special case\" diff --git a/ext/standard/tests/general_functions/parse_ini_basic.phpt b/ext/standard/tests/general_functions/parse_ini_basic.phpt index bdd44e0a2f..23fcefa491 100644 --- a/ext/standard/tests/general_functions/parse_ini_basic.phpt +++ b/ext/standard/tests/general_functions/parse_ini_basic.phpt @@ -15,7 +15,7 @@ var_dump(parse_ini_file($ini_file, 1)); echo "Done.\n"; ?> --EXPECTF-- -array(26) { +array(25) { ["basic"]=> array(15) { ["basicval"]=> @@ -272,12 +272,5 @@ array(26) { ["ini-with.hyphen"]=> string(14) "hyphen and dot" } - ["windows paths"]=> - array(2) { - ["winpath1"]=> - string(69) "c:\some windows\path\test\new\r\quote " here\single ' quote\some more" - ["winpath2"]=> - string(13) "special case\" - } } Done. diff --git a/ext/standard/tests/general_functions/parse_ini_file.phpt b/ext/standard/tests/general_functions/parse_ini_file.phpt index 8523c83cf0..65a29e0022 100644 --- a/ext/standard/tests/general_functions/parse_ini_file.phpt +++ b/ext/standard/tests/general_functions/parse_ini_file.phpt @@ -105,18 +105,6 @@ INI; file_put_contents($filename, $ini); var_dump(parse_ini_file($filename, true)); -/* #44575, comments starting with '#' */ -$ini = <<<'INI' -foo=bar1 -; comment -_foo=bar2 -# comment -foo_=bar3 -INI; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename, true)); - - @unlink($filename); echo "Done\n"; ?> @@ -205,14 +193,4 @@ array(3) { ["foo_"]=> string(4) "bar3" } - -Deprecated: Comments starting with '#' are deprecated in %s -array(3) { - ["foo"]=> - string(4) "bar1" - ["_foo"]=> - string(4) "bar2" - ["foo_"]=> - string(4) "bar3" -} Done diff --git a/ext/standard/tests/serialize/bug42919.phpt b/ext/standard/tests/serialize/bug42919.phpt index 0a3d0b2e07..11cb81de6c 100755 --- a/ext/standard/tests/serialize/bug42919.phpt +++ b/ext/standard/tests/serialize/bug42919.phpt @@ -10,5 +10,5 @@ $x = unserialize(serialize(new Bar)); echo get_class($x) . "\n"; ?> --EXPECT-- -O:7:"Foo\Bar":0:{} -Foo\Bar +O:8:"Foo::Bar":0:{} +Foo::Bar diff --git a/ext/standard/tests/strings/htmlentities-utf.phpt b/ext/standard/tests/strings/htmlentities-utf.phpt index b85803a163..6b83afc778 100755 --- a/ext/standard/tests/strings/htmlentities-utf.phpt +++ b/ext/standard/tests/strings/htmlentities-utf.phpt @@ -4,12 +4,8 @@ HTML entities with invalid chars output_handler= --FILE-- <?php -@setlocale (LC_CTYPE, "C"); -$strings = array(b"<", b"\xD0", b"\xD0\x90", b"\xD0\x90\xD0", b"\xD0\x90\xD0\xB0", b"\xE0", b"A\xE0", b"\xE0\x80", b"\xE0\x79", b"\xE0\x80\xBE", - b"Voil\xE0", b"Clich\xE9s", - b"\xFE", b"\xFE\x41", b"\xC3\xA9", b"\xC3\x79", b"\xF7\xBF\xBF\xBF", b"\xFB\xBF\xBF\xBF\xBF", b"\xFD\xBF\xBF\xBF\xBF\xBF", - b"\x41\xF7\xF7\x42", b"\x42\xFB\xFB\x42", b"\x43\xFD\xFD\x42", b"\x44\xF7\xF7", b"\x45\xFB\xFB", b"\x46\xFD\xFD" - ); +setlocale (LC_CTYPE, "C"); +$strings = array("<", "\xD0", "\xD0\x90", "\xD0\x90\xD0", "\xD0\x90\xD0\xB0", "\xE0", "A\xE0", "\xE0\x80", "\xE0\x80\xBE"); foreach($strings as $string) { $sc_encoded = htmlspecialchars ($string, ENT_QUOTES, "utf-8"); var_dump(bin2hex($sc_encoded)); @@ -17,54 +13,22 @@ foreach($strings as $string) { var_dump(bin2hex($ent_encoded)); } ?> ---EXPECTF-- -%unicode|string%(8) "266c743b" -%unicode|string%(8) "266c743b" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(4) "d090" -%unicode|string%(4) "d090" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(8) "d090d0b0" -%unicode|string%(8) "d090d0b0" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(8) "2667743b" -%unicode|string%(8) "2667743b" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(4) "c3a9" -%unicode|string%(16) "266561637574653b" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(8) "f7bfbfbf" -%unicode|string%(8) "f7bfbfbf" -%unicode|string%(10) "fbbfbfbfbf" -%unicode|string%(10) "fbbfbfbfbf" -%unicode|string%(12) "fdbfbfbfbfbf" -%unicode|string%(12) "fdbfbfbfbfbf" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" -%unicode|string%(0) "" +--EXPECT-- +string(8) "266c743b" +string(8) "266c743b" +string(0) "" +string(0) "" +string(4) "d090" +string(4) "d090" +string(0) "" +string(0) "" +string(8) "d090d0b0" +string(8) "d090d0b0" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(8) "2667743b" +string(8) "2667743b"
\ No newline at end of file diff --git a/ext/standard/tests/strings/printf.phpt b/ext/standard/tests/strings/printf.phpt index d644dfb0f5..6474bdd841 100755 --- a/ext/standard/tests/strings/printf.phpt +++ b/ext/standard/tests/strings/printf.phpt @@ -645,10 +645,10 @@ Array -123456 123456 -123456 -1.2e+5 --1.2e+5 -+1.2e+5 --1.2e+5 +120000 +-120000 ++120000 +-120000 123456 -123456 1.0E+5 @@ -657,10 +657,10 @@ Array -123456 123456 -123456 -1.2E+5 --1.2E+5 -+1.2E+5 --1.2E+5 +120000 +-120000 ++120000 +-120000 *** Output for '%%%.2f' as the format parameter *** %12345678900.00 diff --git a/ext/standard/tests/strings/printf_64bit.phpt b/ext/standard/tests/strings/printf_64bit.phpt index b76911ab3e..7534927e69 100755 --- a/ext/standard/tests/strings/printf_64bit.phpt +++ b/ext/standard/tests/strings/printf_64bit.phpt @@ -645,10 +645,10 @@ Array -123456 123456 -123456 -1.2e+5 --1.2e+5 -+1.2e+5 --1.2e+5 +120000 +-120000 ++120000 +-120000 123456 -123456 1.0E+5 @@ -657,10 +657,10 @@ Array -123456 123456 -123456 -1.2E+5 --1.2E+5 -+1.2E+5 --1.2E+5 +120000 +-120000 ++120000 +-120000 *** Output for '%%%.2f' as the format parameter *** %12345678900.00 diff --git a/ext/standard/tests/strings/similar_text_basic.phpt b/ext/standard/tests/strings/similar_text_basic.phpt index 37b6527180..0eaf5c1c26 100644 --- a/ext/standard/tests/strings/similar_text_basic.phpt +++ b/ext/standard/tests/strings/similar_text_basic.phpt @@ -3,7 +3,7 @@ similar_text(), basic tests --CREDITS-- Mats Lindh <mats at lindh.no> #Testfest php.no ---INI-- +--INIT-- precision=14 --FILE-- <?php diff --git a/ext/standard/type.c b/ext/standard/type.c index ca5bf0d40c..e4632add20 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -356,7 +356,7 @@ PHP_FUNCTION(is_scalar) Returns true if var is callable. */ PHP_FUNCTION(is_callable) { - zval *var, **callable_name = NULL; + zval *var, **callable_name; char *name; zend_bool retval; zend_bool syntax_only = 0; diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index f0155fbb9f..f470ca28c3 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -54,6 +54,7 @@ static int le_bucket; PHP_FUNCTION(user_filter_nop) { } +static ZEND_BEGIN_ARG_INFO(arginfo_php_user_filter_filter, 0) ZEND_ARG_INFO(0, in) ZEND_ARG_INFO(0, out) @@ -61,9 +62,11 @@ ZEND_BEGIN_ARG_INFO(arginfo_php_user_filter_filter, 0) ZEND_ARG_INFO(0, closing) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_php_user_filter_onCreate, 0) ZEND_END_ARG_INFO() +static ZEND_BEGIN_ARG_INFO(arginfo_php_user_filter_onClose, 0) ZEND_END_ARG_INFO() @@ -177,14 +180,12 @@ php_stream_filter_status_t userfilter_filter( zval *retval = NULL; zval **args[4]; zval *zclosing, *zconsumed, *zin, *zout, *zstream; - zval zpropname; int call_result; if (FAILURE == zend_hash_find(Z_OBJPROP_P(obj), "stream", sizeof("stream"), (void**)&zstream)) { /* Give the userfilter class a hook back to the stream */ ALLOC_INIT_ZVAL(zstream); php_stream_to_zval(stream, zstream); - zval_copy_ctor(zstream); add_property_zval(obj, "stream", zstream); /* add_property_zval increments the refcount which is unwanted here */ zval_ptr_dtor(&zstream); @@ -246,13 +247,6 @@ php_stream_filter_status_t userfilter_filter( } } - /* filter resources are cleaned up by the stream destructor, - * keeping a reference to the stream resource here would prevent it - * from being destroyed properly */ - INIT_ZVAL(zpropname); - ZVAL_STRINGL(&zpropname, "stream", sizeof("stream")-1, 0); - Z_OBJ_HANDLER_P(obj, unset_property)(obj, &zpropname TSRMLS_CC); - zval_ptr_dtor(&zclosing); zval_ptr_dtor(&zconsumed); zval_ptr_dtor(&zout); diff --git a/ext/standard/var.c b/ext/standard/var.c index 093460414d..6f4fe05361 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -410,7 +410,7 @@ PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC) /* {{{ */ php_printf("\n%*c", level - 1, ' '); } PUTS ("array (\n"); - zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) php_array_element_export, 1, level, 0); + zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) php_array_element_export, 1, level, (Z_TYPE_PP(struc) == IS_ARRAY ? 0 : 1)); if (level > 1) { php_printf("%*c", level - 1, ' '); } diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 241321a187..7dc84b0bc2 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.6.dev on Tue Nov 4 01:37:59 2008 */ +/* Generated by re2c 0.13.5 on Fri Aug 29 18:39:52 2008 */ #line 1 "ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ @@ -578,7 +578,7 @@ yy20: return 0; } - len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\\"); + len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:"); if (len3 != len) { *p = YYCURSOR + len3 - len; diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 3661641857..1c009462b2 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -613,7 +613,7 @@ object ":" uiv ":" ["] { return 0; } - len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\\"); + len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:"); if (len3 != len) { *p = YYCURSOR + len3 - len; diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c index 08b65d697c..4160fc6359 100644 --- a/ext/standard/versioning.c +++ b/ext/standard/versioning.c @@ -45,7 +45,7 @@ php_canonicalize_version(const char *version) p = version; q = buf; *q++ = lp = *p++; - + lq = '\0'; while (*p) { /* s/[-_+]/./g; * s/([^\d\.])([^\D\.])/$1.$2/g; @@ -55,22 +55,22 @@ php_canonicalize_version(const char *version) #define isndig(x) (!isdigit(x)&&(x)!='.') #define isspecialver(x) ((x)=='-'||(x)=='_'||(x)=='+') - lq = *(q - 1); + lq = *(q - 1); if (isspecialver(*p)) { if (lq != '.') { - *q++ = '.'; + lq = *q++ = '.'; } } else if ((isndig(lp) && isdig(*p)) || (isdig(lp) && isndig(*p))) { if (lq != '.') { *q++ = '.'; } - *q++ = *p; + lq = *q++ = *p; } else if (!isalnum(*p)) { if (lq != '.') { - *q++ = '.'; + lq = *q++ = '.'; } } else { - *q++ = *p; + lq = *q++ = *p; } lp = *p++; } @@ -210,8 +210,8 @@ php_version_compare(const char *orig_ver1, const char *orig_ver2) PHP_FUNCTION(version_compare) { - char *v1, *v2, *op = NULL; - int v1_len, v2_len, op_len = 0; + char *v1, *v2, *op; + int v1_len, v2_len, op_len; int compare, argc; argc = ZEND_NUM_ARGS(); |