summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:36:21 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:36:21 -0400
commitd29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (patch)
treeb38e2e5c6974b9a15f103e5cf884cba9fff90ef4 /ext/standard
parenta88a88d0986a4a32288c102cdbfebd78d7e91d99 (diff)
downloadphp-d29a4fd2dd3b5d4cf6e80b602544d7b71d794e76.tar.gz
Imported Upstream version 5.2.0upstream/5.2.0
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/array.c169
-rw-r--r--ext/standard/assert.c9
-rw-r--r--ext/standard/base64.c58
-rw-r--r--ext/standard/base64.h3
-rw-r--r--ext/standard/basic_functions.c4171
-rw-r--r--ext/standard/basic_functions.h5
-rw-r--r--ext/standard/config.m422
-rw-r--r--ext/standard/credits.c4
-rw-r--r--ext/standard/credits_ext.h13
-rw-r--r--ext/standard/datetime.c12
-rw-r--r--ext/standard/dir.c4
-rw-r--r--ext/standard/file.c57
-rw-r--r--ext/standard/file.h4
-rw-r--r--ext/standard/filestat.c50
-rw-r--r--ext/standard/filters.c6
-rw-r--r--ext/standard/formatted_print.c5
-rw-r--r--ext/standard/head.c31
-rw-r--r--ext/standard/head.h4
-rw-r--r--ext/standard/html.c23
-rw-r--r--ext/standard/http.c6
-rw-r--r--ext/standard/http_fopen_wrapper.c6
-rw-r--r--ext/standard/image.c6
-rw-r--r--ext/standard/info.c50
-rw-r--r--ext/standard/info.h4
-rw-r--r--ext/standard/iptc.c8
-rw-r--r--ext/standard/levenshtein.c4
-rw-r--r--ext/standard/link.c16
-rw-r--r--ext/standard/math.c43
-rw-r--r--ext/standard/metaphone.c12
-rw-r--r--ext/standard/php_array.h3
-rw-r--r--ext/standard/php_fopen_wrapper.c6
-rw-r--r--ext/standard/php_string.h4
-rw-r--r--ext/standard/php_var.h3
-rw-r--r--ext/standard/proc_open.c6
-rw-r--r--ext/standard/scanf.c2
-rw-r--r--ext/standard/sha1.h3
-rw-r--r--ext/standard/streamsfuncs.c48
-rw-r--r--ext/standard/streamsfuncs.h3
-rw-r--r--ext/standard/string.c273
-rw-r--r--ext/standard/tests/array/007.phpt58
-rw-r--r--ext/standard/tests/array/array_fill.phpt366
-rwxr-xr-xext/standard/tests/array/array_fill_keys.phpt42
-rw-r--r--ext/standard/tests/array/array_filter.phpt93
-rw-r--r--ext/standard/tests/array/array_flip.phpt37
-rw-r--r--ext/standard/tests/array/array_intersect_1.phpt127
-rw-r--r--ext/standard/tests/array/array_search1.phpt35
-rw-r--r--ext/standard/tests/array/array_walk.phpt48
-rw-r--r--ext/standard/tests/array/array_walk_objects.phptbin0 -> 785 bytes
-rw-r--r--ext/standard/tests/array/array_walk_rec_objects.phptbin0 -> 845 bytes
-rw-r--r--ext/standard/tests/array/array_walk_recursive1.phpt54
-rw-r--r--ext/standard/tests/array/bug30833.phpt2
-rw-r--r--ext/standard/tests/array/bug34066.phpt804
-rw-r--r--ext/standard/tests/array/bug34066_1.phpt731
-rw-r--r--ext/standard/tests/array/bug38464.phpt20
-rw-r--r--ext/standard/tests/array/max.phpt39
-rw-r--r--ext/standard/tests/array/min.phpt39
-rw-r--r--ext/standard/tests/assert/assert02.phpt42
-rw-r--r--ext/standard/tests/file/bug22414.phpt1
-rw-r--r--ext/standard/tests/file/bug24313.phpt6
-rw-r--r--ext/standard/tests/file/bug37864.phpt12
-rw-r--r--ext/standard/tests/file/bug38086.phpt46
-rw-r--r--ext/standard/tests/file/bug38086.txt5
-rw-r--r--ext/standard/tests/file/bug38450.phpt114
-rw-r--r--ext/standard/tests/file/bug38450_1.phpt114
-rw-r--r--ext/standard/tests/file/bug38450_2.phpt114
-rw-r--r--ext/standard/tests/file/bug38450_3.phpt105
-rw-r--r--ext/standard/tests/file/file_put_contents.phpt28
-rw-r--r--ext/standard/tests/file/mkdir-001.phpt36
-rw-r--r--ext/standard/tests/file/mkdir-002.phpt49
-rw-r--r--ext/standard/tests/file/mkdir-003.phpt30
-rw-r--r--ext/standard/tests/file/mkdir-004.phpt24
-rw-r--r--ext/standard/tests/file/mkdir-005.phpt25
-rw-r--r--ext/standard/tests/file/mkdir-006.phpt26
-rw-r--r--ext/standard/tests/file/stream_001.phpt24
-rw-r--r--ext/standard/tests/file/stream_002.phpt53
-rw-r--r--ext/standard/tests/file/stream_copy_to_stream.phpt129
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_001.phpt20
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_002.phpt180
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_003.gifbin0 -> 273 bytes
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_003.phpt36
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_004.phpt30
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_005.phpt36
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_006.phpt28
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_007.phpt141
-rw-r--r--ext/standard/tests/filters/001.phpt31
-rw-r--r--ext/standard/tests/filters/php_user_filter_01.phpt17
-rw-r--r--ext/standard/tests/filters/php_user_filter_02.phpt12
-rw-r--r--ext/standard/tests/filters/php_user_filter_03.phpt12
-rw-r--r--ext/standard/tests/general_functions/010.phpt25
-rw-r--r--ext/standard/tests/general_functions/sunfuncts.phpt50
-rw-r--r--ext/standard/tests/image/image_type_to_extension.phpt103
-rw-r--r--ext/standard/tests/math/constants.phpt46
-rwxr-xr-xext/standard/tests/serialize/bug37947.phpt21
-rw-r--r--ext/standard/tests/strings/bug22224.phpt7
-rw-r--r--ext/standard/tests/strings/bug24098.phpt4
-rw-r--r--ext/standard/tests/strings/bug29538.phpt10
-rw-r--r--ext/standard/tests/strings/bug37244.phpt18
-rw-r--r--ext/standard/tests/strings/bug37262.phpt9
-rw-r--r--ext/standard/tests/strings/bug38322.phpt13
-rw-r--r--ext/standard/tests/strings/bug39032.phpt18
-rw-r--r--ext/standard/tests/strings/explode.phpt2
-rw-r--r--ext/standard/tests/strings/htmlentities15.phpt4
-rw-r--r--ext/standard/tests/strings/implode1.phpt59
-rw-r--r--ext/standard/tests/strings/pathinfo.phpt108
-rw-r--r--ext/standard/tests/strings/str_replace.phpt108
-rw-r--r--ext/standard/tests/strings/str_word_count.phpt51
-rw-r--r--ext/standard/tests/strings/str_word_count1.phpt26
-rw-r--r--ext/standard/tests/strings/strings001.phpt2
-rw-r--r--ext/standard/tests/strings/stripos.phpt55
-rw-r--r--ext/standard/tests/strings/strrchr.phpt22
-rw-r--r--ext/standard/tests/strings/url_t.phpt21
-rwxr-xr-xext/standard/tests/time/bug38524.phpt29
-rw-r--r--ext/standard/url.c40
-rw-r--r--ext/standard/user_filters.c38
-rw-r--r--ext/standard/uuencode.c6
-rw-r--r--ext/standard/var.c69
-rw-r--r--ext/standard/versioning.c4
117 files changed, 8999 insertions, 1146 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index fc698fd2d..843327dc2 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.308.2.22 2006/06/03 18:59:55 andrei Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.14 2006/10/03 17:41:47 iliaa Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -224,7 +224,7 @@ static int array_reverse_key_compare(const void *a, const void *b TSRMLS_DC)
return array_key_compare(a, b TSRMLS_CC) * -1;
}
-/* {{{ proto bool krsort(array array_arg [, int sort_flags])
+/* {{{ proto bool krsort(array &array_arg [, int sort_flags])
Sort an array by key value in reverse order */
PHP_FUNCTION(krsort)
{
@@ -246,7 +246,7 @@ PHP_FUNCTION(krsort)
}
/* }}} */
-/* {{{ proto bool ksort(array array_arg [, int sort_flags])
+/* {{{ proto bool ksort(array &array_arg [, int sort_flags])
Sort an array by key */
PHP_FUNCTION(ksort)
{
@@ -459,7 +459,7 @@ static void php_natsort(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
}
-/* {{{ proto void natsort(array array_arg)
+/* {{{ proto void natsort(array &array_arg)
Sort an array using natural sort */
PHP_FUNCTION(natsort)
{
@@ -468,7 +468,7 @@ PHP_FUNCTION(natsort)
/* }}} */
-/* {{{ proto void natcasesort(array array_arg)
+/* {{{ proto void natcasesort(array &array_arg)
Sort an array using case-insensitive natural sort */
PHP_FUNCTION(natcasesort)
{
@@ -477,7 +477,7 @@ PHP_FUNCTION(natcasesort)
/* }}} */
-/* {{{ proto bool asort(array array_arg [, int sort_flags])
+/* {{{ proto bool asort(array &array_arg [, int sort_flags])
Sort an array and maintain index association */
PHP_FUNCTION(asort)
{
@@ -499,7 +499,7 @@ PHP_FUNCTION(asort)
}
/* }}} */
-/* {{{ proto bool arsort(array array_arg [, int sort_flags])
+/* {{{ proto bool arsort(array &array_arg [, int sort_flags])
Sort an array in reverse order and maintain index association */
PHP_FUNCTION(arsort)
{
@@ -521,7 +521,7 @@ PHP_FUNCTION(arsort)
}
/* }}} */
-/* {{{ proto bool sort(array array_arg [, int sort_flags])
+/* {{{ proto bool sort(array &array_arg [, int sort_flags])
Sort an array */
PHP_FUNCTION(sort)
{
@@ -543,7 +543,7 @@ PHP_FUNCTION(sort)
}
/* }}} */
-/* {{{ proto bool rsort(array array_arg [, int sort_flags])
+/* {{{ proto bool rsort(array &array_arg [, int sort_flags])
Sort an array in reverse order */
PHP_FUNCTION(rsort)
{
@@ -1131,32 +1131,28 @@ 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)
{
- int argc;
- zval **array,
- **userdata = NULL,
+ zval *array,
+ *userdata = NULL,
+ *tmp,
**old_walk_func_name;
HashTable *target_hash;
- argc = ZEND_NUM_ARGS();
old_walk_func_name = BG(array_walk_func_name);
- if (argc < 2 || argc > 3 ||
- zend_get_parameters_ex(argc, &array, &BG(array_walk_func_name), &userdata) == FAILURE) {
- BG(array_walk_func_name) = old_walk_func_name;
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &array, &tmp, &userdata) == FAILURE) {
+ return;
}
- target_hash = HASH_OF(*array);
+ target_hash = HASH_OF(array);
if (!target_hash) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array");
- BG(array_walk_func_name) = old_walk_func_name;
RETURN_FALSE;
}
- if (Z_TYPE_PP(BG(array_walk_func_name)) != IS_ARRAY &&
- Z_TYPE_PP(BG(array_walk_func_name)) != IS_STRING) {
+ if (Z_TYPE_P(tmp) != IS_ARRAY && Z_TYPE_P(tmp) != IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong syntax for function name");
- BG(array_walk_func_name) = old_walk_func_name;
RETURN_FALSE;
+ } else {
+ BG(array_walk_func_name) = &tmp;
}
- php_array_walk(target_hash, userdata, 0 TSRMLS_CC);
+ php_array_walk(target_hash, userdata ? &userdata: NULL, 0 TSRMLS_CC);
BG(array_walk_func_name) = old_walk_func_name;
RETURN_TRUE;
}
@@ -1166,32 +1162,28 @@ PHP_FUNCTION(array_walk)
Apply a user function recursively to every member of an array */
PHP_FUNCTION(array_walk_recursive)
{
- int argc;
- zval **array,
- **userdata = NULL,
+ zval *array,
+ *userdata = NULL,
+ *tmp,
**old_walk_func_name;
HashTable *target_hash;
- argc = ZEND_NUM_ARGS();
old_walk_func_name = BG(array_walk_func_name);
-
- if (argc < 2 || argc > 3 ||
- zend_get_parameters_ex(argc, &array, &BG(array_walk_func_name), &userdata) == FAILURE) {
- BG(array_walk_func_name) = old_walk_func_name;
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &array, &tmp, &userdata) == FAILURE) {
+ return;
}
- target_hash = HASH_OF(*array);
+ target_hash = HASH_OF(array);
if (!target_hash) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array");
- BG(array_walk_func_name) = old_walk_func_name;
RETURN_FALSE;
}
- if (Z_TYPE_PP(BG(array_walk_func_name)) != IS_ARRAY && Z_TYPE_PP(BG(array_walk_func_name)) != IS_STRING) {
+ if (Z_TYPE_P(tmp) != IS_ARRAY && Z_TYPE_P(tmp) != IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong syntax for function name");
- BG(array_walk_func_name) = old_walk_func_name;
RETURN_FALSE;
+ } else {
+ BG(array_walk_func_name) = &tmp;
}
- php_array_walk(target_hash, userdata, 1 TSRMLS_CC);
+ php_array_walk(target_hash, userdata ? &userdata : NULL, 1 TSRMLS_CC);
BG(array_walk_func_name) = old_walk_func_name;
RETURN_TRUE;
}
@@ -1515,6 +1507,9 @@ PHP_FUNCTION(compact)
zval ***args; /* function arguments array */
int i;
+ if (ZEND_NUM_ARGS() < 1) {
+ WRONG_PARAM_COUNT;
+ }
args = (zval ***)safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval **), 0);
if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
@@ -1579,6 +1574,49 @@ PHP_FUNCTION(array_fill)
}
/* }}} */
+/* {{{ proto array array_fill_keys(array keys, mixed val)
+ Create an array using the elements of the first parameter as keys each initialized to val */
+PHP_FUNCTION(array_fill_keys)
+{
+ zval *keys, *val, **entry;
+ HashPosition pos;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "az", &keys, &val) == FAILURE) {
+ return;
+ }
+
+ /* Initialize return array */
+ array_init(return_value);
+
+ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(keys), &pos);
+ while (zend_hash_get_current_data_ex(Z_ARRVAL_P(keys), (void **)&entry, &pos) == SUCCESS) {
+
+ if (Z_TYPE_PP(entry) == IS_LONG) {
+ zval_add_ref(&val);
+ zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(entry), &val, sizeof(zval *), NULL);
+ } else {
+ zval key, *key_ptr = *entry;
+
+ if (Z_TYPE_PP(entry) != IS_STRING) {
+ key = **entry;
+ zval_copy_ctor(&key);
+ convert_to_string(&key);
+ key_ptr = &key;
+ }
+
+ zval_add_ref(&val);
+ zend_symtable_update(Z_ARRVAL_P(return_value), Z_STRVAL_P(key_ptr), Z_STRLEN_P(key_ptr) + 1, &val, sizeof(zval *), NULL);
+
+ if (key_ptr != *entry) {
+ zval_dtor(&key);
+ }
+ }
+
+ zend_hash_move_forward_ex(Z_ARRVAL_P(keys), &pos);
+ }
+}
+/* }}} */
+
/* {{{ proto array range(mixed low, mixed high[, int step])
Create an array containing the range of integers or characters from low to high (inclusive) */
PHP_FUNCTION(range)
@@ -1720,7 +1758,6 @@ err:
}
/* }}} */
-
static void array_data_shuffle(zval *array TSRMLS_DC)
{
Bucket **elems, *temp;
@@ -2151,7 +2188,7 @@ PHP_FUNCTION(array_splice)
/* }}} */
-/* {{{ proto array array_slice(array input, int offset [, int length])
+/* {{{ proto array array_slice(array input, int offset [, int length [, bool preserve_keys]])
Returns elements specified by offset and length */
PHP_FUNCTION(array_slice)
{
@@ -2286,7 +2323,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS
} else {
(*src_entry)->refcount++;
- zend_hash_update(dest, string_key, strlen(string_key)+1,
+ zend_hash_update(dest, string_key, string_key_len,
src_entry, sizeof(zval *), NULL);
}
break;
@@ -2506,46 +2543,17 @@ PHP_FUNCTION(array_count_values)
(void**)&tmp) == FAILURE) {
zval *data;
MAKE_STD_ZVAL(data);
- Z_TYPE_P(data) = IS_LONG;
- Z_LVAL_P(data) = 1;
+ ZVAL_LONG(data, 1);
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(entry), &data, sizeof(data), NULL);
} else {
Z_LVAL_PP(tmp)++;
}
} else if (Z_TYPE_PP(entry) == IS_STRING) {
- /* make sure our array does not end up with numeric string keys
- * but don't touch those strings that start with 0 */
- if (!(Z_STRLEN_PP(entry) > 1 && Z_STRVAL_PP(entry)[0] == '0') && is_numeric_string(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, NULL, 0) == IS_LONG) {
- zval tmp_entry;
-
- tmp_entry = **entry;
- zval_copy_ctor(&tmp_entry);
-
- convert_to_long(&tmp_entry);
-
- if (zend_hash_index_find(Z_ARRVAL_P(return_value),
- Z_LVAL(tmp_entry),
- (void**)&tmp) == FAILURE) {
- zval *data;
- MAKE_STD_ZVAL(data);
- Z_TYPE_P(data) = IS_LONG;
- Z_LVAL_P(data) = 1;
- zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL(tmp_entry), &data, sizeof(data), NULL);
- } else {
- Z_LVAL_PP(tmp)++;
- }
-
- zval_dtor(&tmp_entry);
- zend_hash_move_forward_ex(myht, &pos);
- continue;
- }
-
- if (zend_hash_find(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry)+1, (void**)&tmp) == FAILURE) {
+ if (zend_symtable_find(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, (void**)&tmp) == FAILURE) {
zval *data;
MAKE_STD_ZVAL(data);
- Z_TYPE_P(data) = IS_LONG;
- Z_LVAL_P(data) = 1;
- zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &data, sizeof(data), NULL);
+ ZVAL_LONG(data, 1);
+ zend_symtable_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &data, sizeof(data), NULL);
} else {
Z_LVAL_PP(tmp)++;
}
@@ -3047,7 +3055,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
zval *tmp;
ALLOC_HASHTABLE(ht);
- zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(ht, zend_hash_num_elements(return_value->value.ht), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(ht, return_value->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
return_value->value.ht = ht;
}
@@ -3179,6 +3187,7 @@ PHP_FUNCTION(array_intersect_key)
php_array_intersect(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTERSECT_KEY,
INTERSECT_COMP_DATA_INTERNAL, INTERSECT_COMP_KEY_INTERNAL);
}
+/* }}} */
/* {{{ proto array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
Returns the entries of arr1 that have keys which are present in all the other arguments. Kind of equivalent to array_diff(array_keys($arr1), array_keys($arr2)[,array_keys(...)]). The comparison of the keys is performed by a user supplied function. Equivalent of array_intersect_uassoc() but does not do compare of the data. */
@@ -3187,7 +3196,7 @@ PHP_FUNCTION(array_intersect_ukey)
php_array_intersect(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTERSECT_KEY,
INTERSECT_COMP_DATA_INTERNAL, INTERSECT_COMP_KEY_USER);
}
-
+/* }}} */
/* {{{ proto array array_intersect(array arr1, array arr2 [, array ...])
Returns the entries of arr1 that have values which are present in all the other arguments */
@@ -3432,7 +3441,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
zval *tmp;
ALLOC_HASHTABLE(ht);
- zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(ht, zend_hash_num_elements(return_value->value.ht), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(ht, return_value->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
return_value->value.ht = ht;
}
@@ -4479,7 +4488,7 @@ PHP_FUNCTION(array_chunk)
/* }}} */
/* {{{ proto array array_combine(array keys, array values)
- Creates an array by using the elements of the first parameter as keys and the elements of the second as correspoding keys */
+ Creates an array by using the elements of the first parameter as keys and the elements of the second as the corresponding values */
PHP_FUNCTION(array_combine)
{
zval *values, *keys;
@@ -4491,7 +4500,7 @@ PHP_FUNCTION(array_combine)
}
if (zend_hash_num_elements(Z_ARRVAL_P(keys)) != zend_hash_num_elements(Z_ARRVAL_P(values))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both parameters should have equal number of elements");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both parameters should have an equal number of elements");
RETURN_FALSE;
}
@@ -4508,7 +4517,7 @@ PHP_FUNCTION(array_combine)
zend_hash_get_current_data_ex(Z_ARRVAL_P(values), (void **)&entry_values, &pos_values) == SUCCESS) {
if (Z_TYPE_PP(entry_keys) == IS_STRING) {
zval_add_ref(entry_values);
- add_assoc_zval(return_value, Z_STRVAL_PP(entry_keys), *entry_values);
+ add_assoc_zval_ex(return_value, Z_STRVAL_PP(entry_keys), Z_STRLEN_PP(entry_keys)+1, *entry_values);
} else if (Z_TYPE_PP(entry_keys) == IS_LONG) {
zval_add_ref(entry_values);
add_index_zval(return_value, Z_LVAL_PP(entry_keys), *entry_values);
@@ -4520,7 +4529,7 @@ PHP_FUNCTION(array_combine)
convert_to_string(&key);
zval_add_ref(entry_values);
- add_assoc_zval(return_value, Z_STRVAL(key), *entry_values);
+ add_assoc_zval_ex(return_value, Z_STRVAL(key), Z_STRLEN(key)+1, *entry_values);
zval_dtor(&key);
}
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index 2ac7e7595..06089f89c 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: assert.c,v 1.60.2.3 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: assert.c,v 1.60.2.3.2.2 2006/07/01 12:21:07 nlopess Exp $ */
/* {{{ includes/startup/misc */
@@ -151,8 +151,11 @@ PHP_FUNCTION(assert)
compiled_string_description = zend_make_compiled_string_description("assert code" TSRMLS_CC);
if (zend_eval_string(myeval, &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
efree(compiled_string_description);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
- /* php_error_docref() does not return in this case. */
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
+ if (ASSERTG(bail)) {
+ zend_bailout();
+ }
+ RETURN_FALSE;
}
efree(compiled_string_description);
diff --git a/ext/standard/base64.c b/ext/standard/base64.c
index 7f8f2fbaa..4aed7bc4e 100644
--- a/ext/standard/base64.c
+++ b/ext/standard/base64.c
@@ -15,7 +15,7 @@
| Author: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: base64.c,v 1.43.2.2 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: base64.c,v 1.43.2.2.2.1 2006/05/06 22:47:14 iliaa Exp $ */
#include <string.h>
@@ -34,22 +34,22 @@ static const char base64_table[] =
static const char base64_pad = '=';
static const short base64_reverse_table[256] = {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
- -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, -2, -2, -1, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 62, -2, -2, -2, 63,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -2, -2, -2, -2, -2, -2,
+ -2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -2, -2, -2, -2, -2,
+ -2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2
};
/* }}} */
@@ -135,9 +135,14 @@ void php_base64_init()
*/
/* }}} */
+PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, int *ret_length)
+{
+ return php_base64_decode_ex(str, length, ret_length, 0);
+}
+
/* {{{ php_base64_decode */
/* as above, but backwards. :) */
-PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, int *ret_length)
+PHPAPI unsigned char *php_base64_decode_ex(const unsigned char *str, int length, int *ret_length, zend_bool strict)
{
const unsigned char *current = str;
int ch, i = 0, j = 0, k;
@@ -145,16 +150,18 @@ PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, in
unsigned char *result;
result = (unsigned char *)emalloc(length + 1);
- if (result == NULL) {
- return NULL;
- }
/* run through the whole string, converting as we go */
while ((ch = *current++) != '\0' && length-- > 0) {
if (ch == base64_pad) break;
ch = base64_reverse_table[ch];
- if (ch < 0) continue;
+ if ((!strict && ch < 0) || ch == -1) { /* a space or some other separator character, we simply skip over */
+ continue;
+ } else if (ch == -2) {
+ efree(result);
+ return NULL;
+ }
switch(i % 4) {
case 0:
@@ -217,18 +224,19 @@ PHP_FUNCTION(base64_encode)
/* }}} */
-/* {{{ proto string base64_decode(string str)
+/* {{{ proto string base64_decode(string str[, bool strict])
Decodes string using MIME base64 algorithm */
PHP_FUNCTION(base64_decode)
{
char *str;
unsigned char *result;
+ zend_bool strict = 0;
int str_len, ret_length;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &str, &str_len, &strict) == FAILURE) {
return;
}
- result = php_base64_decode(str, str_len, &ret_length);
+ result = php_base64_decode_ex(str, str_len, &ret_length, strict);
if (result != NULL) {
RETVAL_STRINGL(result, ret_length, 0);
} else {
diff --git a/ext/standard/base64.h b/ext/standard/base64.h
index 6e1762593..a18c5e2f4 100644
--- a/ext/standard/base64.h
+++ b/ext/standard/base64.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: base64.h,v 1.14.2.1 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: base64.h,v 1.14.2.1.2.1 2006/05/06 22:47:14 iliaa Exp $ */
#ifndef BASE64_H
#define BASE64_H
@@ -25,6 +25,7 @@ PHP_FUNCTION(base64_decode);
PHP_FUNCTION(base64_encode);
PHPAPI extern unsigned char *php_base64_encode(const unsigned char *, int, int *);
+PHPAPI extern unsigned char *php_base64_decode_ex(const unsigned char *, int, int *, zend_bool);
PHPAPI extern unsigned char *php_base64_decode(const unsigned char *, int, int *);
#endif /* BASE64_H */
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 79adf1ca2..653119660 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.725.2.32 2006/06/28 22:08:59 iliaa Exp $ */
+/* $Id: basic_functions.c,v 1.725.2.31.2.28 2006/10/13 01:42:19 iliaa Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -78,6 +78,10 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
# include <sys/mman.h>
#endif
+#if HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+#endif
+
#ifdef HARTMUT_0
#include <getopt.h>
#endif
@@ -109,45 +113,6 @@ PHPAPI php_basic_globals basic_globals;
static zend_class_entry *incomplete_class_entry = NULL;
-static
- ZEND_BEGIN_ARG_INFO(first_and_second__args_force_ref, 0)
- ZEND_ARG_PASS_INFO(1)
- ZEND_ARG_PASS_INFO(1)
- ZEND_END_ARG_INFO()
-
-static
- ZEND_BEGIN_ARG_INFO(second_and_third_args_force_ref, 0)
- ZEND_ARG_PASS_INFO(0)
- ZEND_ARG_PASS_INFO(1)
- ZEND_ARG_PASS_INFO(1)
- ZEND_END_ARG_INFO()
-
-static
- ZEND_BEGIN_ARG_INFO(third_and_fourth_args_force_ref, 0)
- ZEND_ARG_PASS_INFO(0)
- ZEND_ARG_PASS_INFO(0)
- ZEND_ARG_PASS_INFO(1)
- ZEND_ARG_PASS_INFO(1)
- ZEND_END_ARG_INFO()
-
-static
- ZEND_BEGIN_ARG_INFO(third_and_rest_force_ref, 1)
- ZEND_ARG_PASS_INFO(0)
- ZEND_ARG_PASS_INFO(0)
- ZEND_ARG_PASS_INFO(1)
- ZEND_END_ARG_INFO()
-
-static
- ZEND_BEGIN_ARG_INFO(first_through_third_args_force_ref, 0)
- ZEND_ARG_PASS_INFO(1)
- ZEND_ARG_PASS_INFO(1)
- ZEND_ARG_PASS_INFO(1)
- ZEND_END_ARG_INFO()
-
-static
- ZEND_BEGIN_ARG_INFO(all_args_prefer_ref, ZEND_SEND_PREFER_REF)
- ZEND_END_ARG_INFO()
-
typedef struct _php_shutdown_function_entry {
zval **arguments;
int arg_count;
@@ -165,685 +130,3637 @@ static void user_tick_function_dtor(user_tick_function_entry *tick_function_entr
#undef sprintf
+/* {{{ 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(arginfo_stream_wrapper_register, 0)
+ ZEND_ARG_INFO(0, protocol)
+ ZEND_ARG_INFO(0, classname)
+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(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)
+ ZEND_ARG_INFO(0, length)
+ 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)
+ ZEND_ARG_INFO(0, length)
+ 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_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) */
+ ZEND_ARG_INFO(0, callback_data_compare_func)
+ 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) */
+ ZEND_ARG_INFO(0, callback_data_comp_func)
+ 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)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr2)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC)
+ 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) */
+ ZEND_ARG_INFO(0, arg2) /* ARRAY_INFO(0, arg2, 0) */
+ 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_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
+
+#ifdef HAVE_GETOPT
+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()
+#endif
+
+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)
+ ZEND_ARG_INFO(0, destination)
+ 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(arginfo_call_user_func_array, 0)
+ 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)
+ ZEND_ARG_INFO(0, parameter)
+ 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(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)
+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)
+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_END_ARG_INFO()
+
+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)
+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()
+
+/* }}} */
+/* {{{ 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)
+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)
+ ZEND_ARG_INFO(0, to)
+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)
+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)
+ ZEND_ARG_INFO(0, context)
+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)
+ ZEND_ARG_INFO(1, authns) /* ARRAY_INFO(1, authns, 1) */
+ ZEND_ARG_INFO(1, addtl) /* ARRAY_INFO(1, addtl, 1) */
+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) */
+ ZEND_ARG_INFO(1, weight) /* ARRAY_INFO(1, weight, 1) */
+ZEND_END_ARG_INFO()
+# endif
+#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)
+ ZEND_ARG_INFO(0, context)
+ ZEND_ARG_INFO(0, offset)
+ 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)
+ ZEND_ARG_INFO(0, flags)
+ 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)
+ ZEND_ARG_INFO(0, use_include_path)
+ 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)
+ ZEND_ARG_INFO(0, recursive)
+ 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) */
+ ZEND_ARG_INFO(0, delimiter)
+ 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)
+ ZEND_ARG_INFO(0, delimiter)
+ ZEND_ARG_INFO(0, enclosure)
+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)
+ ZEND_ARG_INFO(0, flags)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ 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)
+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)
+ ZEND_ARG_INFO(0, atime)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_clearstatcache, 0)
+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)
+ ZEND_ARG_INFO(0, arg1)
+ 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)
+ ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
+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)
+ ZEND_ARG_INFO(1, errno)
+ ZEND_ARG_INFO(1, errstr)
+ 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)
+ ZEND_ARG_INFO(1, errno)
+ ZEND_ARG_INFO(1, errstr)
+ ZEND_ARG_INFO(0, timeout)
+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)
+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()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_setcookie, 0, 0, 1)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_INFO(0, expires)
+ ZEND_ARG_INFO(0, path)
+ ZEND_ARG_INFO(0, domain)
+ 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)
+ ZEND_ARG_INFO(0, expires)
+ ZEND_ARG_INFO(0, path)
+ ZEND_ARG_INFO(0, domain)
+ 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)
+ ZEND_ARG_INFO(0, charset)
+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)
+ ZEND_ARG_INFO(0, charset)
+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)
+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)
+ ZEND_ARG_INFO(0, arg_separator)
+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()
+/* }}} */
+/* {{{ 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)
+ ZEND_ARG_INFO(0, cost_ins)
+ ZEND_ARG_INFO(0, cost_rep)
+ ZEND_ARG_INFO(0, cost_del)
+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)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ mail.c */
+#ifdef HAVE_SENDMAIL
+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)
+ ZEND_ARG_INFO(0, message)
+ ZEND_ARG_INFO(0, additional_headers)
+ ZEND_ARG_INFO(0, additional_parameters)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ 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_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()
+
+#ifdef HAVE_ASINH
+static
+ZEND_BEGIN_ARG_INFO(arginfo_asinh, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_ACOSH
+static
+ZEND_BEGIN_ARG_INFO(arginfo_acosh, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_ATANH
+static
+ZEND_BEGIN_ARG_INFO(arginfo_atanh, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+#endif
+
+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()
+
+#if !defined(PHP_WIN32) && !defined(NETWARE)
+static
+ZEND_BEGIN_ARG_INFO(arginfo_expm1, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+# ifdef HAVE_LOG1P
+static
+ZEND_BEGIN_ARG_INFO(arginfo_log1p, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+# endif
+#endif /* !defined(PHP_WIN32) && !defined(NETWARE) */
+
+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)
+ ZEND_ARG_INFO(0, dec_seperator)
+ 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)
+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) */
+ ZEND_ARG_INFO(1, pipes) /* ARRAY_INFO(1, pipes, 1) */
+ ZEND_ARG_INFO(0, cwd)
+ ZEND_ARG_INFO(0, env) /* ARRAY_INFO(0, env, 1) */
+ ZEND_ARG_INFO(0, other_options) /* ARRAY_INFO(0, other_options, 1) */
+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()
+/* }}} */
+/* {{{ 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()
+/* }}} */
+/* {{{ reg.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ereg, 0, 0, 2)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(1, registers) /* ARRAY_INFO(1, registers, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_eregi, 0, 0, 2)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(1, registers) /* ARRAY_INFO(1, registers, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ereg_replace, 0)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, replacement)
+ ZEND_ARG_INFO(0, string)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_eregi_replace, 0)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, replacement)
+ ZEND_ARG_INFO(0, string)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_split, 0, 0, 2)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(0, limit)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_spliti, 0, 0, 2)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(0, limit)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_sql_regcase, 0)
+ ZEND_ARG_INFO(0, string)
+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)
+ ZEND_ARG_INFO(0, protocol)
+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)
+ ZEND_ARG_INFO(1, errstring)
+ ZEND_ARG_INFO(0, timeout)
+ ZEND_ARG_INFO(0, flags)
+ 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)
+ ZEND_ARG_INFO(1, errstring)
+ ZEND_ARG_INFO(0, flags)
+ 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)
+ ZEND_ARG_INFO(0, flags)
+ 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)
+ ZEND_ARG_INFO(0, flags)
+ 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)
+ ZEND_ARG_INFO(0, maxlen)
+ 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_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) */
+ ZEND_ARG_INFO(1, except_streams) /* ARRAY_INFO(1, except_streams, 1) */
+ ZEND_ARG_INFO(0, tv_sec)
+ 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)
+ ZEND_ARG_INFO(0, optionname)
+ 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()
+
+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_EX(arginfo_stream_context_create, 0, 0, 0)
+ ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 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)
+ ZEND_ARG_INFO(0, read_write)
+ 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)
+ ZEND_ARG_INFO(0, read_write)
+ 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)
+ ZEND_ARG_INFO(0, microseconds)
+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)
+ ZEND_ARG_INFO(0, cryptokind)
+ ZEND_ARG_INFO(0, sessionstream)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ 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)
+ ZEND_ARG_INFO(0, start)
+ 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)
+ ZEND_ARG_INFO(0, start)
+ ZEND_ARG_INFO(0, len)
+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)
+ ZEND_ARG_INFO(0, break)
+ 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(arginfo_stristr, 0)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strstr, 0)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+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)
+ ZEND_ARG_INFO(0, start)
+ 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_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)
+ ZEND_ARG_INFO(0, subject)
+ 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)
+ ZEND_ARG_INFO(0, subject)
+ 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(arginfo_nl2br, 0)
+ ZEND_ARG_INFO(0, str)
+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()
+
+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)
+ ZEND_ARG_INFO(0, offset)
+ 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)
+ ZEND_ARG_INFO(0, pad_string)
+ 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)
+ ZEND_ARG_INFO(0, charlist)
+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)
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, length)
+ ZEND_ARG_INFO(0, case_sensitivity)
+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)
+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)
+ ZEND_ARG_INFO(1, callable_name)
+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)
+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()
+
+#if MEMORY_LIMIT
+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()
+#endif
+/* }}} */
+/* {{{ versioning.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_version_compare, 0, 0, 2)
+ ZEND_ARG_INFO(0, ver1)
+ ZEND_ARG_INFO(0, ver2)
+ ZEND_ARG_INFO(0, oper)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* }}} */
+
zend_function_entry basic_functions[] = {
- PHP_FE(constant, NULL)
- PHP_FE(bin2hex, NULL)
- PHP_FE(sleep, NULL)
- PHP_FE(usleep, NULL)
+ PHP_FE(constant, arginfo_constant)
+ PHP_FE(bin2hex, arginfo_bin2hex)
+ PHP_FE(sleep, arginfo_sleep)
+ PHP_FE(usleep, arginfo_usleep)
#if HAVE_NANOSLEEP
- PHP_FE(time_nanosleep, NULL)
- PHP_FE(time_sleep_until, NULL)
+ PHP_FE(time_nanosleep, arginfo_time_nanosleep)
+ PHP_FE(time_sleep_until, arginfo_time_sleep_until)
#endif
#if HAVE_STRPTIME
- PHP_FE(strptime, NULL)
-#endif
-
- PHP_FE(flush, NULL)
- PHP_FE(wordwrap, NULL)
- PHP_FE(htmlspecialchars, NULL)
- PHP_FE(htmlentities, NULL)
- PHP_FE(html_entity_decode, NULL)
- PHP_FE(htmlspecialchars_decode, NULL)
- PHP_FE(get_html_translation_table, NULL)
- PHP_FE(sha1, NULL)
- PHP_FE(sha1_file, NULL)
- PHP_NAMED_FE(md5,php_if_md5, NULL)
- PHP_NAMED_FE(md5_file,php_if_md5_file, NULL)
- PHP_NAMED_FE(crc32,php_if_crc32, NULL)
-
- PHP_FE(iptcparse, NULL)
- PHP_FE(iptcembed, NULL)
- PHP_FE(getimagesize, second_arg_force_ref)
- PHP_FE(image_type_to_mime_type, NULL)
-
- PHP_FE(phpinfo, NULL)
- PHP_FE(phpversion, NULL)
- PHP_FE(phpcredits, NULL)
- PHP_FE(php_logo_guid, NULL)
- PHP_FE(php_real_logo_guid, NULL)
- PHP_FE(php_egg_logo_guid, NULL)
- PHP_FE(zend_logo_guid, NULL)
- PHP_FE(php_sapi_name, NULL)
- PHP_FE(php_uname, NULL)
- PHP_FE(php_ini_scanned_files, NULL)
-
- PHP_FE(strnatcmp, NULL)
- PHP_FE(strnatcasecmp, NULL)
- PHP_FE(substr_count, NULL)
- PHP_FE(strspn, NULL)
- PHP_FE(strcspn, NULL)
- PHP_FE(strtok, NULL)
- PHP_FE(strtoupper, NULL)
- PHP_FE(strtolower, NULL)
- PHP_FE(strpos, NULL)
- PHP_FE(stripos, NULL)
- PHP_FE(strrpos, NULL)
- PHP_FE(strripos, NULL)
- PHP_FE(strrev, NULL)
- PHP_FE(hebrev, NULL)
- PHP_FE(hebrevc, NULL)
- PHP_FE(nl2br, NULL)
- PHP_FE(basename, NULL)
- PHP_FE(dirname, NULL)
- PHP_FE(pathinfo, NULL)
- PHP_FE(stripslashes, NULL)
- PHP_FE(stripcslashes, NULL)
- PHP_FE(strstr, NULL)
- PHP_FE(stristr, NULL)
- PHP_FE(strrchr, NULL)
- PHP_FE(str_shuffle, NULL)
- PHP_FE(str_word_count, NULL)
- PHP_FE(str_split, NULL)
- PHP_FE(strpbrk, NULL)
- PHP_FE(substr_compare, NULL)
+ PHP_FE(strptime, arginfo_strptime)
+#endif
+
+ PHP_FE(flush, arginfo_flush)
+ PHP_FE(wordwrap, arginfo_wordwrap)
+ PHP_FE(htmlspecialchars, arginfo_htmlspecialchars)
+ PHP_FE(htmlentities, arginfo_htmlentities)
+ PHP_FE(html_entity_decode, arginfo_html_entity_decode)
+ PHP_FE(htmlspecialchars_decode, arginfo_htmlspecialchars_decode)
+ PHP_FE(get_html_translation_table, arginfo_get_html_translation_table)
+ PHP_FE(sha1, arginfo_sha1)
+ PHP_FE(sha1_file, arginfo_sha1_file)
+ PHP_NAMED_FE(md5,php_if_md5, arginfo_md5)
+ PHP_NAMED_FE(md5_file,php_if_md5_file, arginfo_md5_file)
+ PHP_NAMED_FE(crc32,php_if_crc32, arginfo_crc32)
+
+ PHP_FE(iptcparse, arginfo_iptcparse)
+ PHP_FE(iptcembed, arginfo_iptcembed)
+ PHP_FE(getimagesize, arginfo_getimagesize)
+ PHP_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type)
+ PHP_FE(image_type_to_extension, arginfo_image_type_to_extension)
+
+ PHP_FE(phpinfo, arginfo_phpinfo)
+ PHP_FE(phpversion, arginfo_phpversion)
+ PHP_FE(phpcredits, arginfo_phpcredits)
+ PHP_FE(php_logo_guid, arginfo_php_logo_guid)
+ PHP_FE(php_real_logo_guid, arginfo_php_real_logo_guid)
+ PHP_FE(php_egg_logo_guid, arginfo_php_egg_logo_guid)
+ PHP_FE(zend_logo_guid, arginfo_zend_logo_guid)
+ PHP_FE(php_sapi_name, arginfo_php_sapi_name)
+ PHP_FE(php_uname, arginfo_php_uname)
+ PHP_FE(php_ini_scanned_files, arginfo_php_ini_scanned_files)
+
+ PHP_FE(strnatcmp, arginfo_strnatcmp)
+ PHP_FE(strnatcasecmp, arginfo_strnatcasecmp)
+ PHP_FE(substr_count, arginfo_substr_count)
+ PHP_FE(strspn, arginfo_strspn)
+ PHP_FE(strcspn, arginfo_strcspn)
+ PHP_FE(strtok, arginfo_strtok)
+ PHP_FE(strtoupper, arginfo_strtoupper)
+ PHP_FE(strtolower, arginfo_strtolower)
+ PHP_FE(strpos, arginfo_strpos)
+ PHP_FE(stripos, arginfo_stripos)
+ PHP_FE(strrpos, arginfo_strrpos)
+ PHP_FE(strripos, arginfo_strripos)
+ PHP_FE(strrev, arginfo_strrev)
+ PHP_FE(hebrev, arginfo_hebrev)
+ PHP_FE(hebrevc, arginfo_hebrevc)
+ PHP_FE(nl2br, arginfo_nl2br)
+ PHP_FE(basename, arginfo_basename)
+ PHP_FE(dirname, arginfo_dirname)
+ PHP_FE(pathinfo, arginfo_pathinfo)
+ PHP_FE(stripslashes, arginfo_stripslashes)
+ PHP_FE(stripcslashes, arginfo_stripcslashes)
+ PHP_FE(strstr, arginfo_strstr)
+ PHP_FE(stristr, arginfo_stristr)
+ PHP_FE(strrchr, arginfo_strrchr)
+ PHP_FE(str_shuffle, arginfo_str_shuffle)
+ PHP_FE(str_word_count, arginfo_str_word_count)
+ PHP_FE(str_split, arginfo_str_split)
+ PHP_FE(strpbrk, arginfo_strpbrk)
+ PHP_FE(substr_compare, arginfo_substr_compare)
#ifdef HAVE_STRCOLL
- PHP_FE(strcoll, NULL)
+ PHP_FE(strcoll, arginfo_strcoll)
#endif
#ifdef HAVE_STRFMON
- PHP_FE(money_format, NULL)
-#endif
-
- PHP_FE(substr, NULL)
- PHP_FE(substr_replace, NULL)
- PHP_FE(quotemeta, NULL)
- PHP_FE(ucfirst, NULL)
- PHP_FE(ucwords, NULL)
- PHP_FE(strtr, NULL)
- PHP_FE(addslashes, NULL)
- PHP_FE(addcslashes, NULL)
- PHP_FE(rtrim, NULL)
- PHP_FE(str_replace, fourth_arg_force_ref)
- PHP_FE(str_ireplace, fourth_arg_force_ref)
- PHP_FE(str_repeat, NULL)
- PHP_FE(count_chars, NULL)
- PHP_FE(chunk_split, NULL)
- PHP_FE(trim, NULL)
- PHP_FE(ltrim, NULL)
- PHP_FE(strip_tags, NULL)
- PHP_FE(similar_text, third_arg_force_ref)
- PHP_FE(explode, NULL)
- PHP_FE(implode, NULL)
- PHP_FE(setlocale, NULL)
- PHP_FE(localeconv, NULL)
+ PHP_FE(money_format, arginfo_money_format)
+#endif
+
+ PHP_FE(substr, arginfo_substr)
+ PHP_FE(substr_replace, arginfo_substr_replace)
+ PHP_FE(quotemeta, arginfo_quotemeta)
+ PHP_FE(ucfirst, arginfo_ucfirst)
+ PHP_FE(ucwords, arginfo_ucwords)
+ PHP_FE(strtr, arginfo_strtr)
+ PHP_FE(addslashes, arginfo_addslashes)
+ PHP_FE(addcslashes, arginfo_addcslashes)
+ PHP_FE(rtrim, arginfo_rtrim)
+ PHP_FE(str_replace, arginfo_str_replace)
+ PHP_FE(str_ireplace, arginfo_str_ireplace)
+ PHP_FE(str_repeat, arginfo_str_repeat)
+ PHP_FE(count_chars, arginfo_count_chars)
+ PHP_FE(chunk_split, arginfo_chunk_split)
+ PHP_FE(trim, arginfo_trim)
+ PHP_FE(ltrim, arginfo_ltrim)
+ PHP_FE(strip_tags, arginfo_strip_tags)
+ PHP_FE(similar_text, arginfo_similar_text)
+ PHP_FE(explode, arginfo_explode)
+ PHP_FE(implode, arginfo_implode)
+ PHP_FE(setlocale, arginfo_setlocale)
+ PHP_FE(localeconv, arginfo_localeconv)
#if HAVE_NL_LANGINFO
- PHP_FE(nl_langinfo, NULL)
-#endif
-
- PHP_FE(soundex, NULL)
- PHP_FE(levenshtein, NULL)
- PHP_FE(chr, NULL)
- PHP_FE(ord, NULL)
- PHP_FE(parse_str, second_arg_force_ref)
- PHP_FE(str_pad, NULL)
- PHP_FALIAS(chop, rtrim, NULL)
- PHP_FALIAS(strchr, strstr, NULL)
- PHP_NAMED_FE(sprintf, PHP_FN(user_sprintf), NULL)
- PHP_NAMED_FE(printf, PHP_FN(user_printf), NULL)
- PHP_FE(vprintf, NULL)
- PHP_FE(vsprintf, NULL)
- PHP_FE(fprintf, NULL)
- PHP_FE(vfprintf, NULL)
- PHP_FE(sscanf, third_and_rest_force_ref)
- PHP_FE(fscanf, third_and_rest_force_ref)
- PHP_FE(parse_url, NULL)
- PHP_FE(urlencode, NULL)
- PHP_FE(urldecode, NULL)
- PHP_FE(rawurlencode, NULL)
- PHP_FE(rawurldecode, NULL)
- PHP_FE(http_build_query, NULL)
+ PHP_FE(nl_langinfo, arginfo_nl_langinfo)
+#endif
+
+ PHP_FE(soundex, arginfo_soundex)
+ PHP_FE(levenshtein, arginfo_levenshtein)
+ PHP_FE(chr, arginfo_chr)
+ PHP_FE(ord, arginfo_ord)
+ PHP_FE(parse_str, arginfo_parse_str)
+ PHP_FE(str_pad, arginfo_str_pad)
+ PHP_FALIAS(chop, rtrim, arginfo_rtrim)
+ PHP_FALIAS(strchr, strstr, arginfo_strstr)
+ PHP_NAMED_FE(sprintf, PHP_FN(user_sprintf), arginfo_sprintf)
+ PHP_NAMED_FE(printf, PHP_FN(user_printf), arginfo_printf)
+ PHP_FE(vprintf, arginfo_vprintf)
+ PHP_FE(vsprintf, arginfo_vsprintf)
+ PHP_FE(fprintf, arginfo_fprintf)
+ PHP_FE(vfprintf, arginfo_vfprintf)
+ PHP_FE(sscanf, arginfo_sscanf)
+ PHP_FE(fscanf, arginfo_fscanf)
+ PHP_FE(parse_url, arginfo_parse_url)
+ PHP_FE(urlencode, arginfo_urlencode)
+ PHP_FE(urldecode, arginfo_urldecode)
+ PHP_FE(rawurlencode, arginfo_rawurlencode)
+ PHP_FE(rawurldecode, arginfo_rawurldecode)
+ PHP_FE(http_build_query, arginfo_http_build_query)
#ifdef HAVE_SYMLINK
- PHP_FE(readlink, NULL)
- PHP_FE(linkinfo, NULL)
- PHP_FE(symlink, NULL)
- PHP_FE(link, NULL)
-#endif
-
- PHP_FE(unlink, NULL)
- PHP_FE(exec, second_and_third_args_force_ref)
- PHP_FE(system, second_arg_force_ref)
- PHP_FE(escapeshellcmd, NULL)
- PHP_FE(escapeshellarg, NULL)
- PHP_FE(passthru, second_arg_force_ref)
- PHP_FE(shell_exec, NULL)
+ PHP_FE(readlink, arginfo_readlink)
+ PHP_FE(linkinfo, arginfo_linkinfo)
+ PHP_FE(symlink, arginfo_symlink)
+ PHP_FE(link, arginfo_link)
+#endif
+
+ PHP_FE(unlink, arginfo_unlink)
+ PHP_FE(exec, arginfo_exec)
+ PHP_FE(system, arginfo_system)
+ PHP_FE(escapeshellcmd, arginfo_escapeshellcmd)
+ PHP_FE(escapeshellarg, arginfo_escapeshellarg)
+ PHP_FE(passthru, arginfo_passthru)
+ PHP_FE(shell_exec, arginfo_shell_exec)
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
- PHP_FE(proc_open, third_arg_force_ref)
- PHP_FE(proc_close, NULL)
- PHP_FE(proc_terminate, NULL)
- PHP_FE(proc_get_status, NULL)
+ PHP_FE(proc_open, arginfo_proc_open)
+ PHP_FE(proc_close, arginfo_proc_close)
+ PHP_FE(proc_terminate, arginfo_proc_terminate)
+ PHP_FE(proc_get_status, arginfo_proc_get_status)
#endif
#ifdef HAVE_NICE
- PHP_FE(proc_nice, NULL)
+ PHP_FE(proc_nice, arginfo_proc_nice)
#endif
- PHP_FE(rand, NULL)
- PHP_FE(srand, NULL)
- PHP_FE(getrandmax, NULL)
- PHP_FE(mt_rand, NULL)
- PHP_FE(mt_srand, NULL)
- PHP_FE(mt_getrandmax, NULL)
+ PHP_FE(rand, arginfo_rand)
+ PHP_FE(srand, arginfo_srand)
+ PHP_FE(getrandmax, arginfo_getrandmax)
+ PHP_FE(mt_rand, arginfo_mt_rand)
+ PHP_FE(mt_srand, arginfo_mt_srand)
+ PHP_FE(mt_getrandmax, arginfo_mt_getrandmax)
#if HAVE_GETSERVBYNAME
- PHP_FE(getservbyname, NULL)
+ PHP_FE(getservbyname, arginfo_getservbyname)
#endif
#if HAVE_GETSERVBYPORT
- PHP_FE(getservbyport, NULL)
+ PHP_FE(getservbyport, arginfo_getservbyport)
#endif
#if HAVE_GETPROTOBYNAME
- PHP_FE(getprotobyname, NULL)
+ PHP_FE(getprotobyname, arginfo_getprotobyname)
#endif
#if HAVE_GETPROTOBYNUMBER
- PHP_FE(getprotobynumber, NULL)
-#endif
-
- PHP_FE(getmyuid, NULL)
- PHP_FE(getmygid, NULL)
- PHP_FE(getmypid, NULL)
- PHP_FE(getmyinode, NULL)
- PHP_FE(getlastmod, NULL)
-
- PHP_FE(base64_decode, NULL)
- PHP_FE(base64_encode, NULL)
-
- PHP_FE(convert_uuencode, NULL)
- PHP_FE(convert_uudecode, NULL)
-
- PHP_FE(abs, NULL)
- PHP_FE(ceil, NULL)
- PHP_FE(floor, NULL)
- PHP_FE(round, NULL)
- PHP_FE(sin, NULL)
- PHP_FE(cos, NULL)
- PHP_FE(tan, NULL)
- PHP_FE(asin, NULL)
- PHP_FE(acos, NULL)
- PHP_FE(atan, NULL)
- PHP_FE(atan2, NULL)
- PHP_FE(sinh, NULL)
- PHP_FE(cosh, NULL)
- PHP_FE(tanh, NULL)
+ PHP_FE(getprotobynumber, arginfo_getprotobynumber)
+#endif
+
+ PHP_FE(getmyuid, arginfo_getmyuid)
+ PHP_FE(getmygid, arginfo_getmygid)
+ PHP_FE(getmypid, arginfo_getmypid)
+ PHP_FE(getmyinode, arginfo_getmyinode)
+ PHP_FE(getlastmod, arginfo_getlastmod)
+
+ PHP_FE(base64_decode, arginfo_base64_decode)
+ PHP_FE(base64_encode, arginfo_base64_encode)
+
+ PHP_FE(convert_uuencode, arginfo_convert_uuencode)
+ PHP_FE(convert_uudecode, arginfo_convert_uudecode)
+
+ PHP_FE(abs, arginfo_abs)
+ PHP_FE(ceil, arginfo_ceil)
+ PHP_FE(floor, arginfo_floor)
+ PHP_FE(round, arginfo_round)
+ PHP_FE(sin, arginfo_sin)
+ PHP_FE(cos, arginfo_cos)
+ PHP_FE(tan, arginfo_tan)
+ PHP_FE(asin, arginfo_asin)
+ PHP_FE(acos, arginfo_acos)
+ PHP_FE(atan, arginfo_atan)
+ PHP_FE(atan2, arginfo_atan2)
+ PHP_FE(sinh, arginfo_sinh)
+ PHP_FE(cosh, arginfo_cosh)
+ PHP_FE(tanh, arginfo_tanh)
#ifdef HAVE_ASINH
- PHP_FE(asinh, NULL)
+ PHP_FE(asinh, arginfo_asinh)
#endif
#ifdef HAVE_ACOSH
- PHP_FE(acosh, NULL)
+ PHP_FE(acosh, arginfo_acosh)
#endif
#ifdef HAVE_ATANH
- PHP_FE(atanh, NULL)
+ PHP_FE(atanh, arginfo_atanh)
#endif
#if !defined(PHP_WIN32) && !defined(NETWARE)
- PHP_FE(expm1, NULL)
+ PHP_FE(expm1, arginfo_expm1)
# ifdef HAVE_LOG1P
- PHP_FE(log1p, NULL)
+ PHP_FE(log1p, arginfo_log1p)
# endif
#endif
- PHP_FE(pi, NULL)
- PHP_FE(is_finite, NULL)
- PHP_FE(is_nan, NULL)
- PHP_FE(is_infinite, NULL)
- PHP_FE(pow, NULL)
- PHP_FE(exp, NULL)
- PHP_FE(log, NULL)
- PHP_FE(log10, NULL)
- PHP_FE(sqrt, NULL)
- PHP_FE(hypot, NULL)
- PHP_FE(deg2rad, NULL)
- PHP_FE(rad2deg, NULL)
- PHP_FE(bindec, NULL)
- PHP_FE(hexdec, NULL)
- PHP_FE(octdec, NULL)
- PHP_FE(decbin, NULL)
- PHP_FE(decoct, NULL)
- PHP_FE(dechex, NULL)
- PHP_FE(base_convert, NULL)
- PHP_FE(number_format, NULL)
- PHP_FE(fmod, NULL)
+ PHP_FE(pi, arginfo_pi)
+ PHP_FE(is_finite, arginfo_is_finite)
+ PHP_FE(is_nan, arginfo_is_nan)
+ PHP_FE(is_infinite, arginfo_is_infinite)
+ PHP_FE(pow, arginfo_pow)
+ PHP_FE(exp, arginfo_exp)
+ PHP_FE(log, arginfo_log)
+ PHP_FE(log10, arginfo_log10)
+ PHP_FE(sqrt, arginfo_sqrt)
+ PHP_FE(hypot, arginfo_hypot)
+ PHP_FE(deg2rad, arginfo_deg2rad)
+ PHP_FE(rad2deg, arginfo_rad2deg)
+ PHP_FE(bindec, arginfo_bindec)
+ PHP_FE(hexdec, arginfo_hexdec)
+ PHP_FE(octdec, arginfo_octdec)
+ PHP_FE(decbin, arginfo_decbin)
+ PHP_FE(decoct, arginfo_decoct)
+ PHP_FE(dechex, arginfo_dechex)
+ PHP_FE(base_convert, arginfo_base_convert)
+ PHP_FE(number_format, arginfo_number_format)
+ PHP_FE(fmod, arginfo_fmod)
#ifdef HAVE_INET_NTOP
- PHP_NAMED_FE(inet_ntop, php_inet_ntop, NULL)
+ PHP_NAMED_FE(inet_ntop, php_inet_ntop, arginfo_inet_ntop)
#endif
#ifdef HAVE_INET_PTON
- PHP_NAMED_FE(inet_pton, php_inet_pton, NULL)
+ PHP_NAMED_FE(inet_pton, php_inet_pton, arginfo_inet_pton)
#endif
- PHP_FE(ip2long, NULL)
- PHP_FE(long2ip, NULL)
+ PHP_FE(ip2long, arginfo_ip2long)
+ PHP_FE(long2ip, arginfo_long2ip)
- PHP_FE(getenv, NULL)
+ PHP_FE(getenv, arginfo_getenv)
#ifdef HAVE_PUTENV
- PHP_FE(putenv, NULL)
+ PHP_FE(putenv, arginfo_putenv)
#endif
#ifdef HAVE_GETOPT
- PHP_FE(getopt, NULL)
+ PHP_FE(getopt, arginfo_getopt)
#endif
#ifdef HAVE_GETLOADAVG
- PHP_FE(sys_getloadavg, NULL)
+ PHP_FE(sys_getloadavg, arginfo_sys_getloadavg)
#endif
#ifdef HAVE_GETTIMEOFDAY
- PHP_FE(microtime, NULL)
- PHP_FE(gettimeofday, NULL)
+ PHP_FE(microtime, arginfo_microtime)
+ PHP_FE(gettimeofday, arginfo_gettimeofday)
#endif
#ifdef HAVE_GETRUSAGE
- PHP_FE(getrusage, NULL)
+ PHP_FE(getrusage, arginfo_getrusage)
#endif
#ifdef HAVE_GETTIMEOFDAY
- PHP_FE(uniqid, NULL)
-#endif
-
- PHP_FE(quoted_printable_decode, NULL)
- PHP_FE(convert_cyr_string, NULL)
- PHP_FE(get_current_user, NULL)
- PHP_FE(set_time_limit, NULL)
- PHP_FE(get_cfg_var, NULL)
- PHP_FALIAS(magic_quotes_runtime, set_magic_quotes_runtime, NULL)
- PHP_FE(set_magic_quotes_runtime, NULL)
- PHP_FE(get_magic_quotes_gpc, NULL)
- PHP_FE(get_magic_quotes_runtime, NULL)
-
- PHP_FE(import_request_variables, NULL)
- PHP_FE(error_log, NULL)
- PHP_FE(call_user_func, NULL)
- PHP_FE(call_user_func_array, NULL)
- PHP_FE(call_user_method, second_arg_force_ref)
- PHP_FE(call_user_method_array, second_arg_force_ref)
- PHP_FE(serialize, NULL)
- PHP_FE(unserialize, NULL)
-
- PHP_FE(var_dump, NULL)
- PHP_FE(var_export, NULL)
- PHP_FE(debug_zval_dump, NULL)
- PHP_FE(print_r, NULL)
+ PHP_FE(uniqid, arginfo_uniqid)
+#endif
+
+ PHP_FE(quoted_printable_decode, arginfo_quoted_printable_decode)
+ PHP_FE(convert_cyr_string, arginfo_convert_cyr_string)
+ PHP_FE(get_current_user, arginfo_get_current_user)
+ PHP_FE(set_time_limit, arginfo_set_time_limit)
+ PHP_FE(get_cfg_var, arginfo_get_cfg_var)
+ PHP_FALIAS(magic_quotes_runtime, set_magic_quotes_runtime, NULL)
+ PHP_FE(set_magic_quotes_runtime, NULL)
+ PHP_FE(get_magic_quotes_gpc, NULL)
+ PHP_FE(get_magic_quotes_runtime, NULL)
+
+ PHP_FE(import_request_variables, arginfo_import_request_variables)
+ PHP_FE(error_log, arginfo_error_log)
+ PHP_FE(error_get_last, arginfo_error_get_last)
+ PHP_FE(call_user_func, arginfo_call_user_func)
+ PHP_FE(call_user_func_array, arginfo_call_user_func_array)
+ PHP_DEP_FE(call_user_method, arginfo_call_user_method)
+ PHP_DEP_FE(call_user_method_array, arginfo_call_user_method_array)
+ PHP_FE(serialize, arginfo_serialize)
+ PHP_FE(unserialize, arginfo_unserialize)
+
+ PHP_FE(var_dump, arginfo_var_dump)
+ PHP_FE(var_export, arginfo_var_export)
+ PHP_FE(debug_zval_dump, arginfo_debug_zval_dump)
+ PHP_FE(print_r, arginfo_print_r)
#if MEMORY_LIMIT
- PHP_FE(memory_get_usage, NULL)
-#endif
-
- PHP_FE(register_shutdown_function, NULL)
- PHP_FE(register_tick_function, NULL)
- PHP_FE(unregister_tick_function, NULL)
-
- PHP_FE(highlight_file, NULL)
- PHP_FALIAS(show_source, highlight_file, NULL)
- PHP_FE(highlight_string, NULL)
- PHP_FE(php_strip_whitespace, NULL)
-
- PHP_FE(ini_get, NULL)
- PHP_FE(ini_get_all, NULL)
- PHP_FE(ini_set, NULL)
- PHP_FALIAS(ini_alter, ini_set, NULL)
- PHP_FE(ini_restore, NULL)
- PHP_FE(get_include_path, NULL)
- PHP_FE(set_include_path, NULL)
- PHP_FE(restore_include_path, NULL)
-
- PHP_FE(setcookie, NULL)
- PHP_FE(setrawcookie, NULL)
- PHP_FE(header, NULL)
- PHP_FE(headers_sent, first_and_second__args_force_ref)
- PHP_FE(headers_list, NULL)
-
- PHP_FE(connection_aborted, NULL)
- PHP_FE(connection_status, NULL)
- PHP_FE(ignore_user_abort, NULL)
- PHP_FE(parse_ini_file, NULL)
- PHP_FE(is_uploaded_file, NULL)
- PHP_FE(move_uploaded_file, NULL)
+ PHP_FE(memory_get_usage, arginfo_memory_get_usage)
+ PHP_FE(memory_get_peak_usage, arginfo_memory_get_peak_usage)
+#endif
+
+ PHP_FE(register_shutdown_function, arginfo_register_shutdown_function)
+ PHP_FE(register_tick_function, arginfo_register_tick_function)
+ PHP_FE(unregister_tick_function, arginfo_unregister_tick_function)
+
+ PHP_FE(highlight_file, arginfo_highlight_file)
+ PHP_FALIAS(show_source, highlight_file, arginfo_highlight_file)
+ PHP_FE(highlight_string, arginfo_highlight_string)
+ PHP_FE(php_strip_whitespace, arginfo_php_strip_whitespace)
+
+ PHP_FE(ini_get, arginfo_ini_get)
+ PHP_FE(ini_get_all, arginfo_ini_get_all)
+ PHP_FE(ini_set, arginfo_ini_set)
+ PHP_FALIAS(ini_alter, ini_set, arginfo_ini_set)
+ PHP_FE(ini_restore, arginfo_ini_restore)
+ PHP_FE(get_include_path, arginfo_get_include_path)
+ PHP_FE(set_include_path, arginfo_set_include_path)
+ PHP_FE(restore_include_path, arginfo_restore_include_path)
+
+ PHP_FE(setcookie, arginfo_setcookie)
+ PHP_FE(setrawcookie, arginfo_setrawcookie)
+ PHP_FE(header, arginfo_header)
+ PHP_FE(headers_sent, arginfo_headers_sent)
+ PHP_FE(headers_list, arginfo_headers_list)
+
+ PHP_FE(connection_aborted, arginfo_connection_aborted)
+ 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(is_uploaded_file, arginfo_is_uploaded_file)
+ PHP_FE(move_uploaded_file, arginfo_move_uploaded_file)
/* functions from dns.c */
- PHP_FE(gethostbyaddr, NULL)
- PHP_FE(gethostbyname, NULL)
- PHP_FE(gethostbynamel, NULL)
+ PHP_FE(gethostbyaddr, arginfo_gethostbyaddr)
+ PHP_FE(gethostbyname, arginfo_gethostbyname)
+ PHP_FE(gethostbynamel, arginfo_gethostbynamel)
#if HAVE_RES_SEARCH && !(defined(__BEOS__) || defined(PHP_WIN32) || defined(NETWARE))
- PHP_FE(dns_check_record, NULL)
- PHP_FALIAS(checkdnsrr, dns_check_record, NULL)
+ PHP_FE(dns_check_record, arginfo_dns_check_record)
+ PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record)
# if HAVE_DN_SKIPNAME && HAVE_DN_EXPAND
- PHP_FE(dns_get_mx, second_and_third_args_force_ref)
- PHP_FALIAS(getmxrr, dns_get_mx, second_and_third_args_force_ref)
+ PHP_FE(dns_get_mx, arginfo_dns_get_mx)
+ PHP_FALIAS(getmxrr, dns_get_mx, arginfo_dns_get_mx)
# endif
# if HAVE_DNS_FUNCS
- PHP_FE(dns_get_record, third_and_rest_force_ref)
+ PHP_FE(dns_get_record, arginfo_dns_get_record)
# endif
#endif
/* functions from type.c */
- PHP_FE(intval, NULL)
- PHP_FE(floatval, NULL)
- PHP_FALIAS(doubleval, floatval, NULL)
- PHP_FE(strval, NULL)
- PHP_FE(gettype, NULL)
- PHP_FE(settype, first_arg_force_ref)
- PHP_FE(is_null, NULL)
- PHP_FE(is_resource, NULL)
- PHP_FE(is_bool, NULL)
- PHP_FE(is_long, NULL)
- PHP_FE(is_float, NULL)
- PHP_FALIAS(is_int, is_long, NULL)
- PHP_FALIAS(is_integer, is_long, NULL)
- PHP_FALIAS(is_double, is_float, NULL)
- PHP_FALIAS(is_real, is_float, NULL)
- PHP_FE(is_numeric, NULL)
- PHP_FE(is_string, NULL)
- PHP_FE(is_array, NULL)
- PHP_FE(is_object, NULL)
- PHP_FE(is_scalar, NULL)
- PHP_FE(is_callable, third_arg_force_ref)
+ PHP_FE(intval, arginfo_intval)
+ PHP_FE(floatval, arginfo_floatval)
+ PHP_FALIAS(doubleval, floatval, arginfo_floatval)
+ PHP_FE(strval, arginfo_strval)
+ PHP_FE(gettype, arginfo_gettype)
+ PHP_FE(settype, arginfo_settype)
+ PHP_FE(is_null, arginfo_is_null)
+ PHP_FE(is_resource, arginfo_is_resource)
+ PHP_FE(is_bool, arginfo_is_bool)
+ PHP_FE(is_long, arginfo_is_long)
+ PHP_FE(is_float, arginfo_is_float)
+ PHP_FALIAS(is_int, is_long, arginfo_is_long)
+ PHP_FALIAS(is_integer, is_long, arginfo_is_long)
+ PHP_FALIAS(is_double, is_float, arginfo_is_float)
+ PHP_FALIAS(is_real, is_float, arginfo_is_float)
+ PHP_FE(is_numeric, arginfo_is_numeric)
+ PHP_FE(is_string, arginfo_is_string)
+ PHP_FE(is_array, arginfo_is_array)
+ PHP_FE(is_object, arginfo_is_object)
+ PHP_FE(is_scalar, arginfo_is_scalar)
+ PHP_FE(is_callable, arginfo_is_callable)
/* functions from reg.c */
- PHP_FE(ereg, third_arg_force_ref)
- PHP_FE(ereg_replace, NULL)
- PHP_FE(eregi, third_arg_force_ref)
- PHP_FE(eregi_replace, NULL)
- PHP_FE(split, NULL)
- PHP_FE(spliti, NULL)
- PHP_FALIAS(join, implode, NULL)
- PHP_FE(sql_regcase, NULL)
+ PHP_FE(ereg, arginfo_ereg)
+ PHP_FE(ereg_replace, arginfo_ereg_replace)
+ PHP_FE(eregi, arginfo_eregi)
+ PHP_FE(eregi_replace, arginfo_eregi_replace)
+ PHP_FE(split, arginfo_split)
+ PHP_FE(spliti, arginfo_spliti)
+ PHP_FALIAS(join, implode, arginfo_implode)
+ PHP_FE(sql_regcase, arginfo_sql_regcase)
/* functions from dl.c */
- PHP_FE(dl, NULL)
+ PHP_FE(dl, arginfo_dl)
/* functions from file.c */
- PHP_FE(pclose, NULL)
- PHP_FE(popen, NULL)
- PHP_FE(readfile, NULL)
- PHP_FE(rewind, NULL)
- PHP_FE(rmdir, NULL)
- PHP_FE(umask, NULL)
- PHP_FE(fclose, NULL)
- PHP_FE(feof, NULL)
- PHP_FE(fgetc, NULL)
- PHP_FE(fgets, NULL)
- PHP_FE(fgetss, NULL)
- PHP_FE(fread, NULL)
- PHP_NAMED_FE(fopen, php_if_fopen, NULL)
- PHP_FE(fpassthru, NULL)
- PHP_NAMED_FE(ftruncate, php_if_ftruncate, NULL)
- PHP_NAMED_FE(fstat, php_if_fstat, NULL)
- PHP_FE(fseek, NULL)
- PHP_FE(ftell, NULL)
- PHP_FE(fflush, NULL)
- PHP_FE(fwrite, NULL)
- PHP_FALIAS(fputs, fwrite, NULL)
- PHP_FE(mkdir, NULL)
- PHP_FE(rename, NULL)
- PHP_FE(copy, NULL)
- PHP_FE(tempnam, NULL)
- PHP_NAMED_FE(tmpfile, php_if_tmpfile, NULL)
- PHP_FE(file, NULL)
- PHP_FE(file_get_contents, NULL)
- PHP_FE(file_put_contents, NULL)
- PHP_FE(stream_select, first_through_third_args_force_ref)
- PHP_FE(stream_context_create, NULL)
- PHP_FE(stream_context_set_params, NULL)
- PHP_FE(stream_context_set_option, NULL)
- PHP_FE(stream_context_get_options, NULL)
- PHP_FE(stream_context_get_default, NULL)
- PHP_FE(stream_filter_prepend, NULL)
- PHP_FE(stream_filter_append, NULL)
- PHP_FE(stream_filter_remove, NULL)
- PHP_FE(stream_socket_client, second_and_third_args_force_ref)
- PHP_FE(stream_socket_server, second_and_third_args_force_ref)
- PHP_FE(stream_socket_accept, third_arg_force_ref)
- PHP_FE(stream_socket_get_name, NULL)
- PHP_FE(stream_socket_recvfrom, fourth_arg_force_ref)
- PHP_FE(stream_socket_sendto, NULL)
- PHP_FE(stream_socket_enable_crypto, NULL)
+ PHP_FE(pclose, arginfo_pclose)
+ PHP_FE(popen, arginfo_popen)
+ PHP_FE(readfile, arginfo_readfile)
+ PHP_FE(rewind, arginfo_rewind)
+ PHP_FE(rmdir, arginfo_rmdir)
+ PHP_FE(umask, arginfo_umask)
+ PHP_FE(fclose, arginfo_fclose)
+ PHP_FE(feof, arginfo_feof)
+ PHP_FE(fgetc, arginfo_fgetc)
+ PHP_FE(fgets, arginfo_fgets)
+ PHP_FE(fgetss, arginfo_fgetss)
+ PHP_FE(fread, arginfo_fread)
+ PHP_NAMED_FE(fopen, php_if_fopen, arginfo_fopen)
+ PHP_FE(fpassthru, arginfo_fpassthru)
+ PHP_NAMED_FE(ftruncate, php_if_ftruncate, arginfo_ftruncate)
+ PHP_NAMED_FE(fstat, php_if_fstat, arginfo_fstat)
+ PHP_FE(fseek, arginfo_fseek)
+ PHP_FE(ftell, arginfo_ftell)
+ PHP_FE(fflush, arginfo_fflush)
+ PHP_FE(fwrite, arginfo_fwrite)
+ PHP_FALIAS(fputs, fwrite, arginfo_fwrite)
+ PHP_FE(mkdir, arginfo_mkdir)
+ PHP_FE(rename, arginfo_rename)
+ PHP_FE(copy, arginfo_copy)
+ PHP_FE(tempnam, arginfo_tempnam)
+ PHP_NAMED_FE(tmpfile, php_if_tmpfile, arginfo_tmpfile)
+ PHP_FE(file, arginfo_file)
+ PHP_FE(file_get_contents, arginfo_file_get_contents)
+ PHP_FE(file_put_contents, arginfo_file_put_contents)
+ 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_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)
+ PHP_FE(stream_filter_prepend, arginfo_stream_filter_prepend)
+ PHP_FE(stream_filter_append, arginfo_stream_filter_append)
+ PHP_FE(stream_filter_remove, arginfo_stream_filter_remove)
+ PHP_FE(stream_socket_client, arginfo_stream_socket_client)
+ PHP_FE(stream_socket_server, arginfo_stream_socket_server)
+ PHP_FE(stream_socket_accept, arginfo_stream_socket_accept)
+ PHP_FE(stream_socket_get_name, arginfo_stream_socket_get_name)
+ PHP_FE(stream_socket_recvfrom, arginfo_stream_socket_recvfrom)
+ PHP_FE(stream_socket_sendto, arginfo_stream_socket_sendto)
+ PHP_FE(stream_socket_enable_crypto, arginfo_stream_socket_enable_crypto)
#if HAVE_SOCKETPAIR
- PHP_FE(stream_socket_pair, NULL)
-#endif
- PHP_FE(stream_copy_to_stream, NULL)
- PHP_FE(stream_get_contents, NULL)
- PHP_FE(fgetcsv, NULL)
- PHP_FE(fputcsv, NULL)
- PHP_FE(flock, third_arg_force_ref)
- PHP_FE(get_meta_tags, NULL)
- PHP_FE(stream_set_write_buffer, NULL)
- PHP_FALIAS(set_file_buffer, stream_set_write_buffer, NULL)
-
- PHP_FE(set_socket_blocking, NULL)
- PHP_FE(stream_set_blocking, NULL)
- PHP_FALIAS(socket_set_blocking, stream_set_blocking, NULL)
-
- PHP_FE(stream_get_meta_data, NULL)
- PHP_FE(stream_get_line, NULL)
- PHP_FE(stream_wrapper_register, NULL)
- PHP_FALIAS(stream_register_wrapper, stream_wrapper_register, NULL)
- PHP_FE(stream_wrapper_unregister, NULL)
- PHP_FE(stream_wrapper_restore, NULL)
- PHP_FE(stream_get_wrappers, NULL)
- PHP_FE(stream_get_transports, NULL)
- PHP_FE(get_headers, NULL)
+ PHP_FE(stream_socket_pair, arginfo_stream_socket_pair)
+#endif
+ PHP_FE(stream_copy_to_stream, arginfo_stream_copy_to_stream)
+ PHP_FE(stream_get_contents, arginfo_stream_get_contents)
+ PHP_FE(fgetcsv, arginfo_fgetcsv)
+ PHP_FE(fputcsv, arginfo_fputcsv)
+ PHP_FE(flock, arginfo_flock)
+ PHP_FE(get_meta_tags, arginfo_get_meta_tags)
+ PHP_FE(stream_set_write_buffer, arginfo_stream_set_write_buffer)
+ PHP_FALIAS(set_file_buffer, stream_set_write_buffer, arginfo_stream_set_write_buffer)
+
+ PHP_DEP_FALIAS(set_socket_blocking, stream_set_blocking, arginfo_stream_set_blocking)
+ PHP_FE(stream_set_blocking, arginfo_stream_set_blocking)
+ PHP_FALIAS(socket_set_blocking, stream_set_blocking, arginfo_stream_set_blocking)
+
+ PHP_FE(stream_get_meta_data, arginfo_stream_get_meta_data)
+ PHP_FE(stream_get_line, arginfo_stream_get_line)
+ PHP_FE(stream_wrapper_register, arginfo_stream_wrapper_register)
+ PHP_FALIAS(stream_register_wrapper, stream_wrapper_register, arginfo_stream_wrapper_register)
+ PHP_FE(stream_wrapper_unregister, arginfo_stream_wrapper_unregister)
+ PHP_FE(stream_wrapper_restore, arginfo_stream_wrapper_restore)
+ PHP_FE(stream_get_wrappers, arginfo_stream_get_wrappers)
+ PHP_FE(stream_get_transports, arginfo_stream_get_transports)
+ PHP_FE(get_headers, arginfo_get_headers)
#if HAVE_SYS_TIME_H || defined(PHP_WIN32)
- PHP_FE(stream_set_timeout, NULL)
- PHP_FALIAS(socket_set_timeout, stream_set_timeout, NULL)
+ PHP_FE(stream_set_timeout, arginfo_stream_set_timeout)
+ PHP_FALIAS(socket_set_timeout, stream_set_timeout, arginfo_stream_set_timeout)
#endif
- PHP_FALIAS(socket_get_status, stream_get_meta_data, NULL)
+ PHP_FALIAS(socket_get_status, stream_get_meta_data, arginfo_stream_get_meta_data)
#if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS)
- PHP_FE(realpath, NULL)
+ PHP_FE(realpath, arginfo_realpath)
#endif
#ifdef HAVE_FNMATCH
- PHP_FE(fnmatch, NULL)
+ PHP_FE(fnmatch, arginfo_fnmatch)
#endif
/* functions from fsock.c */
- PHP_FE(fsockopen, third_and_fourth_args_force_ref)
- PHP_FE(pfsockopen, third_and_fourth_args_force_ref)
+ PHP_FE(fsockopen, arginfo_fsockopen)
+ PHP_FE(pfsockopen, arginfo_pfsockopen)
/* functions from pack.c */
- PHP_FE(pack, NULL)
- PHP_FE(unpack, NULL)
+ PHP_FE(pack, arginfo_pack)
+ PHP_FE(unpack, arginfo_unpack)
/* functions from browscap.c */
- PHP_FE(get_browser, NULL)
+ PHP_FE(get_browser, arginfo_get_browser)
#if HAVE_CRYPT
/* functions from crypt.c */
- PHP_FE(crypt, NULL)
+ PHP_FE(crypt, arginfo_crypt)
#endif
/* functions from dir.c */
- PHP_FE(opendir, NULL)
- PHP_FE(closedir, NULL)
- PHP_FE(chdir, NULL)
+ PHP_FE(opendir, arginfo_opendir)
+ PHP_FE(closedir, arginfo_closedir)
+ PHP_FE(chdir, arginfo_chdir)
#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
- PHP_FE(chroot, NULL)
+ PHP_FE(chroot, arginfo_chroot)
#endif
- PHP_FE(getcwd, NULL)
- PHP_FE(rewinddir, NULL)
- PHP_NAMED_FE(readdir, php_if_readdir, NULL)
- PHP_FALIAS(dir, getdir, NULL)
- PHP_FE(scandir, NULL)
+ PHP_FE(getcwd, arginfo_getcwd)
+ PHP_FE(rewinddir, arginfo_rewinddir)
+ PHP_NAMED_FE(readdir, php_if_readdir, arginfo_readdir)
+ PHP_FALIAS(dir, getdir, arginfo_dir)
+ PHP_FE(scandir, arginfo_scandir)
#ifdef HAVE_GLOB
- PHP_FE(glob, NULL)
+ PHP_FE(glob, arginfo_glob)
#endif
/* functions from filestat.c */
- PHP_FE(fileatime, NULL)
- PHP_FE(filectime, NULL)
- PHP_FE(filegroup, NULL)
- PHP_FE(fileinode, NULL)
- PHP_FE(filemtime, NULL)
- PHP_FE(fileowner, NULL)
- PHP_FE(fileperms, NULL)
- PHP_FE(filesize, NULL)
- PHP_FE(filetype, NULL)
- PHP_FE(file_exists, NULL)
- PHP_FE(is_writable, NULL)
- PHP_FALIAS(is_writeable, is_writable, NULL)
- PHP_FE(is_readable, NULL)
- PHP_FE(is_executable, NULL)
- PHP_FE(is_file, NULL)
- PHP_FE(is_dir, NULL)
- PHP_FE(is_link, NULL)
- PHP_NAMED_FE(stat, php_if_stat, NULL)
- PHP_NAMED_FE(lstat, php_if_lstat, NULL)
+ PHP_FE(fileatime, arginfo_fileatime)
+ PHP_FE(filectime, arginfo_filectime)
+ PHP_FE(filegroup, arginfo_filegroup)
+ PHP_FE(fileinode, arginfo_fileinode)
+ PHP_FE(filemtime, arginfo_filemtime)
+ PHP_FE(fileowner, arginfo_fileowner)
+ PHP_FE(fileperms, arginfo_fileperms)
+ PHP_FE(filesize, arginfo_filesize)
+ PHP_FE(filetype, arginfo_filetype)
+ PHP_FE(file_exists, arginfo_file_exists)
+ PHP_FE(is_writable, arginfo_is_writable)
+ PHP_FALIAS(is_writeable, is_writable, arginfo_is_writable)
+ PHP_FE(is_readable, arginfo_is_readable)
+ PHP_FE(is_executable, arginfo_is_executable)
+ PHP_FE(is_file, arginfo_is_file)
+ PHP_FE(is_dir, arginfo_is_dir)
+ PHP_FE(is_link, arginfo_is_link)
+ PHP_NAMED_FE(stat, php_if_stat, arginfo_stat)
+ PHP_NAMED_FE(lstat, php_if_lstat, arginfo_lstat)
#ifndef NETWARE
- PHP_FE(chown, NULL)
- PHP_FE(chgrp, NULL)
+ PHP_FE(chown, arginfo_chown)
+ PHP_FE(chgrp, arginfo_chgrp)
#endif
#if HAVE_LCHOWN
- PHP_FE(lchown, NULL)
- PHP_FE(lchgrp, NULL)
+ PHP_FE(lchown, arginfo_lchown)
+ PHP_FE(lchgrp, arginfo_lchgrp)
#endif
- PHP_FE(chmod, NULL)
+ PHP_FE(chmod, arginfo_chmod)
#if HAVE_UTIME
- PHP_FE(touch, NULL)
+ PHP_FE(touch, arginfo_touch)
#endif
- PHP_FE(clearstatcache, NULL)
- PHP_FE(disk_total_space, NULL)
- PHP_FE(disk_free_space, NULL)
- PHP_FALIAS(diskfreespace, disk_free_space, NULL)
+ PHP_FE(clearstatcache, arginfo_clearstatcache)
+ PHP_FE(disk_total_space, arginfo_disk_total_space)
+ PHP_FE(disk_free_space, arginfo_disk_free_space)
+ PHP_FALIAS(diskfreespace, disk_free_space, arginfo_disk_free_space)
/* functions from mail.c */
#ifdef HAVE_SENDMAIL
- PHP_FE(mail, NULL)
- PHP_FE(ezmlm_hash, NULL)
+ PHP_FE(mail, arginfo_mail)
+ PHP_FE(ezmlm_hash, arginfo_ezmlm_hash)
#endif
/* functions from syslog.c */
#ifdef HAVE_SYSLOG_H
- PHP_FE(openlog, NULL)
- PHP_FE(syslog, NULL)
- PHP_FE(closelog, NULL)
- PHP_FE(define_syslog_variables, NULL)
+ PHP_FE(openlog, arginfo_openlog)
+ PHP_FE(syslog, arginfo_syslog)
+ PHP_FE(closelog, arginfo_closelog)
+ PHP_FE(define_syslog_variables, arginfo_define_syslog_variables)
#endif
/* functions from lcg.c */
- PHP_FE(lcg_value, NULL)
+ PHP_FE(lcg_value, arginfo_lcg_value)
/* functions from metaphone.c */
- PHP_FE(metaphone, NULL)
+ PHP_FE(metaphone, arginfo_metaphone)
/* functions from output.c */
- PHP_FE(ob_start, NULL)
- PHP_FE(ob_flush, NULL)
- PHP_FE(ob_clean, NULL)
- PHP_FE(ob_end_flush, NULL)
- PHP_FE(ob_end_clean, NULL)
- PHP_FE(ob_get_flush, NULL)
- PHP_FE(ob_get_clean, NULL)
- PHP_FE(ob_get_length, NULL)
- PHP_FE(ob_get_level, NULL)
- PHP_FE(ob_get_status, NULL)
- PHP_FE(ob_get_contents, NULL)
- PHP_FE(ob_implicit_flush, NULL)
- PHP_FE(ob_list_handlers, NULL)
+ PHP_FE(ob_start, arginfo_ob_start)
+ PHP_FE(ob_flush, arginfo_ob_flush)
+ PHP_FE(ob_clean, arginfo_ob_clean)
+ PHP_FE(ob_end_flush, arginfo_ob_end_flush)
+ PHP_FE(ob_end_clean, arginfo_ob_end_clean)
+ PHP_FE(ob_get_flush, arginfo_ob_get_flush)
+ PHP_FE(ob_get_clean, arginfo_ob_get_clean)
+ PHP_FE(ob_get_length, arginfo_ob_get_length)
+ PHP_FE(ob_get_level, arginfo_ob_get_level)
+ PHP_FE(ob_get_status, arginfo_ob_get_status)
+ PHP_FE(ob_get_contents, arginfo_ob_get_contents)
+ PHP_FE(ob_implicit_flush, arginfo_ob_implicit_flush)
+ PHP_FE(ob_list_handlers, arginfo_ob_list_handlers)
/* functions from array.c */
- PHP_FE(ksort, first_arg_force_ref)
- PHP_FE(krsort, first_arg_force_ref)
- PHP_FE(natsort, first_arg_force_ref)
- PHP_FE(natcasesort, first_arg_force_ref)
- PHP_FE(asort, first_arg_force_ref)
- PHP_FE(arsort, first_arg_force_ref)
- PHP_FE(sort, first_arg_force_ref)
- PHP_FE(rsort, first_arg_force_ref)
- PHP_FE(usort, first_arg_force_ref)
- PHP_FE(uasort, first_arg_force_ref)
- PHP_FE(uksort, first_arg_force_ref)
- PHP_FE(shuffle, first_arg_force_ref)
- PHP_FE(array_walk, first_arg_force_ref)
- PHP_FE(array_walk_recursive, first_arg_force_ref)
- PHP_FE(count, NULL)
- PHP_FE(end, first_arg_force_ref)
- PHP_FE(prev, first_arg_force_ref)
- PHP_FE(next, first_arg_force_ref)
- PHP_FE(reset, first_arg_force_ref)
- PHP_FE(current, all_args_prefer_ref)
- PHP_FE(key, all_args_prefer_ref)
- PHP_FE(min, NULL)
- PHP_FE(max, NULL)
- PHP_FE(in_array, NULL)
- PHP_FE(array_search, NULL)
- PHP_FE(extract, NULL)
- PHP_FE(compact, NULL)
- PHP_FE(array_fill, NULL)
- PHP_FE(range, NULL)
- PHP_FE(array_multisort, all_args_prefer_ref)
- PHP_FE(array_push, first_arg_force_ref)
- PHP_FE(array_pop, first_arg_force_ref)
- PHP_FE(array_shift, first_arg_force_ref)
- PHP_FE(array_unshift, first_arg_force_ref)
- PHP_FE(array_splice, first_arg_force_ref)
- PHP_FE(array_slice, NULL)
- PHP_FE(array_merge, NULL)
- PHP_FE(array_merge_recursive, NULL)
- PHP_FE(array_keys, NULL)
- PHP_FE(array_values, NULL)
- PHP_FE(array_count_values, NULL)
- PHP_FE(array_reverse, NULL)
- PHP_FE(array_reduce, NULL)
- PHP_FE(array_pad, NULL)
- PHP_FE(array_flip, NULL)
- PHP_FE(array_change_key_case, NULL)
- PHP_FE(array_rand, NULL)
- PHP_FE(array_unique, NULL)
- PHP_FE(array_intersect, NULL)
- PHP_FE(array_intersect_key, NULL)
- PHP_FE(array_intersect_ukey, NULL)
- PHP_FE(array_uintersect, NULL)
- PHP_FE(array_intersect_assoc, NULL)
- PHP_FE(array_uintersect_assoc, NULL)
- PHP_FE(array_intersect_uassoc, NULL)
- PHP_FE(array_uintersect_uassoc, NULL)
- PHP_FE(array_diff, NULL)
- PHP_FE(array_diff_key, NULL)
- PHP_FE(array_diff_ukey, NULL)
- PHP_FE(array_udiff, NULL)
- PHP_FE(array_diff_assoc, NULL)
- PHP_FE(array_udiff_assoc, NULL)
- PHP_FE(array_diff_uassoc, NULL)
- PHP_FE(array_udiff_uassoc, NULL)
- PHP_FE(array_sum, NULL)
- PHP_FE(array_product, NULL)
- PHP_FE(array_filter, NULL)
- PHP_FE(array_map, NULL)
- PHP_FE(array_chunk, NULL)
- PHP_FE(array_combine, NULL)
- PHP_FE(array_key_exists, NULL)
+ PHP_FE(ksort, arginfo_ksort)
+ PHP_FE(krsort, arginfo_krsort)
+ PHP_FE(natsort, arginfo_natsort)
+ PHP_FE(natcasesort, arginfo_natcasesort)
+ PHP_FE(asort, arginfo_asort)
+ PHP_FE(arsort, arginfo_arsort)
+ PHP_FE(sort, arginfo_sort)
+ PHP_FE(rsort, arginfo_rsort)
+ PHP_FE(usort, arginfo_usort)
+ PHP_FE(uasort, arginfo_uasort)
+ PHP_FE(uksort, arginfo_uksort)
+ PHP_FE(shuffle, arginfo_shuffle)
+ PHP_FE(array_walk, arginfo_array_walk)
+ PHP_FE(array_walk_recursive, arginfo_array_walk_recursive)
+ PHP_FE(count, arginfo_count)
+ PHP_FE(end, arginfo_end)
+ PHP_FE(prev, arginfo_prev)
+ PHP_FE(next, arginfo_next)
+ PHP_FE(reset, arginfo_reset)
+ PHP_FE(current, arginfo_current)
+ PHP_FE(key, arginfo_key)
+ PHP_FE(min, arginfo_min)
+ PHP_FE(max, arginfo_max)
+ PHP_FE(in_array, arginfo_in_array)
+ PHP_FE(array_search, arginfo_array_search)
+ PHP_FE(extract, arginfo_extract)
+ PHP_FE(compact, arginfo_compact)
+ PHP_FE(array_fill, arginfo_array_fill)
+ PHP_FE(array_fill_keys, arginfo_array_fill_keys)
+ PHP_FE(range, arginfo_range)
+ PHP_FE(array_multisort, arginfo_array_multisort)
+ PHP_FE(array_push, arginfo_array_push)
+ PHP_FE(array_pop, arginfo_array_pop)
+ PHP_FE(array_shift, arginfo_array_shift)
+ PHP_FE(array_unshift, arginfo_array_unshift)
+ PHP_FE(array_splice, arginfo_array_splice)
+ PHP_FE(array_slice, arginfo_array_slice)
+ PHP_FE(array_merge, arginfo_array_merge)
+ PHP_FE(array_merge_recursive, arginfo_array_merge_recursive)
+ PHP_FE(array_keys, arginfo_array_keys)
+ PHP_FE(array_values, arginfo_array_values)
+ PHP_FE(array_count_values, arginfo_array_count_values)
+ PHP_FE(array_reverse, arginfo_array_reverse)
+ PHP_FE(array_reduce, arginfo_array_reduce)
+ PHP_FE(array_pad, arginfo_array_pad)
+ PHP_FE(array_flip, arginfo_array_flip)
+ PHP_FE(array_change_key_case, arginfo_array_change_key_case)
+ PHP_FE(array_rand, arginfo_array_rand)
+ PHP_FE(array_unique, arginfo_array_unique)
+ PHP_FE(array_intersect, arginfo_array_intersect)
+ PHP_FE(array_intersect_key, arginfo_array_intersect_key)
+ PHP_FE(array_intersect_ukey, arginfo_array_intersect_ukey)
+ PHP_FE(array_uintersect, arginfo_array_uintersect)
+ PHP_FE(array_intersect_assoc, arginfo_array_intersect_assoc)
+ PHP_FE(array_uintersect_assoc, arginfo_array_uintersect_assoc)
+ PHP_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc)
+ PHP_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc)
+ PHP_FE(array_diff, arginfo_array_diff)
+ PHP_FE(array_diff_key, arginfo_array_diff_key)
+ PHP_FE(array_diff_ukey, arginfo_array_diff_ukey)
+ PHP_FE(array_udiff, arginfo_array_udiff)
+ PHP_FE(array_diff_assoc, arginfo_array_diff_assoc)
+ PHP_FE(array_udiff_assoc, arginfo_array_udiff_assoc)
+ PHP_FE(array_diff_uassoc, arginfo_array_diff_uassoc)
+ PHP_FE(array_udiff_uassoc, arginfo_array_udiff_uassoc)
+ PHP_FE(array_sum, arginfo_array_sum)
+ PHP_FE(array_product, arginfo_array_product)
+ PHP_FE(array_filter, arginfo_array_filter)
+ PHP_FE(array_map, arginfo_array_map)
+ PHP_FE(array_chunk, arginfo_array_chunk)
+ PHP_FE(array_combine, arginfo_array_combine)
+ PHP_FE(array_key_exists, arginfo_array_key_exists)
/* aliases from array.c */
- PHP_FALIAS(pos, current, first_arg_force_ref)
- PHP_FALIAS(sizeof, count, NULL)
- PHP_FALIAS(key_exists, array_key_exists, NULL)
+ PHP_FALIAS(pos, current, arginfo_current)
+ PHP_FALIAS(sizeof, count, arginfo_count)
+ PHP_FALIAS(key_exists, array_key_exists, arginfo_array_key_exists)
/* functions from assert.c */
- PHP_FE(assert, NULL)
- PHP_FE(assert_options, NULL)
+ PHP_FE(assert, arginfo_assert)
+ PHP_FE(assert_options, arginfo_assert_options)
/* functions from versioning.c */
- PHP_FE(version_compare, NULL)
+ PHP_FE(version_compare, arginfo_version_compare)
/* functions from ftok.c*/
#if HAVE_FTOK
- PHP_FE(ftok, NULL)
+ PHP_FE(ftok, arginfo_ftok)
#endif
- PHP_FE(str_rot13, NULL)
- PHP_FE(stream_get_filters, NULL)
- PHP_FE(stream_filter_register, NULL)
- PHP_FE(stream_bucket_make_writeable, NULL)
- PHP_FE(stream_bucket_prepend, NULL)
- PHP_FE(stream_bucket_append, NULL)
- PHP_FE(stream_bucket_new, NULL)
+ PHP_FE(str_rot13, arginfo_str_rot13)
+ PHP_FE(stream_get_filters, arginfo_stream_get_filters)
+ PHP_FE(stream_filter_register, arginfo_stream_filter_register)
+ PHP_FE(stream_bucket_make_writeable, arginfo_stream_bucket_make_writeable)
+ PHP_FE(stream_bucket_prepend, arginfo_stream_bucket_prepend)
+ PHP_FE(stream_bucket_append, arginfo_stream_bucket_append)
+ PHP_FE(stream_bucket_new, arginfo_stream_bucket_new)
- PHP_FE(output_add_rewrite_var, NULL)
- PHP_FE(output_reset_rewrite_vars, NULL)
+ PHP_FE(output_add_rewrite_var, arginfo_output_add_rewrite_var)
+ PHP_FE(output_reset_rewrite_vars, arginfo_output_reset_rewrite_vars)
{NULL, NULL, NULL}
};
@@ -883,9 +3800,15 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY_EX("safe_mode_allowed_env_vars", SAFE_MODE_ALLOWED_ENV_VARS, PHP_INI_SYSTEM, OnUpdateSafeModeAllowedEnvVars, NULL)
PHP_INI_END()
+static zend_module_dep standard_deps[] = {
+ ZEND_MOD_OPTIONAL("session")
+ {NULL, NULL, NULL}
+};
zend_module_entry basic_functions_module = {
- STANDARD_MODULE_HEADER,
+ STANDARD_MODULE_HEADER_EX,
+ NULL,
+ standard_deps,
"standard", /* extension name */
basic_functions, /* function list */
PHP_MINIT(basic), /* process startup */
@@ -944,6 +3867,7 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC)
{
BG(rand_is_seeded) = 0;
BG(mt_rand_is_seeded) = 0;
+ BG(umask) = -1;
BG(next) = NULL;
BG(left) = -1;
@@ -1056,9 +3980,13 @@ PHP_MINIT_FUNCTION(basic)
REGISTER_MATH_CONSTANT(M_PI_4);
REGISTER_MATH_CONSTANT(M_1_PI);
REGISTER_MATH_CONSTANT(M_2_PI);
+ REGISTER_MATH_CONSTANT(M_SQRTPI);
REGISTER_MATH_CONSTANT(M_2_SQRTPI);
+ REGISTER_MATH_CONSTANT(M_LNPI);
+ REGISTER_MATH_CONSTANT(M_EULER);
REGISTER_MATH_CONSTANT(M_SQRT2);
REGISTER_MATH_CONSTANT(M_SQRT1_2);
+ REGISTER_MATH_CONSTANT(M_SQRT3);
REGISTER_DOUBLE_CONSTANT("INF", php_get_inf(), CONST_CS | CONST_PERSISTENT);
REGISTER_DOUBLE_CONSTANT("NAN", php_get_nan(), CONST_CS | CONST_PERSISTENT);
@@ -1109,6 +4037,7 @@ PHP_MINIT_FUNCTION(basic)
php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC);
php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper TSRMLS_CC);
#ifndef PHP_CURL_URL_WRAPPERS
php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC);
php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC);
@@ -1216,6 +4145,10 @@ PHP_RSHUTDOWN_FUNCTION(basic)
zend_hash_destroy(&BG(putenv_ht));
#endif
+ if (BG(umask) != -1) {
+ umask(BG(umask));
+ }
+
/* Check if locale was changed and change it back
to the value in startup environment */
if (BG(locale_string) != NULL) {
@@ -1223,6 +4156,7 @@ PHP_RSHUTDOWN_FUNCTION(basic)
setlocale(LC_CTYPE, "");
}
STR_FREE(BG(locale_string));
+ BG(locale_string) = NULL;
/*
FG(stream_wrappers) and FG(stream_filters) are destroyed
@@ -1419,12 +4353,9 @@ PHP_FUNCTION(getenv)
RETURN_FALSE;
}
ptr = sapi_getenv(str, str_len TSRMLS_CC);
- if (! ptr) {
- ptr = getenv(str);
- }
- if (ptr) {
- RETURN_STRING(ptr, 1);
- }
+ if(ptr) RETURN_STRING(ptr, 0);
+ ptr = getenv(str);
+ if(ptr) RETURN_STRING(ptr, 1);
RETURN_FALSE;
}
/* }}} */
@@ -2048,6 +4979,23 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T
return SUCCESS;
}
+/* {{{ proto array error_get_last()
+ Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet. */
+PHP_FUNCTION(error_get_last)
+{
+ if (ZEND_NUM_ARGS()) {
+ WRONG_PARAM_COUNT;
+ }
+ if (PG(last_error_message)) {
+ array_init(return_value);
+ add_assoc_long_ex(return_value, "type", sizeof("type"), PG(last_error_type));
+ add_assoc_string_ex(return_value, "message", sizeof("message"), PG(last_error_message), 1);
+ add_assoc_string_ex(return_value, "file", sizeof("file"), PG(last_error_file)?PG(last_error_file):"-", 1 );
+ add_assoc_long_ex(return_value, "line", sizeof("line"), PG(last_error_lineno));
+ }
+}
+/* }}} */
+
/* {{{ proto mixed call_user_func(string function_name [, mixed parmeter] [, mixed ...])
Call a user function which is the first parameter */
PHP_FUNCTION(call_user_func)
@@ -2170,8 +5118,6 @@ PHP_FUNCTION(call_user_func_array)
}
/* }}} */
-#define _CUM_DEPREC "This function is deprecated, use the call_user_func variety with the array(&$obj, \"method\") syntax instead"
-
/* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...])
Call a user method on a specific object or class */
PHP_FUNCTION(call_user_method)
@@ -2180,8 +5126,6 @@ PHP_FUNCTION(call_user_method)
zval *retval_ptr;
int arg_count = ZEND_NUM_ARGS();
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", _CUM_DEPREC);
-
if (arg_count < 2) {
WRONG_PARAM_COUNT;
}
@@ -2217,8 +5161,6 @@ PHP_FUNCTION(call_user_method_array)
HashTable *params_ar;
int num_elems, element = 0;
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", _CUM_DEPREC);
-
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &method_name, &obj, &params) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -2282,18 +5224,20 @@ static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_fun
if (!zend_is_callable(shutdown_function_entry->arguments[0], 0, &function_name)) {
php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name);
- } else if (call_user_function(EG(function_table), NULL,
- shutdown_function_entry->arguments[0],
- &retval,
- shutdown_function_entry->arg_count - 1,
- shutdown_function_entry->arguments + 1
- TSRMLS_CC ) == SUCCESS)
+ efree(function_name);
+ return 0;
+ }
+ efree(function_name);
+
+ if (call_user_function(EG(function_table), NULL,
+ shutdown_function_entry->arguments[0],
+ &retval,
+ shutdown_function_entry->arg_count - 1,
+ shutdown_function_entry->arguments + 1
+ TSRMLS_CC ) == SUCCESS)
{
zval_dtor(&retval);
}
- if (function_name) {
- efree(function_name);
- }
return 0;
}
@@ -2360,13 +5304,13 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_
void php_call_shutdown_functions(TSRMLS_D)
{
- if (BG(user_shutdown_function_names))
+ if (BG(user_shutdown_function_names)) {
zend_try {
zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t) user_shutdown_function_call TSRMLS_CC);
- memcpy(&EG(bailout), &orig_bailout, sizeof(jmp_buf));
- php_free_shutdown_functions(TSRMLS_C);
}
zend_end_try();
+ php_free_shutdown_functions(TSRMLS_C);
+ }
}
void php_free_shutdown_functions(TSRMLS_D)
@@ -2437,20 +5381,20 @@ ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highl
Syntax highlight a source file */
PHP_FUNCTION(highlight_file)
{
- zval *filename;
+ char *filename;
+ int filename_len;
zend_syntax_highlighter_ini syntax_highlighter_ini;
zend_bool i = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &filename, &i) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &filename, &filename_len, &i) == FAILURE) {
RETURN_FALSE;
}
- convert_to_string(filename);
- if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_P(filename), NULL, CHECKUID_ALLOW_ONLY_FILE))) {
+ if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
RETURN_FALSE;
}
- if (php_check_open_basedir(Z_STRVAL_P(filename) TSRMLS_CC)) {
+ if (php_check_open_basedir(filename TSRMLS_CC)) {
RETURN_FALSE;
}
@@ -2460,7 +5404,7 @@ PHP_FUNCTION(highlight_file)
php_get_highlight_struct(&syntax_highlighter_ini);
- if (highlight_file(Z_STRVAL_P(filename), &syntax_highlighter_ini TSRMLS_CC) == FAILURE) {
+ if (highlight_file(filename, &syntax_highlighter_ini TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
@@ -2513,16 +5457,16 @@ PHP_FUNCTION(php_strip_whitespace)
Syntax highlight a string or optionally return it */
PHP_FUNCTION(highlight_string)
{
- zval *expr;
+ zval **expr;
zend_syntax_highlighter_ini syntax_highlighter_ini;
char *hicompiled_string_description;
zend_bool i = 0;
int old_error_reporting = EG(error_reporting);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &expr, &i) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|b", &expr, &i) == FAILURE) {
RETURN_FALSE;
}
- convert_to_string(expr);
+ convert_to_string_ex(expr);
if (i) {
php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
@@ -2534,7 +5478,7 @@ PHP_FUNCTION(highlight_string)
hicompiled_string_description = zend_make_compiled_string_description("highlighted code" TSRMLS_CC);
- if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) {
+ if (highlight_string(*expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) {
efree(hicompiled_string_description);
RETURN_FALSE;
}
@@ -2678,7 +5622,6 @@ PHP_FUNCTION(ini_set)
_CHECK_PATH(varname, "java.class.path") ||
_CHECK_PATH(varname, "java.home") ||
_CHECK_PATH(varname, "java.library.path") ||
- _CHECK_PATH(varname, "session.save_path") ||
_CHECK_PATH(varname, "vpopmail.directory")) {
if (PG(safe_mode) &&(!php_checkuid(Z_STRVAL_PP(new_value), NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
zval_dtor(return_value);
@@ -3089,8 +6032,7 @@ PHP_FUNCTION(move_uploaded_file)
VCWD_UNLINK(Z_STRVAL_PP(new_path));
if (rename(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path)) == 0) {
successful = 1;
- } else
- if (php_copy_file(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path) TSRMLS_CC) == SUCCESS) {
+ } else if (php_copy_file_ex(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path), STREAM_DISABLE_OPEN_BASEDIR TSRMLS_CC) == SUCCESS) {
VCWD_UNLINK(Z_STRVAL_PP(path));
successful = 1;
}
@@ -3352,6 +6294,8 @@ PHP_FUNCTION(import_request_variables)
/* }}} */
#ifdef HAVE_GETLOADAVG
+/* {{{ proto array sys_getloadavg()
+ */
PHP_FUNCTION(sys_getloadavg)
{
double load[3];
@@ -3365,6 +6309,7 @@ PHP_FUNCTION(sys_getloadavg)
add_index_double(return_value, 2, load[2]);
}
}
+/* }}} */
#endif
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 9f0bf7c93..df1401ae9 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.h,v 1.139.2.4 2006/02/18 05:41:59 rasmus Exp $ */
+/* $Id: basic_functions.h,v 1.139.2.4.2.2 2006/07/19 12:25:46 mike Exp $ */
#ifndef BASIC_FUNCTIONS_H
#define BASIC_FUNCTIONS_H
@@ -79,6 +79,7 @@ PHP_FUNCTION(get_magic_quotes_gpc);
PHP_FUNCTION(import_request_variables);
PHP_FUNCTION(error_log);
+PHP_FUNCTION(error_get_last);
PHP_FUNCTION(call_user_func);
PHP_FUNCTION(call_user_func_array);
@@ -215,6 +216,8 @@ typedef struct _php_basic_globals {
#if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
mbstate_t mblen_state;
#endif
+
+ int umask;
} php_basic_globals;
#ifdef ZTS
diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
index 28b079d0b..42e809ca9 100644
--- a/ext/standard/config.m4
+++ b/ext/standard/config.m4
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.80.2.3 2006/01/04 21:31:29 derick Exp $ -*- autoconf -*-
+dnl $Id: config.m4,v 1.80.2.3.2.1 2006/08/24 11:06:02 tony2001 Exp $ -*- autoconf -*-
divert(3)dnl
@@ -477,6 +477,26 @@ if test "$ac_cv_huge_val_nan" = "yes"; then
AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL == NAN])
fi
+AC_CACHE_CHECK(whether strptime() declaration fails, ac_cv_strptime_decl_fails,[
+ AC_TRY_COMPILE([
+#include <time.h>
+ ],[
+#ifndef HAVE_STRPTIME
+#error no strptime() on this platform
+#else
+/* use invalid strptime() declaration to see if it fails to compile */
+int strptime(const char *s, const char *format, struct tm *tm);
+#endif
+ ],[
+ ac_cv_strptime_decl_fails=no
+ ],[
+ ac_cv_strptime_decl_fails=yes
+ ])
+])
+if test "$ac_cv_strptime_decl_fails" = "yes"; then
+ AC_DEFINE([HAVE_STRPTIME_DECL_FAILS], 1, [whether strptime() declaration fails])
+fi
+
PHP_CHECK_I18N_FUNCS
PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \
diff --git a/ext/standard/credits.c b/ext/standard/credits.c
index 2cf356ea9..0d689ac4b 100644
--- a/ext/standard/credits.c
+++ b/ext/standard/credits.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: credits.c,v 1.36.2.4 2006/03/23 18:36:46 iliaa Exp $ */
+/* $Id: credits.c,v 1.36.2.4.2.1 2006/09/03 11:27:50 johannes Exp $ */
#include "php.h"
#include "info.h"
@@ -105,7 +105,7 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC)
if (flag & PHP_CREDITS_QA) {
php_info_print_table_start();
- php_info_print_table_header(1, "PHP 5.1 Quality Assurance Team");
+ php_info_print_table_header(1, "PHP Quality Assurance Team");
php_info_print_table_row(1, "Ilia Alshanetsky, Joerg Behrens, Antony Dovgal, Stefan Esser, Moriyoshi Koizumi, Magnus Maatta, Sebastian Nohn, Derick Rethans, Melvyn Sopacua, Jani Taskinen");
php_info_print_table_end();
}
diff --git a/ext/standard/credits_ext.h b/ext/standard/credits_ext.h
index 6b3f53648..889d10d4a 100644
--- a/ext/standard/credits_ext.h
+++ b/ext/standard/credits_ext.h
@@ -18,36 +18,36 @@ CREDIT_LINE("COM and .Net", "Wez Furlong");
CREDIT_LINE("ctype", "Hartmut Holzgraefe");
CREDIT_LINE("cURL", "Sterling Hughes");
CREDIT_LINE("Date/Time Support", "Derick Rethans");
-CREDIT_LINE("DB-LIB (MS SQL, Sybase)", "Wez Furlong, Frank M. Kromann");
CREDIT_LINE("DBA", "Sascha Schumann, Marcus Boerger");
CREDIT_LINE("dBase", "Jim Winstead");
+CREDIT_LINE("DB-LIB (MS SQL, Sybase)", "Wez Furlong, Frank M. Kromann");
CREDIT_LINE("DOM", "Christian Stocker, Rob Richards, Marcus Boerger");
CREDIT_LINE("EXIF", "Rasmus Lerdorf, Marcus Boerger");
CREDIT_LINE("FBSQL", "Frank M. Kromann");
CREDIT_LINE("FDF", "Uwe Steinmann");
-CREDIT_LINE("FilePro", "Chad Robinson");
CREDIT_LINE("Firebird/InterBase driver for PDO", "Ard Biesheuvel");
CREDIT_LINE("FTP", "Stefan Esser, Andrew Skalski");
CREDIT_LINE("GD imaging", "Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger");
CREDIT_LINE("GetText", "Alex Plotnick");
CREDIT_LINE("GNU GMP support", "Stanislav Malyshev");
-CREDIT_LINE("HwAPI", "Uwe Steinmann");
CREDIT_LINE("Iconv", "Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi ");
CREDIT_LINE("IMAP", "Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky");
CREDIT_LINE("Informix", "Danny Heijl, Christian Cartus, Corne' Cornelius");
+CREDIT_LINE("Input Filter", "Rasmus Lerdorf, Derick Rethans, Pierre-Alain Joye, Ilia Alshanetsky");
CREDIT_LINE("InterBase", "Jouni Ahto, Andrew Avdeev, Ard Biesheuvel");
+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("mime_magic", "Hartmut Holzgraefe");
CREDIT_LINE("MING", "Dave Hayden, Frank M. Kromann");
-CREDIT_LINE("MS SQL", "Frank M. Kromann");
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");
-CREDIT_LINE("MySQL", "Zeev Suraski, Zak Greant, Georg Richter");
CREDIT_LINE("MySQLi", "Zak Greant, Georg Richter");
+CREDIT_LINE("MySQL", "Zeev Suraski, Zak Greant, Georg Richter");
CREDIT_LINE("ncurses", "Ilia Alshanetsky, Wez Furlong, Hartmut Holzgraefe, Georg Richter");
CREDIT_LINE("OCI8", "Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky, Harald Radi, Antony Dovgal, Andi Gutmans, Wez Furlong");
CREDIT_LINE("ODBC driver for PDO", "Wez Furlong");
@@ -82,9 +82,10 @@ CREDIT_LINE("System V Shared Memory", "Christian Cartus");
CREDIT_LINE("tidy", "John Coggeshall, Ilia Alshanetsky");
CREDIT_LINE("tokenizer", "Andrei Zmievski");
CREDIT_LINE("WDDX", "Andrei Zmievski");
-CREDIT_LINE("XML", "Stig Bakken, Thies C. Arntzen, Sterling Hughes");
CREDIT_LINE("XMLReader", "Rob Richards");
CREDIT_LINE("xmlrpc", "Dan Libby");
+CREDIT_LINE("XML", "Stig Bakken, Thies C. Arntzen, Sterling Hughes");
CREDIT_LINE("XMLWriter", "Rob Richards, Pierre-Alain Joye");
CREDIT_LINE("XSL", "Christian Stocker, Rob Richards");
+CREDIT_LINE("Zip", "Pierre-Alain Joye");
CREDIT_LINE("Zlib", "Rasmus Lerdorf, Stefan Roehrich, Zeev Suraski, Jade Nicoletti");
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index eaf5ae7f9..bb4e402b5 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -18,11 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: datetime.c,v 1.134.2.2 2006/01/01 12:50:14 sniper Exp $ */
-
-#if HAVE_STRPTIME
-#define _XOPEN_SOURCE
-#endif
+/* $Id: datetime.c,v 1.134.2.2.2.2 2006/08/24 11:06:02 tony2001 Exp $ */
#include "php.h"
#include "zend_operators.h"
@@ -85,6 +81,10 @@ PHPAPI char *php_std_date(time_t t TSRMLS_DC)
#if HAVE_STRPTIME
+#ifndef HAVE_STRPTIME_DECL_FAILS
+char *strptime(const char *s, const char *format, struct tm *tm);
+#endif
+
/* {{{ proto string strptime(string timestamp, string format)
Parse a time/date generated with strftime() */
PHP_FUNCTION(strptime)
@@ -101,6 +101,8 @@ PHP_FUNCTION(strptime)
return;
}
+ memset(&parsed_time, 0, sizeof(parsed_time));
+
unparsed_part = strptime(ts, format, &parsed_time);
if (unparsed_part == NULL) {
RETURN_FALSE;
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index dbdde4507..435f099c5 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dir.c,v 1.147.2.3 2006/02/26 10:49:50 helly Exp $ */
+/* $Id: dir.c,v 1.147.2.3.2.1 2006/10/04 23:19:25 iliaa Exp $ */
/* {{{ includes/startup/misc */
@@ -286,7 +286,7 @@ PHP_FUNCTION(chdir)
RETURN_FALSE;
}
- if (PG(safe_mode) && !php_checkuid(str, NULL, CHECKUID_CHECK_FILE_AND_DIR)) {
+ if ((PG(safe_mode) && !php_checkuid(str, NULL, CHECKUID_CHECK_FILE_AND_DIR)) || php_check_open_basedir(str TSRMLS_CC)) {
RETURN_FALSE;
}
ret = VCWD_CHDIR(str);
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 6e09bac53..9927cdfc2 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.409.2.6 2006/04/06 02:39:55 iliaa Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.7 2006/10/13 01:42:19 iliaa Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -535,7 +535,7 @@ PHP_FUNCTION(file_get_contents)
}
if (offset > 0 && php_stream_seek(stream, offset, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to %ld position in the stream.", offset);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream.", offset);
RETURN_FALSE;
}
@@ -571,12 +571,17 @@ PHP_FUNCTION(file_put_contents)
long flags = 0;
zval *zcontext = NULL;
php_stream_context *context = NULL;
+ php_stream *srcstream = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|lr!", &filename, &filename_len,
&data, &flags, &zcontext) == FAILURE) {
return;
}
+ if (Z_TYPE_P(data) == IS_RESOURCE) {
+ php_stream_from_zval(srcstream, &data);
+ }
+
context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT);
stream = php_stream_open_wrapper_ex(filename, (flags & PHP_FILE_APPEND) ? "ab" : "wb",
@@ -591,14 +596,8 @@ PHP_FUNCTION(file_put_contents)
switch (Z_TYPE_P(data)) {
case IS_RESOURCE:
- {
- php_stream *srcstream;
- php_stream_from_zval(srcstream, &data);
-
numbytes = php_stream_copy_to_stream(srcstream, stream, PHP_STREAM_COPY_ALL);
-
break;
- }
case IS_NULL:
case IS_LONG:
case IS_DOUBLE:
@@ -1464,6 +1463,10 @@ PHP_FUNCTION(umask)
oldumask = umask(077);
+ if (BG(umask) != -1) {
+ BG(umask) = oldumask;
+ }
+
if (arg_count == 0) {
umask(oldumask);
} else {
@@ -1474,8 +1477,6 @@ PHP_FUNCTION(umask)
umask(Z_LVAL_PP(arg1));
}
- /* XXX we should maybe reset the umask after each request! */
-
RETURN_LONG(oldumask);
}
@@ -1710,9 +1711,14 @@ PHP_FUNCTION(copy)
}
/* }}} */
+PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
+{
+ return php_copy_file_ex(src, dest, ENFORCE_SAFE_MODE TSRMLS_CC);
+}
+
/* {{{ php_copy_file
*/
-PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
+PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC)
{
php_stream *srcstream = NULL, *deststream = NULL;
int ret = FAILURE;
@@ -1767,7 +1773,7 @@ no_stat:
}
safe_to_copy:
- srcstream = php_stream_open_wrapper(src, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+ srcstream = php_stream_open_wrapper(src, "rb", src_chk | REPORT_ERRORS, NULL);
if (!srcstream) {
return ret;
@@ -1975,17 +1981,14 @@ PHP_FUNCTION(fputcsv)
Get line from file pointer and parse for CSV fields */
PHP_FUNCTION(fgetcsv)
{
- char *temp, *tptr, *bptr, *line_end, *limit;
char delimiter = ','; /* allow this to be set as parameter */
char enclosure = '"'; /* allow this to be set as parameter */
- const char escape_char = '\\';
/* first section exactly as php_fgetss */
long len = 0;
- size_t buf_len, temp_len, line_end_len;
+ size_t buf_len;
char *buf;
php_stream *stream;
- int inc_len;
{
zval *fd, **len_zv = NULL;
@@ -2005,6 +2008,8 @@ PHP_FUNCTION(fgetcsv)
if (delimiter_str_len < 1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
+ } else if (delimiter_str_len > 1) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "delimiter must be a single character");
}
/* use first character from string */
@@ -2015,7 +2020,10 @@ PHP_FUNCTION(fgetcsv)
if (enclosure_str_len < 1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
+ } else if (enclosure_str_len > 1) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "enclosure must be a single character");
}
+
/* use first character from string */
enclosure = enclosure_str[0];
}
@@ -2047,6 +2055,23 @@ PHP_FUNCTION(fgetcsv)
RETURN_FALSE;
}
}
+
+ php_fgetcsv(stream, delimiter, enclosure, buf_len, buf, return_value TSRMLS_CC);
+}
+/* }}} */
+
+
+PHPAPI void php_fgetcsv(php_stream *stream, /* {{{ */
+ char delimiter, char enclosure,
+ size_t buf_len, char *buf,
+ zval *return_value TSRMLS_DC)
+{
+ char *temp, *tptr, *bptr, *line_end, *limit;
+ const char escape_char = '\\';
+
+ size_t temp_len, line_end_len;
+ int inc_len;
+
/* initialize internal state */
php_mblen(NULL, 0);
diff --git a/ext/standard/file.h b/ext/standard/file.h
index c7a1406fb..65eaf464f 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.h,v 1.94.2.2 2006/01/13 04:05:59 pajoye Exp $ */
+/* $Id: file.h,v 1.94.2.2.2.2 2006/10/13 09:34:34 bjori Exp $ */
/* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */
@@ -72,8 +72,10 @@ PHP_MINIT_FUNCTION(user_streams);
PHPAPI int php_le_stream_context(void);
PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC);
PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
+PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC);
PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC);
PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC);
+PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, size_t buf_len, char *buf, zval *return_value TSRMLS_DC);
#define META_DEF_BUFSIZE 8192
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 3b81dbb07..458fe267c 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filestat.c,v 1.136.2.9 2006/08/10 21:30:23 iliaa Exp $ */
+/* $Id: filestat.c,v 1.136.2.8.2.3 2006/07/02 13:51:40 iliaa Exp $ */
#include "php.h"
#include "safe_mode.h"
@@ -79,6 +79,10 @@
# endif
#endif
+#ifdef PHP_WIN32
+#include "win32/winutil.h"
+#endif
+
#include "basic_functions.h"
#include "php_filestat.h"
@@ -170,7 +174,10 @@ PHP_FUNCTION(disk_total_space)
if (func(Z_STRVAL_PP(path),
&FreeBytesAvailableToCaller,
&TotalNumberOfBytes,
- &TotalNumberOfFreeBytes) == 0) RETURN_FALSE;
+ &TotalNumberOfFreeBytes) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ RETURN_FALSE;
+ }
/* i know - this is ugly, but i works <thies@thieso.net> */
bytestotal = TotalNumberOfBytes.HighPart *
@@ -181,7 +188,10 @@ PHP_FUNCTION(disk_total_space)
else {
if (GetDiskFreeSpace(Z_STRVAL_PP(path),
&SectorsPerCluster, &BytesPerSector,
- &NumberOfFreeClusters, &TotalNumberOfClusters) == 0) RETURN_FALSE;
+ &NumberOfFreeClusters, &TotalNumberOfClusters) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ RETURN_FALSE;
+ }
bytestotal = (double)TotalNumberOfClusters * (double)SectorsPerCluster * (double)BytesPerSector;
}
}
@@ -200,7 +210,10 @@ PHP_FUNCTION(disk_total_space)
}
#else /* WINDOWS, OS/2 */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
- if (statvfs(Z_STRVAL_PP(path), &buf)) RETURN_FALSE;
+ if (statvfs(Z_STRVAL_PP(path), &buf)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ RETURN_FALSE;
+ }
if (buf.f_frsize) {
bytestotal = (((double)buf.f_blocks) * ((double)buf.f_frsize));
} else {
@@ -208,7 +221,10 @@ PHP_FUNCTION(disk_total_space)
}
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
- if (statfs(Z_STRVAL_PP(path), &buf)) RETURN_FALSE;
+ if (statfs(Z_STRVAL_PP(path), &buf)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ RETURN_FALSE;
+ }
bytestotal = (((double)buf.f_bsize) * ((double)buf.f_blocks));
#endif
#endif /* WINDOWS */
@@ -273,7 +289,10 @@ PHP_FUNCTION(disk_free_space)
if (func(Z_STRVAL_PP(path),
&FreeBytesAvailableToCaller,
&TotalNumberOfBytes,
- &TotalNumberOfFreeBytes) == 0) RETURN_FALSE;
+ &TotalNumberOfFreeBytes) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ RETURN_FALSE;
+ }
/* i know - this is ugly, but i works <thies@thieso.net> */
bytesfree = FreeBytesAvailableToCaller.HighPart *
@@ -284,7 +303,10 @@ PHP_FUNCTION(disk_free_space)
else {
if (GetDiskFreeSpace(Z_STRVAL_PP(path),
&SectorsPerCluster, &BytesPerSector,
- &NumberOfFreeClusters, &TotalNumberOfClusters) == 0) RETURN_FALSE;
+ &NumberOfFreeClusters, &TotalNumberOfClusters) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ RETURN_FALSE;
+ }
bytesfree = (double)NumberOfFreeClusters * (double)SectorsPerCluster * (double)BytesPerSector;
}
}
@@ -303,14 +325,20 @@ PHP_FUNCTION(disk_free_space)
}
#else /* WINDOWS, OS/2 */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
- if (statvfs(Z_STRVAL_PP(path), &buf)) RETURN_FALSE;
+ if (statvfs(Z_STRVAL_PP(path), &buf)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ RETURN_FALSE;
+ }
if (buf.f_frsize) {
bytesfree = (((double)buf.f_bavail) * ((double)buf.f_frsize));
} else {
bytesfree = (((double)buf.f_bavail) * ((double)buf.f_bsize));
}
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
- if (statfs(Z_STRVAL_PP(path), &buf)) RETURN_FALSE;
+ if (statfs(Z_STRVAL_PP(path), &buf)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ RETURN_FALSE;
+ }
#ifdef NETWARE
bytesfree = (((double)buf.f_bsize) * ((double)buf.f_bfree));
#else
@@ -538,7 +566,6 @@ PHP_FUNCTION(touch)
{
zval **filename, **filetime, **fileatime;
int ret;
- struct stat sb;
FILE *file;
struct utimbuf newtimebuf;
struct utimbuf *newtime = NULL;
@@ -575,8 +602,7 @@ PHP_FUNCTION(touch)
}
/* create the file if it doesn't exist already */
- ret = VCWD_STAT(Z_STRVAL_PP(filename), &sb);
- if (ret == -1) {
+ if (VCWD_ACCESS(Z_STRVAL_PP(filename), F_OK) != 0) {
file = VCWD_FOPEN(Z_STRVAL_PP(filename), "w");
if (file == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create file %s because %s", Z_STRVAL_PP(filename), strerror(errno));
diff --git a/ext/standard/filters.c b/ext/standard/filters.c
index 12aeabecd..2c87e88ec 100644
--- a/ext/standard/filters.c
+++ b/ext/standard/filters.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filters.c,v 1.44.2.6 2006/04/17 19:26:04 pollita Exp $ */
+/* $Id: filters.c,v 1.44.2.6.2.3 2006/09/04 19:14:59 nlopess Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -470,7 +470,6 @@ static php_conv_err_t php_conv_base64_encode_convert(php_conv_base64_encode *ins
register size_t ocnt, icnt;
register unsigned char *ps, *pd;
register unsigned int line_ccnt;
- size_t nbytes_written;
if (in_pp == NULL || in_left_p == NULL) {
return php_conv_base64_encode_flush(inst, in_pp, in_left_p, out_pp, out_left_p);
@@ -481,7 +480,6 @@ static php_conv_err_t php_conv_base64_encode_convert(php_conv_base64_encode *ins
ps = (unsigned char *)(*in_pp);
icnt = *in_left_p;
line_ccnt = inst->line_ccnt;
- nbytes_written = 0;
/* consume the remainder first */
switch (inst->erem_len) {
@@ -1882,7 +1880,7 @@ static php_stream_filter *consumed_filter_create(const char *filtername, zval *f
/* Create this filter */
data = pecalloc(1, sizeof(php_consumed_filter_data), persistent);
if (!data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", sizeof(php_consumed_filter_data));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes.", sizeof(php_consumed_filter_data));
return NULL;
}
data->persistent = persistent;
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index 0f84ec215..dce8c936b 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: formatted_print.c,v 1.82.2.1 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: formatted_print.c,v 1.82.2.1.2.1 2006/06/26 18:48:56 bjori Exp $ */
#include <math.h> /* modf() */
#include "php.h"
@@ -853,6 +853,7 @@ PHP_FUNCTION(fprintf)
RETURN_LONG(len);
}
+/* }}} */
/* {{{ proto int vfprintf(resource stream, string format, array args)
Output a formatted string into a stream */
@@ -883,7 +884,7 @@ PHP_FUNCTION(vfprintf)
RETURN_LONG(len);
}
-
+/* }}} */
/*
diff --git a/ext/standard/head.c b/ext/standard/head.c
index fa43319e9..c1b0c263c 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: head.c,v 1.84.2.1 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: head.c,v 1.84.2.1.2.2 2006/10/16 19:27:57 tony2001 Exp $ */
#include <stdio.h>
#include "php.h"
@@ -60,7 +60,7 @@ PHPAPI int php_header(TSRMLS_D)
}
-PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode TSRMLS_DC)
+PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC)
{
char *cookie, *encoded_value = NULL;
int len=sizeof("Set-Cookie: ");
@@ -131,6 +131,9 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
if (secure) {
strcat(cookie, "; secure");
}
+ if (httponly) {
+ strcat(cookie, "; httponly");
+ }
ctr.line = cookie;
ctr.line_len = strlen(cookie);
@@ -142,22 +145,22 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
/* php_set_cookie(name, value, expires, path, domain, secure) */
-/* {{{ proto bool setcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure]]]]])
+/* {{{ proto bool setcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure[, bool httponly]]]]]])
Send a cookie */
PHP_FUNCTION(setcookie)
{
char *name, *value = NULL, *path = NULL, *domain = NULL;
long expires = 0;
- zend_bool secure = 0;
- int name_len, value_len, path_len, domain_len;
+ zend_bool secure = 0, httponly = 0;
+ int name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
&name_len, &value, &value_len, &expires, &path,
- &path_len, &domain, &domain_len, &secure) == FAILURE) {
+ &path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
}
- if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 1 TSRMLS_CC) == SUCCESS) {
+ if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 1, httponly TSRMLS_CC) == SUCCESS) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -165,22 +168,22 @@ PHP_FUNCTION(setcookie)
}
/* }}} */
-/* {{{ proto bool setrawcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure]]]]])
+/* {{{ proto bool setrawcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure[, bool httponly]]]]]])
Send a cookie with no url encoding of the value */
PHP_FUNCTION(setrawcookie)
{
char *name, *value = NULL, *path = NULL, *domain = NULL;
long expires = 0;
- zend_bool secure = 0;
- int name_len, value_len, path_len, domain_len;
+ zend_bool secure = 0, httponly = 0;
+ int name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
&name_len, &value, &value_len, &expires, &path,
- &path_len, &domain, &domain_len, &secure) == FAILURE) {
+ &path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
}
- if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 0 TSRMLS_CC) == SUCCESS) {
+ if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 0, httponly TSRMLS_CC) == SUCCESS) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
diff --git a/ext/standard/head.h b/ext/standard/head.h
index bc4785857..d009a8954 100644
--- a/ext/standard/head.h
+++ b/ext/standard/head.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: head.h,v 1.28.2.1 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: head.h,v 1.28.2.1.2.1 2006/08/10 13:50:56 iliaa Exp $ */
#ifndef HEAD_H
#define HEAD_H
@@ -29,6 +29,6 @@ PHP_FUNCTION(headers_sent);
PHP_FUNCTION(headers_list);
PHPAPI int php_header(TSRMLS_D);
-PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode TSRMLS_DC);
+PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC);
#endif
diff --git a/ext/standard/html.c b/ext/standard/html.c
index 08e791192..d70172c94 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: html.c,v 1.111.2.2 2006/02/25 21:32:11 rasmus Exp $ */
+/* $Id: html.c,v 1.111.2.2.2.3 2006/11/01 01:55:11 iliaa Exp $ */
/*
* HTML entity resources:
@@ -756,6 +756,15 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
charset_hint = Z_STRVAL_P(uf_result);
len = Z_STRLEN_P(uf_result);
+ if (len == 4) { /* sizeof(none|auto|pass)-1 */
+ if (!memcmp("pass", charset_hint, sizeof("pass") - 1) ||
+ !memcmp("auto", charset_hint, sizeof("auto") - 1) ||
+ !memcmp("none", charset_hint, sizeof("none") - 1)) {
+
+ charset_hint = NULL;
+ len = 0;
+ }
+ }
goto det_charset;
}
}
@@ -1096,7 +1105,7 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
matches_map = 0;
- if (len + 9 > maxlen)
+ if (len + 16 > maxlen)
replaced = erealloc (replaced, maxlen += 128);
if (all) {
@@ -1121,9 +1130,15 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
}
if (matches_map) {
+ int l = strlen(rep);
+ /* increase the buffer size */
+ if (len + 2 + l >= maxlen) {
+ replaced = erealloc(replaced, maxlen += 128);
+ }
+
replaced[len++] = '&';
strcpy(replaced + len, rep);
- len += strlen(rep);
+ len += l;
replaced[len++] = ';';
}
}
@@ -1212,7 +1227,7 @@ PHP_FUNCTION(htmlspecialchars)
}
/* }}} */
-/* {{{ proto string htmlspecialchars(string string [, int quote_style])
+/* {{{ proto string htmlspecialchars_decode(string string [, int quote_style])
Convert special HTML entities back to characters */
PHP_FUNCTION(htmlspecialchars_decode)
{
diff --git a/ext/standard/http.c b/ext/standard/http.c
index af6ec8292..b57f43bf5 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: http.c,v 1.14.2.4 2006/03/08 22:00:21 mike Exp $ */
+/* $Id: http.c,v 1.14.2.4.2.1 2006/07/24 18:03:45 helly Exp $ */
#include "php_http.h"
#include "php_ini.h"
@@ -67,11 +67,11 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
char *tmp;
zend_object *zobj = zend_objects_get_address(type TSRMLS_CC);
- if (zend_check_property_access(zobj, key TSRMLS_CC) != SUCCESS) {
+ if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) != SUCCESS) {
/* private or protected property access outside of the class */
continue;
}
- zend_unmangle_property_name_ex(key, key_len, &tmp, &key);
+ zend_unmangle_property_name(key, key_len-1, &tmp, &key);
key_len = strlen(key);
}
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index ba39b714a..14f5d0015 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -19,7 +19,7 @@
| Sara Golemon <pollita@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: http_fopen_wrapper.c,v 1.99.2.12 2006/04/16 17:40:33 iliaa Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.1 2006/06/29 14:40:49 bjori Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -619,7 +619,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
php_url_free(resource);
/* check for invalid redirection URLs */
if ((resource = php_url_parse(new_path)) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect url! %s", new_path);
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path);
goto out;
}
@@ -631,7 +631,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
s = val; e = s + l; \
while (s < e) { \
if (iscntrl(*s)) { \
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect url! %s", new_path); \
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path); \
goto out; \
} \
s++; \
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 390680b0a..6fca6a28f 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: image.c,v 1.114.2.2 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: image.c,v 1.114.2.2.2.2 2006/06/25 21:08:28 bjori Exp $ */
#include "php.h"
#include <stdio.h>
@@ -1165,6 +1165,10 @@ PHP_FUNCTION(image_type_to_extension)
RETURN_STRING(".jpc" + !inc_dot, 1);
case IMAGE_FILETYPE_JP2:
RETURN_STRING(".jp2" + !inc_dot, 1);
+ case IMAGE_FILETYPE_JPX:
+ RETURN_STRING(".jpx" + !inc_dot, 1);
+ case IMAGE_FILETYPE_JB2:
+ RETURN_STRING(".jb2" + !inc_dot, 1);
case IMAGE_FILETYPE_XBM:
RETURN_STRING(".xbm" + !inc_dot, 1);
}
diff --git a/ext/standard/info.c b/ext/standard/info.c
index fa2afe07d..eb3389713 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: info.c,v 1.249.2.10 2006/03/31 11:11:12 tony2001 Exp $ */
+/* $Id: info.c,v 1.249.2.10.2.6 2006/09/14 08:01:48 dmitry Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -66,7 +66,7 @@ static int php_info_write_wrapper(const char *str, uint str_length)
TSRMLS_FETCH();
- elem_esc = php_escape_html_entities((char *)str, str_length, &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
+ elem_esc = php_escape_html_entities((unsigned char *)str, str_length, &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
written = php_body_write(elem_esc, new_len TSRMLS_CC);
@@ -114,7 +114,6 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
char *string_key;
uint string_len;
ulong num_key;
- char *elem_esc = NULL;
zend_is_auto_global(name, name_length TSRMLS_CC);
@@ -134,11 +133,9 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data), &string_key, &string_len, &num_key, 0, NULL)) {
case HASH_KEY_IS_STRING:
if (!sapi_module.phpinfo_as_text) {
- elem_esc = php_info_html_esc(string_key TSRMLS_CC);
- PUTS(elem_esc);
- efree(elem_esc);
+ php_info_html_esc_write(string_key, string_len - 1 TSRMLS_CC);
} else {
- PUTS(string_key);
+ PHPWRITE(string_key, string_len - 1);
}
break;
case HASH_KEY_IS_LONG:
@@ -154,7 +151,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
if (Z_TYPE_PP(tmp) == IS_ARRAY) {
if (!sapi_module.phpinfo_as_text) {
PUTS("<pre>");
- zend_print_zval_ex((zend_write_func_t) php_info_write_wrapper, *tmp, 0);
+ zend_print_zval_r_ex((zend_write_func_t) php_info_write_wrapper, *tmp, 0 TSRMLS_CC);
PUTS("</pre>");
} else {
zend_print_zval_r(*tmp, 0 TSRMLS_CC);
@@ -167,12 +164,10 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
if (Z_STRLEN(tmp2) == 0) {
PUTS("<i>no value</i>");
} else {
- elem_esc = php_info_html_esc(Z_STRVAL(tmp2) TSRMLS_CC);
- PUTS(elem_esc);
- efree(elem_esc);
+ php_info_html_esc_write(Z_STRVAL(tmp2), Z_STRLEN(tmp2) TSRMLS_CC);
}
} else {
- PUTS(Z_STRVAL(tmp2));
+ PHPWRITE(Z_STRVAL(tmp2), Z_STRLEN(tmp2));
}
zval_dtor(&tmp2);
} else {
@@ -180,12 +175,10 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
if (Z_STRLEN_PP(tmp) == 0) {
PUTS("<i>no value</i>");
} else {
- elem_esc = php_info_html_esc(Z_STRVAL_PP(tmp) TSRMLS_CC);
- PUTS(elem_esc);
- efree(elem_esc);
+ php_info_html_esc_write(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp) TSRMLS_CC);
}
} else {
- PUTS(Z_STRVAL_PP(tmp));
+ PHPWRITE(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
}
if (!sapi_module.phpinfo_as_text) {
@@ -209,13 +202,24 @@ void php_info_print_style(TSRMLS_D)
}
/* }}} */
+/* {{{ php_info_html_esc_write
+ */
+PHPAPI void php_info_html_esc_write(char *string, int str_len TSRMLS_DC)
+{
+ int new_len;
+ char *ret = php_escape_html_entities((unsigned char *)string, str_len, &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
+
+ PHPWRITE(ret, new_len);
+ efree(ret);
+}
+/* }}} */
/* {{{ php_info_html_esc
*/
PHPAPI char *php_info_html_esc(char *string TSRMLS_DC)
{
int new_len;
- return php_escape_html_entities(string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
+ return php_escape_html_entities((unsigned char *)string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
}
/* }}} */
@@ -486,11 +490,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_table_row(2, "Thread Safety", "disabled" );
#endif
-#if USE_ZEND_ALLOC
- php_info_print_table_row(2, "Zend Memory Manager", "enabled" );
-#else
- php_info_print_table_row(2, "Zend Memory Manager", "disabled" );
-#endif
+ php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm(TSRMLS_C) ? "enabled" : "disabled" );
#if HAVE_IPV6
php_info_print_table_row(2, "IPv6 Support", "enabled" );
@@ -505,7 +505,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if ((url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash())) {
for (zend_hash_internal_pointer_reset(url_stream_wrappers_hash);
- zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, &stream_protocol_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING;
+ 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);
@@ -536,7 +536,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if ((stream_xport_hash = php_stream_xport_get_hash())) {
for(zend_hash_internal_pointer_reset(stream_xport_hash);
- zend_hash_get_current_key_ex(stream_xport_hash, &xport_name, &xport_name_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING;
+ 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 + 3 > xport_buf_size) {
while (xport_buf_len + xport_name_len + 3 > xport_buf_size) {
@@ -577,7 +577,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if ((stream_filter_hash = php_get_stream_filters_hash())) {
for(zend_hash_internal_pointer_reset(stream_filter_hash);
- zend_hash_get_current_key_ex(stream_filter_hash, &filter_name, &filter_name_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING;
+ 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 + 3 > filter_buf_size) {
while (filter_buf_len + filter_name_len + 3 > filter_buf_size) {
diff --git a/ext/standard/info.h b/ext/standard/info.h
index 7d417247b..191623c72 100644
--- a/ext/standard/info.h
+++ b/ext/standard/info.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: info.h,v 1.38.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: info.h,v 1.38.2.1.2.2 2006/09/29 21:40:16 iliaa Exp $ */
#ifndef INFO_H
#define INFO_H
@@ -67,6 +67,7 @@ PHP_FUNCTION(php_sapi_name);
PHP_FUNCTION(php_uname);
PHP_FUNCTION(php_ini_scanned_files);
PHPAPI char *php_info_html_esc(char *string TSRMLS_DC);
+PHPAPI void php_info_html_esc_write(char *string, int str_len TSRMLS_DC);
PHPAPI void php_print_info_htmlhead(TSRMLS_D);
PHPAPI void php_print_info(int flag TSRMLS_DC);
PHPAPI void php_print_style(void);
@@ -81,6 +82,7 @@ PHPAPI void php_info_print_box_start(int bg);
PHPAPI void php_info_print_box_end(void);
PHPAPI void php_info_print_hr(void);
PHPAPI char *php_logo_guid(void);
+PHPAPI char *php_get_uname(char mode);
void register_phpinfo_constants(INIT_FUNC_ARGS);
END_EXTERN_C()
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index b4957fc61..fdf33bb81 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: iptc.c,v 1.50.2.2 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: iptc.c,v 1.50.2.2.2.1 2006/08/30 16:30:14 tony2001 Exp $ */
/*
* Functions to parse & compse IPTC data.
@@ -231,11 +231,17 @@ PHP_FUNCTION(iptcembed)
if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xFF) {
fclose(fp);
+ if (poi) {
+ efree(poi);
+ }
RETURN_FALSE;
}
if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xD8) {
fclose(fp);
+ if (poi) {
+ efree(poi);
+ }
RETURN_FALSE;
}
diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c
index a6c48239a..8caa58e49 100644
--- a/ext/standard/levenshtein.c
+++ b/ext/standard/levenshtein.c
@@ -15,7 +15,7 @@
| Author: Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: levenshtein.c,v 1.34.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: levenshtein.c,v 1.34.2.1.2.1 2006/06/26 18:48:56 bjori Exp $ */
#include "php.h"
#include <stdlib.h>
@@ -79,7 +79,7 @@ static int custom_levdist(char *str1, char *str2, char *callback_name TSRMLS_DC)
}
/* }}} */
-/* {{{ proto int levenshtein(string str1, string str2)
+/* {{{ proto int levenshtein(string str1, string str2[, int cost_ins, int cost_rep, int cost_del])
Calculate Levenshtein distance between two strings */
PHP_FUNCTION(levenshtein)
{
diff --git a/ext/standard/link.c b/ext/standard/link.c
index 832494932..8bc554fb6 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: link.c,v 1.52.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: link.c,v 1.52.2.1.2.1 2006/09/16 18:30:03 iliaa Exp $ */
#include "php.h"
#include "php_filestat.h"
@@ -122,14 +122,15 @@ PHP_FUNCTION(symlink)
convert_to_string_ex(topath);
convert_to_string_ex(frompath);
- expand_filepath(Z_STRVAL_PP(frompath), source_p TSRMLS_CC);
- expand_filepath(Z_STRVAL_PP(topath), dest_p TSRMLS_CC);
+ if (!expand_filepath(Z_STRVAL_PP(frompath), source_p TSRMLS_CC) || !expand_filepath(Z_STRVAL_PP(topath), dest_p TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ||
php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
{
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to symlink to a URL");
- RETURN_FALSE;
+ RETURN_FALSE;
}
if (PG(safe_mode) && !php_checkuid(dest_p, NULL, CHECKUID_CHECK_FILE_AND_DIR)) {
@@ -177,14 +178,15 @@ PHP_FUNCTION(link)
convert_to_string_ex(topath);
convert_to_string_ex(frompath);
- expand_filepath(Z_STRVAL_PP(frompath), source_p TSRMLS_CC);
- expand_filepath(Z_STRVAL_PP(topath), dest_p TSRMLS_CC);
+ if (!expand_filepath(Z_STRVAL_PP(frompath), source_p TSRMLS_CC) || !expand_filepath(Z_STRVAL_PP(topath), dest_p TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ||
php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
{
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL");
- RETURN_FALSE;
+ RETURN_FALSE;
}
if (PG(safe_mode) && !php_checkuid(dest_p, NULL, CHECKUID_CHECK_FILE_AND_DIR)) {
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 2f5ee7ba0..875f9fc1e 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: math.c,v 1.131.2.2 2006/02/06 11:28:41 tony2001 Exp $ */
+/* $Id: math.c,v 1.131.2.2.2.2 2006/08/27 19:14:43 bjori Exp $ */
#include "php.h"
#include "php_math.h"
@@ -29,10 +29,6 @@
#include <float.h>
#include <stdlib.h>
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
#ifndef PHP_ROUND_FUZZ
# ifndef PHP_WIN32
# define PHP_ROUND_FUZZ 0.50000000001
@@ -976,13 +972,8 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
is_negative = 1;
d = -d;
}
- if (!dec_point && dec > 0) {
- d *= pow(10, dec);
- dec = 0;
- } else {
- dec = MAX(0, dec);
- }
+ dec = MAX(0, dec);
PHP_ROUND_WITH_FUZZ(d, dec);
tmplen = spprintf(&tmpbuf, 0, "%.*f", dec, d);
@@ -991,8 +982,10 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
return tmpbuf;
}
+ /* find decimal point, if expected */
+ dp = dec ? strchr(tmpbuf, '.') : NULL;
+
/* calculate the length of the return buffer */
- dp = strchr(tmpbuf, '.');
if (dp) {
integral = dp - tmpbuf;
} else {
@@ -1008,7 +1001,11 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
reslen = integral;
if (dec) {
- reslen += 1 + dec;
+ reslen += dec;
+
+ if (dec_point) {
+ reslen++;
+ }
}
/* add a byte for minus sign */
@@ -1025,29 +1022,29 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
* Take care, as the sprintf implementation may return less places than
* we requested due to internal buffer limitations */
if (dec) {
- int declen = dp ? strlen(dp+1) : 0;
- int topad = declen > 0 ? dec - declen : 0;
+ int declen = dp ? s - dp : 0;
+ int topad = dec > declen ? dec - declen : 0;
/* pad with '0's */
-
while (topad--) {
*t-- = '0';
}
if (dp) {
- /* now copy the chars after the point */
- memcpy(t - declen + 1, dp + 1, declen);
-
+ s -= declen + 1; /* +1 to skip the point */
t -= declen;
- s -= declen;
+
+ /* now copy the chars after the point */
+ memcpy(t + 1, dp + 1, declen);
}
/* add decimal point */
- *t-- = dec_point;
- s--;
+ if (dec_point) {
+ *t-- = dec_point;
+ }
}
- /* copy the numbers before the decimal place, adding thousand
+ /* copy the numbers before the decimal point, adding thousand
* separator every three digits */
while(s >= tmpbuf) {
*t-- = *s--;
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index de9fff83a..206b555ed 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: metaphone.c,v 1.28.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: metaphone.c,v 1.28.2.1.2.3 2006/09/27 08:32:24 tony2001 Exp $ */
/*
Based on CPANs "Text-Metaphone-1.96" by Michael G Schwern <schwern@pobox.com>
@@ -25,11 +25,9 @@
#include "php.h"
#include "php_metaphone.h"
-static int metaphone(char *word, int word_len, int max_phonemes, char **phoned_word, int traditional);
+static int metaphone(unsigned char *word, int word_len, long max_phonemes, char **phoned_word, int traditional);
-PHP_FUNCTION(metaphone);
-
-/* {{{ proto string metaphone(string text, int phones)
+/* {{{ proto string metaphone(string text[, int phones])
Break english phrases down into their phonemes */
PHP_FUNCTION(metaphone)
{
@@ -43,7 +41,7 @@ PHP_FUNCTION(metaphone)
return;
}
- if (metaphone(str, str_len, phones, &result, 1) == 0) {
+ if (metaphone((unsigned char *)str, str_len, phones, &result, 1) == 0) {
RETVAL_STRING(result, 0);
} else {
if (result) {
@@ -161,7 +159,7 @@ static char Lookahead(char *word, int how_far)
/* {{{ metaphone
*/
-static int metaphone(char *word, int word_len, int max_phonemes, char **phoned_word, int traditional)
+static int metaphone(unsigned char *word, int word_len, long max_phonemes, char **phoned_word, int traditional)
{
int w_idx = 0; /* point in the phonization we're at. */
int p_idx = 0; /* end of the phoned phrase */
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h
index b4e6923b4..1b48eb998 100644
--- a/ext/standard/php_array.h
+++ b/ext/standard/php_array.h
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_array.h,v 1.50.2.3 2006/06/03 18:59:55 andrei Exp $ */
+/* $Id: php_array.h,v 1.50.2.2.2.2 2006/07/15 10:21:09 helly Exp $ */
#ifndef PHP_ARRAY_H
#define PHP_ARRAY_H
@@ -54,6 +54,7 @@ PHP_FUNCTION(array_search);
PHP_FUNCTION(extract);
PHP_FUNCTION(compact);
PHP_FUNCTION(array_fill);
+PHP_FUNCTION(array_fill_keys);
PHP_FUNCTION(range);
PHP_FUNCTION(shuffle);
PHP_FUNCTION(array_multisort);
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index db2157396..bc792edd3 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -17,7 +17,7 @@
| Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_fopen_wrapper.c,v 1.45.2.4 2006/05/01 16:02:07 helly Exp $ */
+/* $Id: php_fopen_wrapper.c,v 1.45.2.4.2.2 2006/07/05 17:38:14 iliaa Exp $ */
#include <stdio.h>
#include <stdlib.h>
@@ -171,7 +171,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
path += 11;
max_memory = strtol(path, NULL, 10);
if (max_memory < 0) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Max memory must be >= 0");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0");
return NULL;
}
}
@@ -207,7 +207,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
pathdup = estrndup(path + 6, strlen(path + 6));
p = strstr(pathdup, "/resource=");
if (!p) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "No URL resource specified.");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "No URL resource specified.");
efree(pathdup);
return NULL;
}
diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h
index 4c1403c29..d4f38d217 100644
--- a/ext/standard/php_string.h
+++ b/ext/standard/php_string.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_string.h,v 1.87.2.2 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: php_string.h,v 1.87.2.2.2.1 2006/08/28 23:33:37 iliaa Exp $ */
/* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
@@ -134,7 +134,7 @@ PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zval *return_v
PHPAPI size_t php_strip_tags(char *rbuf, int len, int *state, char *allow, int allow_len);
PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_len, zval *result, int case_sensitivity, int *replace_count);
PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int to_len, zval *result);
-PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value);
+PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC);
PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, int limit);
PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end);
diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h
index 827685ec8..332aa4f86 100644
--- a/ext/standard/php_var.h
+++ b/ext/standard/php_var.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_var.h,v 1.30.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: php_var.h,v 1.30.2.1.2.1 2006/05/30 14:51:20 iliaa Exp $ */
#ifndef PHP_VAR_H
#define PHP_VAR_H
@@ -30,6 +30,7 @@ PHP_FUNCTION(serialize);
PHP_FUNCTION(unserialize);
#if MEMORY_LIMIT
PHP_FUNCTION(memory_get_usage);
+PHP_FUNCTION(memory_get_peak_usage);
#endif
PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC);
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 6ce2323e0..8d7bc669f 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -15,7 +15,7 @@
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: proc_open.c,v 1.36.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: proc_open.c,v 1.36.2.1.2.1 2006/06/01 14:03:49 tony2001 Exp $ */
#if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
# define _BSD_SOURCE /* linux wants this when XOPEN mode is on */
@@ -501,7 +501,9 @@ PHP_FUNCTION(proc_open)
php_process_id_t child;
struct php_process_handle *proc;
int is_persistent = 0; /* TODO: ensure that persistent procs will work */
+#ifdef PHP_WIN32
int suppress_errors = 0;
+#endif
#if PHP_CAN_DO_PTS
php_file_descriptor_t dev_ptmx = -1; /* master */
php_file_descriptor_t slave_pty = -1;
@@ -517,6 +519,7 @@ PHP_FUNCTION(proc_open)
RETURN_FALSE;
}
+#ifdef PHP_WIN32
if (other_options) {
zval **item;
if (SUCCESS == zend_hash_find(Z_ARRVAL_P(other_options), "suppress_errors", sizeof("suppress_errors"), (void**)&item)) {
@@ -525,6 +528,7 @@ PHP_FUNCTION(proc_open)
}
}
}
+#endif
command_len = strlen(command);
diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c
index c40a29a63..7659cce40 100644
--- a/ext/standard/scanf.c
+++ b/ext/standard/scanf.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: scanf.c,v 1.31.2.3 2006/08/04 20:34:31 tony2001 Exp $ */
+/* $Id: scanf.c,v 1.31.2.2.2.1 2006/08/04 11:50:15 tony2001 Exp $ */
/*
scanf.c --
diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h
index 2ddb2a364..c55207955 100644
--- a/ext/standard/sha1.h
+++ b/ext/standard/sha1.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sha1.h,v 1.5.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: sha1.h,v 1.5.2.1.2.1 2006/09/29 22:35:47 iliaa Exp $ */
#ifndef SHA1_H
#define SHA1_H
@@ -33,6 +33,7 @@ typedef struct {
PHPAPI void PHP_SHA1Init(PHP_SHA1_CTX *);
PHPAPI void PHP_SHA1Update(PHP_SHA1_CTX *, const unsigned char *, unsigned int);
PHPAPI void PHP_SHA1Final(unsigned char[20], PHP_SHA1_CTX *);
+PHPAPI void make_sha1_digest(char *sha1str, unsigned char *digest);
PHP_FUNCTION(sha1);
PHP_FUNCTION(sha1_file);
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 05d1efdcd..9a1564cb9 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.c,v 1.58.2.6 2006/04/19 08:43:29 tony2001 Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.9 2006/10/11 23:22:45 pollita Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -33,8 +33,10 @@
#ifndef PHP_WIN32
#define php_select(m, r, w, e, t) select(m, r, w, e, t)
+typedef unsigned long long php_timeout_ull;
#else
#include "win32/select.h"
+typedef unsigned __int64 php_timeout_ull;
#endif
static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC);
@@ -81,7 +83,7 @@ PHP_FUNCTION(stream_socket_client)
int host_len;
zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL;
double timeout = FG(default_socket_timeout);
- unsigned long conv;
+ php_timeout_ull conv;
struct timeval tv;
char *hashkey = NULL;
php_stream *stream = NULL;
@@ -103,7 +105,7 @@ PHP_FUNCTION(stream_socket_client)
}
/* prepare the timeout value for use */
- conv = (unsigned long) (timeout * 1000000.0);
+ conv = (php_timeout_ull) (timeout * 1000000.0);
tv.tv_sec = conv / 1000000;
tv.tv_usec = conv % 1000000;
@@ -231,7 +233,7 @@ PHP_FUNCTION(stream_socket_accept)
{
double timeout = FG(default_socket_timeout);
zval *peername = NULL;
- unsigned long conv;
+ php_timeout_ull conv;
struct timeval tv;
php_stream *stream = NULL, *clistream = NULL;
zval *zstream;
@@ -245,7 +247,7 @@ PHP_FUNCTION(stream_socket_accept)
php_stream_from_zval(stream, &zstream);
/* prepare the timeout value for use */
- conv = (unsigned long) (timeout * 1000000.0);
+ conv = (php_timeout_ull) (timeout * 1000000.0);
tv.tv_sec = conv / 1000000;
tv.tv_usec = conv % 1000000;
@@ -309,7 +311,7 @@ PHP_FUNCTION(stream_socket_sendto)
php_stream *stream;
zval *zstream;
long flags = 0;
- char *data, *target_addr;
+ char *data, *target_addr = NULL;
int datalen, target_addr_len = 0;
php_sockaddr_storage sa;
socklen_t sl = 0;
@@ -404,7 +406,7 @@ PHP_FUNCTION(stream_get_contents)
php_stream_from_zval(stream, &zsrc);
if (pos > 0 && php_stream_seek(stream, pos, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to %ld position in the stream.", pos);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream.", pos);
RETURN_FALSE;
}
@@ -440,7 +442,7 @@ PHP_FUNCTION(stream_copy_to_stream)
php_stream_from_zval(dest, &zdest);
if (pos > 0 && php_stream_seek(src, pos, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to %ld position in the stream.", pos);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream.", pos);
RETURN_FALSE;
}
@@ -448,7 +450,7 @@ PHP_FUNCTION(stream_copy_to_stream)
}
/* }}} */
-/* {{{ proto resource stream_get_meta_data(resource fp)
+/* {{{ proto array stream_get_meta_data(resource fp)
Retrieves header/meta data from streams/file pointers */
PHP_FUNCTION(stream_get_meta_data)
{
@@ -612,7 +614,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
return 0;
}
ALLOC_HASHTABLE(new_hash);
- zend_hash_init(new_hash, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(new_hash, zend_hash_num_elements(Z_ARRVAL_P(stream_array)), NULL, ZVAL_PTR_DTOR, 0);
for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(stream_array));
zend_hash_get_current_data(Z_ARRVAL_P(stream_array), (void **) &elem) == SUCCESS;
@@ -660,7 +662,7 @@ static int stream_array_emulate_read_fd_set(zval *stream_array TSRMLS_DC)
return 0;
}
ALLOC_HASHTABLE(new_hash);
- zend_hash_init(new_hash, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(new_hash, zend_hash_num_elements(Z_ARRVAL_P(stream_array)), NULL, ZVAL_PTR_DTOR, 0);
for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(stream_array));
zend_hash_get_current_data(Z_ARRVAL_P(stream_array), (void **) &elem) == SUCCESS;
@@ -706,7 +708,7 @@ static int stream_array_emulate_read_fd_set(zval *stream_array TSRMLS_DC)
Runs the select() system call on the sets of streams with a timeout specified by tv_sec and tv_usec */
PHP_FUNCTION(stream_select)
{
- zval *r_array, *w_array, *e_array, *sec = NULL;
+ zval *r_array, *w_array, *e_array, **sec = NULL;
struct timeval tv;
struct timeval *tv_p = NULL;
fd_set rfds, wfds, efds;
@@ -715,7 +717,7 @@ PHP_FUNCTION(stream_select)
long usec = 0;
int set_count, max_set_count = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!a!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!a!Z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
return;
FD_ZERO(&rfds);
@@ -752,9 +754,9 @@ PHP_FUNCTION(stream_select)
/* If seconds is not set to null, build the timeval, else we wait indefinitely */
if (sec != NULL) {
- convert_to_long(sec);
+ convert_to_long_ex(sec);
- if (Z_LVAL_P(sec) < 0) {
+ if (Z_LVAL_PP(sec) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds parameter must be greater than 0.");
RETURN_FALSE;
} else if (usec < 0) {
@@ -764,10 +766,10 @@ PHP_FUNCTION(stream_select)
/* Solaris + BSD do not like microsecond values which are >= 1 sec */
if (usec > 999999) {
- tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000);
+ tv.tv_sec = Z_LVAL_PP(sec) + (usec / 1000000);
tv.tv_usec = usec % 1000000;
} else {
- tv.tv_sec = Z_LVAL_P(sec);
+ tv.tv_sec = Z_LVAL_PP(sec);
tv.tv_usec = usec;
}
@@ -1117,6 +1119,7 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS)
RETURN_FALSE;
}
}
+/* }}} */
/* {{{ proto resource stream_filter_prepend(resource stream, string filtername[, int read_write[, string filterparams]])
Prepend a filter to a stream */
@@ -1171,7 +1174,7 @@ PHP_FUNCTION(stream_filter_remove)
PHP_FUNCTION(stream_get_line)
{
char *str = NULL;
- int str_len;
+ int str_len = 0;
long max_length;
zval *zstream;
char *buf;
@@ -1225,15 +1228,6 @@ PHP_FUNCTION(stream_set_blocking)
/* }}} */
-/* {{{ proto bool set_socket_blocking(resource socket, int mode)
- Set blocking/non-blocking mode on a socket */
-PHP_FUNCTION(set_socket_blocking)
-{
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "This function is deprecated, use stream_set_blocking() instead");
- PHP_FN(stream_set_blocking)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-}
-/* }}} */
-
/* {{{ proto bool stream_set_timeout(resource stream, int seconds, int microseconds)
Set timeout on stream read to seconds + microseonds */
#if HAVE_SYS_TIME_H || defined(PHP_WIN32)
diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h
index c72575b78..338f606ed 100644
--- a/ext/standard/streamsfuncs.h
+++ b/ext/standard/streamsfuncs.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.h,v 1.13.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: streamsfuncs.h,v 1.13.2.1.2.1 2006/06/26 16:33:39 bjori Exp $ */
/* Flags for stream_socket_client */
#define PHP_STREAM_CLIENT_PERSISTENT 1
@@ -33,7 +33,6 @@ PHP_FUNCTION(stream_socket_sendto);
PHP_FUNCTION(stream_copy_to_stream);
PHP_FUNCTION(stream_get_contents);
-PHP_FUNCTION(set_socket_blocking); /* deprecated */
PHP_FUNCTION(stream_set_blocking);
PHP_FUNCTION(stream_select);
PHP_FUNCTION(stream_set_timeout);
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 67d6b1cf4..0b1b19d75 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.445.2.16 2006/08/10 17:46:43 iliaa Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.27 2006/10/11 14:19:55 iliaa Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -59,7 +59,8 @@
#define PHP_PATHINFO_DIRNAME 1
#define PHP_PATHINFO_BASENAME 2
#define PHP_PATHINFO_EXTENSION 4
-#define PHP_PATHINFO_ALL (PHP_PATHINFO_DIRNAME | PHP_PATHINFO_BASENAME | PHP_PATHINFO_EXTENSION)
+#define PHP_PATHINFO_FILENAME 8
+#define PHP_PATHINFO_ALL (PHP_PATHINFO_DIRNAME | PHP_PATHINFO_BASENAME | PHP_PATHINFO_EXTENSION | PHP_PATHINFO_FILENAME)
#define STR_STRSPN 0
#define STR_STRCSPN 1
@@ -74,6 +75,7 @@ void register_string_constants(INIT_FUNC_ARGS)
REGISTER_LONG_CONSTANT("PATHINFO_DIRNAME", PHP_PATHINFO_DIRNAME, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PATHINFO_BASENAME", PHP_PATHINFO_BASENAME, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PATHINFO_EXTENSION", PHP_PATHINFO_EXTENSION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PATHINFO_FILENAME", PHP_PATHINFO_FILENAME, CONST_CS | CONST_PERSISTENT);
#ifdef HAVE_LOCALECONV
/* If last members of struct lconv equal CHAR_MAX, no grouping is done */
@@ -668,7 +670,7 @@ PHP_FUNCTION(wordwrap)
lastspace = current;
} else if (current - laststart >= linelength && laststart != lastspace) {
newtext[lastspace] = breakchar[0];
- laststart = lastspace;
+ laststart = lastspace + 1;
}
}
@@ -878,12 +880,14 @@ PHP_FUNCTION(explode)
/* {{{ php_implode
*/
-PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value)
+PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC)
{
zval **tmp;
HashPosition pos;
smart_str implstr = {0};
int numelems, i = 0;
+ zval tmp_val;
+ int str_len;
numelems = zend_hash_num_elements(Z_ARRVAL_P(arr));
@@ -894,12 +898,56 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value)
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos);
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **) &tmp, &pos) == SUCCESS) {
- if ((*tmp)->type != IS_STRING) {
- SEPARATE_ZVAL(tmp);
- convert_to_string(*tmp);
- }
-
- smart_str_appendl(&implstr, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ switch ((*tmp)->type) {
+ case IS_STRING:
+ smart_str_appendl(&implstr, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ break;
+
+ case IS_LONG: {
+ char stmp[MAX_LENGTH_OF_LONG + 1];
+ str_len = sprintf(stmp, "%ld", Z_LVAL_PP(tmp));
+ smart_str_appendl(&implstr, stmp, str_len);
+ }
+ break;
+
+ case IS_BOOL:
+ if (Z_LVAL_PP(tmp) == 1) {
+ smart_str_appendl(&implstr, "1", sizeof("1")-1);
+ }
+ break;
+
+ case IS_NULL:
+ break;
+
+ case IS_DOUBLE: {
+ char *stmp;
+ str_len = spprintf(&stmp, 0, "%.*G", (int) EG(precision), Z_DVAL_PP(tmp));
+ smart_str_appendl(&implstr, stmp, str_len);
+ efree(stmp);
+ }
+ break;
+
+ case IS_OBJECT: {
+ int copy;
+ zval expr;
+ zend_make_printable_zval(*tmp, &expr, &copy);
+ smart_str_appendl(&implstr, Z_STRVAL(expr), Z_STRLEN(expr));
+ if (copy) {
+ zval_dtor(&expr);
+ }
+ }
+ break;
+
+ default:
+ tmp_val = **tmp;
+ zval_copy_ctor(&tmp_val);
+ convert_to_string(&tmp_val);
+ smart_str_appendl(&implstr, Z_STRVAL(tmp_val), Z_STRLEN(tmp_val));
+ zval_dtor(&tmp_val);
+ break;
+
+ }
+
if (++i != numelems) {
smart_str_appendl(&implstr, Z_STRVAL_P(delim), Z_STRLEN_P(delim));
}
@@ -917,6 +965,7 @@ PHP_FUNCTION(implode)
{
zval **arg1 = NULL, **arg2 = NULL, *delim, *arr;
int argc = ZEND_NUM_ARGS();
+ HashPosition pos;
if (argc < 1 || argc > 2 ||
zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE) {
@@ -937,12 +986,10 @@ PHP_FUNCTION(implode)
arr = *arg1;
} else {
if (Z_TYPE_PP(arg1) == IS_ARRAY) {
- SEPARATE_ZVAL(arg1);
arr = *arg1;
convert_to_string_ex(arg2);
delim = *arg2;
} else if (Z_TYPE_PP(arg2) == IS_ARRAY) {
- SEPARATE_ZVAL(arg2);
arr = *arg2;
convert_to_string_ex(arg1);
delim = *arg1;
@@ -952,7 +999,11 @@ PHP_FUNCTION(implode)
}
}
- php_implode(delim, arr, return_value);
+ pos = Z_ARRVAL_P(arr)->pInternalPointer;
+
+ php_implode(delim, arr, return_value TSRMLS_CC);
+
+ Z_ARRVAL_P(arr)->pInternalPointer = pos;
if (argc == 1) {
FREE_ZVAL(delim);
@@ -1157,7 +1208,12 @@ PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t sufflen, char
state = 1;
}
}
+ break;
default:
+ if (state == 0) {
+ comp = c;
+ state = 1;
+ }
break;
}
c += inc_len;
@@ -1319,13 +1375,13 @@ PHP_FUNCTION(dirname)
}
/* }}} */
-/* {{{ proto array pathinfo(string path)
+/* {{{ proto array pathinfo(string path[, int options])
Returns information about a certain string */
PHP_FUNCTION(pathinfo)
{
zval *tmp;
char *path, *ret = NULL;
- int path_len;
+ int path_len, have_basename;
size_t ret_len;
long opt = PHP_PATHINFO_ALL;
@@ -1333,6 +1389,8 @@ PHP_FUNCTION(pathinfo)
return;
}
+ have_basename = ((opt & PHP_PATHINFO_BASENAME) == PHP_PATHINFO_BASENAME);
+
MAKE_STD_ZVAL(tmp);
array_init(tmp);
@@ -1343,33 +1401,47 @@ PHP_FUNCTION(pathinfo)
add_assoc_string(tmp, "dirname", ret, 1);
}
efree(ret);
+ ret = NULL;
}
- if ((opt & PHP_PATHINFO_BASENAME) == PHP_PATHINFO_BASENAME) {
+ if (have_basename) {
php_basename(path, path_len, NULL, 0, &ret, &ret_len TSRMLS_CC);
add_assoc_stringl(tmp, "basename", ret, ret_len, 0);
- }
+ }
if ((opt & PHP_PATHINFO_EXTENSION) == PHP_PATHINFO_EXTENSION) {
char *p;
int idx;
- int have_basename = ((opt & PHP_PATHINFO_BASENAME) == PHP_PATHINFO_BASENAME);
- /* Have we alrady looked up the basename? */
if (!have_basename) {
php_basename(path, path_len, NULL, 0, &ret, &ret_len TSRMLS_CC);
}
- p = strrchr(ret, '.');
+ p = zend_memrchr(ret, '.', ret_len);
if (p) {
idx = p - ret;
add_assoc_stringl(tmp, "extension", ret + idx + 1, ret_len - idx - 1, 1);
}
+ }
+
+ if ((opt & PHP_PATHINFO_FILENAME) == PHP_PATHINFO_FILENAME) {
+ char *p;
+ int idx;
- if (!have_basename) {
- efree(ret);
+ /* Have we alrady looked up the basename? */
+ if (!have_basename && !ret) {
+ php_basename(path, path_len, NULL, 0, &ret, &ret_len TSRMLS_CC);
}
+
+ p = zend_memrchr(ret, '.', ret_len);
+
+ idx = p ? (p - ret) : ret_len;
+ add_assoc_stringl(tmp, "filename", ret, idx, 1);
+ }
+
+ if (!have_basename && ret) {
+ efree(ret);
}
if (opt == PHP_PATHINFO_ALL) {
@@ -1428,7 +1500,7 @@ PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end)
if (*spanp == c || p == s1_end) {
return p - s1;
}
- } while (spanp++ < s2_end);
+ } while (spanp++ < (s2_end - 1));
c = *++p;
}
/* NOTREACHED */
@@ -1613,8 +1685,8 @@ PHP_FUNCTION(stripos)
RETURN_FALSE;
}
- if (haystack_len == 0) {
- RETURN_FALSE;
+ if (haystack_len == 0) {
+ RETURN_FALSE;
}
haystack_dup = estrndup(haystack, haystack_len);
@@ -1622,9 +1694,10 @@ PHP_FUNCTION(stripos)
if (Z_TYPE_P(needle) == IS_STRING) {
if (Z_STRLEN_P(needle) == 0 || Z_STRLEN_P(needle) > haystack_len) {
- efree(haystack_dup);
- RETURN_FALSE;
- }
+ efree(haystack_dup);
+ RETURN_FALSE;
+ }
+
needle_dup = estrndup(Z_STRVAL_P(needle), Z_STRLEN_P(needle));
php_strtolower(needle_dup, Z_STRLEN_P(needle));
found = php_memnstr(haystack_dup + offset, needle_dup, Z_STRLEN_P(needle), haystack_dup + haystack_len);
@@ -1668,22 +1741,22 @@ PHP_FUNCTION(stripos)
Finds position of last occurrence of a string within another string */
PHP_FUNCTION(strrpos)
{
- zval *zneedle;
+ zval **zneedle;
char *needle, *haystack;
int needle_len, haystack_len;
long offset = 0;
char *p, *e, ord_needle[2];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &haystack, &haystack_len, &zneedle, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ|l", &haystack, &haystack_len, &zneedle, &offset) == FAILURE) {
RETURN_FALSE;
}
- if (Z_TYPE_P(zneedle) == IS_STRING) {
- needle = Z_STRVAL_P(zneedle);
- needle_len = Z_STRLEN_P(zneedle);
+ if (Z_TYPE_PP(zneedle) == IS_STRING) {
+ needle = Z_STRVAL_PP(zneedle);
+ needle_len = Z_STRLEN_PP(zneedle);
} else {
- convert_to_long(zneedle);
- ord_needle[0] = (char)(Z_LVAL_P(zneedle) & 0xFF);
+ convert_to_long_ex(zneedle);
+ ord_needle[0] = (char)(Z_LVAL_PP(zneedle) & 0xFF);
ord_needle[1] = '\0';
needle = ord_needle;
needle_len = 1;
@@ -1694,13 +1767,20 @@ PHP_FUNCTION(strrpos)
}
if (offset >= 0) {
+ if (offset > haystack_len) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
+ }
p = haystack + offset;
e = haystack + haystack_len - needle_len;
} else {
- p = haystack;
if (-offset > haystack_len) {
- e = haystack - needle_len;
- } else if (needle_len > -offset) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
+ }
+
+ p = haystack;
+ if (needle_len > -offset) {
e = haystack + haystack_len - needle_len;
} else {
e = haystack + haystack_len + offset;
@@ -1733,23 +1813,23 @@ PHP_FUNCTION(strrpos)
Finds position of last occurrence of a string within another string */
PHP_FUNCTION(strripos)
{
- zval *zneedle;
+ zval **zneedle;
char *needle, *haystack;
int needle_len, haystack_len;
long offset = 0;
char *p, *e, ord_needle[2];
char *needle_dup, *haystack_dup;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &haystack, &haystack_len, &zneedle, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ|l", &haystack, &haystack_len, &zneedle, &offset) == FAILURE) {
RETURN_FALSE;
}
- if (Z_TYPE_P(zneedle) == IS_STRING) {
- needle = Z_STRVAL_P(zneedle);
- needle_len = Z_STRLEN_P(zneedle);
+ if (Z_TYPE_PP(zneedle) == IS_STRING) {
+ needle = Z_STRVAL_PP(zneedle);
+ needle_len = Z_STRLEN_PP(zneedle);
} else {
- convert_to_long(zneedle);
- ord_needle[0] = (char)(Z_LVAL_P(zneedle) & 0xFF);
+ convert_to_long_ex(zneedle);
+ ord_needle[0] = (char)(Z_LVAL_PP(zneedle) & 0xFF);
ord_needle[1] = '\0';
needle = ord_needle;
needle_len = 1;
@@ -1763,12 +1843,17 @@ PHP_FUNCTION(strripos)
/* Single character search can shortcut memcmps
Can also avoid tolower emallocs */
if (offset >= 0) {
+ if (offset > haystack_len) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
+ }
p = haystack + offset;
e = haystack + haystack_len - 1;
} else {
p = haystack;
if (-offset > haystack_len) {
- e = haystack + haystack_len - 1;
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
} else {
e = haystack + haystack_len + offset;
}
@@ -1790,13 +1875,19 @@ PHP_FUNCTION(strripos)
php_strtolower(haystack_dup, haystack_len);
if (offset >= 0) {
+ if (offset > haystack_len) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
+ }
p = haystack_dup + offset;
e = haystack_dup + haystack_len - needle_len;
} else {
- p = haystack_dup;
if (-offset > haystack_len) {
- e = haystack_dup - needle_len;
- } else if (needle_len > -offset) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
+ }
+ p = haystack_dup;
+ if (needle_len > -offset) {
e = haystack_dup + haystack_len - needle_len;
} else {
e = haystack_dup + haystack_len + offset;
@@ -1833,10 +1924,10 @@ PHP_FUNCTION(strrchr)
convert_to_string_ex(haystack);
if (Z_TYPE_PP(needle) == IS_STRING) {
- found = strrchr(Z_STRVAL_PP(haystack), *Z_STRVAL_PP(needle));
+ found = zend_memrchr(Z_STRVAL_PP(haystack), *Z_STRVAL_PP(needle), Z_STRLEN_PP(haystack));
} else {
convert_to_long_ex(needle);
- found = strrchr(Z_STRVAL_PP(haystack), (char) Z_LVAL_PP(needle));
+ found = zend_memrchr(Z_STRVAL_PP(haystack), (char) Z_LVAL_PP(needle), Z_STRLEN_PP(haystack));
}
if (found) {
@@ -2405,7 +2496,7 @@ static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *
smart_str result = {0};
HashTable tmp_hash;
- zend_hash_init(&tmp_hash, 0, NULL, NULL, 0);
+ zend_hash_init(&tmp_hash, zend_hash_num_elements(hash), NULL, NULL, 0);
zend_hash_internal_pointer_reset_ex(hash, &hpos);
while (zend_hash_get_current_data_ex(hash, (void **)&entry, &hpos) == SUCCESS) {
switch (zend_hash_get_current_key_ex(hash, &string_key, &string_key_len, &num_key, 0, &hpos)) {
@@ -2497,7 +2588,7 @@ static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *
}
/* }}} */
-/* {{{ proto string strtr(string str, string from, string to)
+/* {{{ proto string strtr(string str, string from[, string to])
Translates characters in str using given translation tables */
PHP_FUNCTION(strtr)
{
@@ -3031,10 +3122,18 @@ PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_l
int char_count = 0;
int replaced = 0;
char *source, *target, *tmp, *source_end=str+len, *tmp_end = NULL;
-
- for (source = str; source < source_end; source++) {
- if ((case_sensitivity && *source == from) || (!case_sensitivity && tolower(*source) == tolower(from))) {
+
+ if (case_sensitivity) {
+ char *p = str, *e = p + len;
+ while ((p = memchr(p, from, (e - p)))) {
char_count++;
+ p++;
+ }
+ } else {
+ for (source = str; source < source_end; source++) {
+ if (tolower(*source) == tolower(from)) {
+ char_count++;
+ }
}
}
@@ -3046,20 +3145,39 @@ PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_l
Z_STRLEN_P(result) = len + (char_count * (to_len - 1));
Z_STRVAL_P(result) = target = emalloc(Z_STRLEN_P(result) + 1);
Z_TYPE_P(result) = IS_STRING;
-
- for (source = str; source < source_end; source++) {
- if ((case_sensitivity && *source == from) || (!case_sensitivity && tolower(*source) == tolower(from))) {
- replaced = 1;
+
+ if (case_sensitivity) {
+ char *p = str, *e = p + len, *s = str;
+ while ((p = memchr(p, from, (e - p)))) {
+ memcpy(target, s, (p - s));
+ target += p - s;
+ memcpy(target, to, to_len);
+ target += to_len;
+ p++;
+ s = p;
if (replace_count) {
*replace_count += 1;
}
- for (tmp = to, tmp_end = tmp+to_len; tmp < tmp_end; tmp++) {
- *target = *tmp;
+ }
+ if (s < e) {
+ memcpy(target, s, (e - s));
+ target += e - s;
+ }
+ } else {
+ for (source = str; source < source_end; source++) {
+ if (tolower(*source) == tolower(from)) {
+ replaced = 1;
+ if (replace_count) {
+ *replace_count += 1;
+ }
+ for (tmp = to, tmp_end = tmp+to_len; tmp < tmp_end; tmp++) {
+ *target = *tmp;
+ target++;
+ }
+ } else {
+ *target = *source;
target++;
}
- } else {
- *target = *source;
- target++;
}
}
*target = 0;
@@ -4730,7 +4848,26 @@ PHP_FUNCTION(str_word_count)
long type = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len, &type, &char_list, &char_list_len) == FAILURE) {
- WRONG_PARAM_COUNT;
+ return;
+ }
+
+ switch(type) {
+ case 1:
+ case 2:
+ array_init(return_value);
+ if (!str_len) {
+ return;
+ }
+ break;
+ case 0:
+ if (!str_len) {
+ RETURN_LONG(0);
+ }
+ /* nothing to be done */
+ break;
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid format value %ld", type);
+ RETURN_FALSE;
}
if (char_list) {
@@ -4739,10 +4876,6 @@ PHP_FUNCTION(str_word_count)
p = str;
e = str + str_len;
-
- if (type == 1 || type == 2) {
- array_init(return_value);
- }
/* first character cannot be ' or -, unless explicitly allowed by the user */
if ((*p == '\'' && (!char_list || !ch['\''])) || (*p == '-' && (!char_list || !ch['-']))) {
diff --git a/ext/standard/tests/array/007.phpt b/ext/standard/tests/array/007.phpt
index 0e5c32af2..45cc9b6c2 100644
--- a/ext/standard/tests/array/007.phpt
+++ b/ext/standard/tests/array/007.phpt
@@ -61,6 +61,10 @@ class cr {
if ($a->priv_member === $b->priv_member) return 0;
return ($a->priv_member > $b->priv_member)? 1:-1;
}
+
+ function __toString() {
+ return "Object";
+ }
}
function comp_func($a, $b) {
@@ -309,21 +313,21 @@ $b=array (
var_dump(array_udiff_uassoc($a, $b, "comp_func_cr", "comp_func"));
array(3) {
["0.1"]=>
- object(cr)#1 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
["0.5"]=>
- object(cr)#2 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
- object(cr)#3 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
@@ -387,21 +391,21 @@ $b=array (
var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func"));
array(3) {
["0.1"]=>
- object(cr)#1 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
["0.5"]=>
- object(cr)#2 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
- object(cr)#3 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
@@ -463,42 +467,14 @@ $b=array (
)),
);
var_dump(array_diff_assoc($a, $b));
-array(5) {
+array(1) {
["0.1"]=>
- object(cr)#1 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
- ["0.5"]=>
- object(cr)#2 (2) {
- ["priv_member:private"]=>
- int(12)
- ["public_member"]=>
- int(12)
- }
- [0]=>
- object(cr)#3 (2) {
- ["priv_member:private"]=>
- int(23)
- ["public_member"]=>
- int(23)
- }
- [1]=>
- object(cr)#4 (2) {
- ["priv_member:private"]=>
- int(4)
- ["public_member"]=>
- int(4)
- }
- [2]=>
- object(cr)#5 (2) {
- ["priv_member:private"]=>
- int(-15)
- ["public_member"]=>
- int(-15)
- }
}
$a=array (
'0.1' =>
@@ -557,14 +533,14 @@ $b=array (
var_dump(array_udiff($a, $b, "comp_func_cr"));
array(2) {
["0.5"]=>
- object(cr)#2 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
- object(cr)#3 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
@@ -628,21 +604,21 @@ $b=array (
var_dump(array_udiff_assoc($a, $b, "comp_func_cr"));
array(3) {
["0.1"]=>
- object(cr)#1 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
["0.5"]=>
- object(cr)#2 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
- object(cr)#3 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
diff --git a/ext/standard/tests/array/array_fill.phpt b/ext/standard/tests/array/array_fill.phpt
new file mode 100644
index 000000000..8220ef4ce
--- /dev/null
+++ b/ext/standard/tests/array/array_fill.phpt
@@ -0,0 +1,366 @@
+--TEST--
+basic array_fill test
+--FILE--
+<?php
+$array1 = array(0.0, 1, 2.5);
+$array2 = array(TRUE, FALSE, NULL, "d", "e", "f");
+foreach($array1 as $start)
+{
+ foreach($array1 as $num)
+ {
+ foreach($array2 as $value)
+ {
+ echo '==========================='."\n";
+ echo 'start: '.$start.' num: '.$num.' value: '.$value."\n";
+ $output = array_fill($start, $num, $value);
+ var_dump($output);
+ }
+ }
+}
+echo '== Done ==';
+?>
+===============Done====================
+--EXPECTF--
+===========================
+start: 0 num: 0 value: 1
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 0 value: d
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 0 value: e
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 0 value: f
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 1 value: 1
+array(1) {
+ [0]=>
+ bool(true)
+}
+===========================
+start: 0 num: 1 value:
+array(1) {
+ [0]=>
+ bool(false)
+}
+===========================
+start: 0 num: 1 value:
+array(1) {
+ [0]=>
+ NULL
+}
+===========================
+start: 0 num: 1 value: d
+array(1) {
+ [0]=>
+ string(1) "d"
+}
+===========================
+start: 0 num: 1 value: e
+array(1) {
+ [0]=>
+ string(1) "e"
+}
+===========================
+start: 0 num: 1 value: f
+array(1) {
+ [0]=>
+ string(1) "f"
+}
+===========================
+start: 0 num: 2.5 value: 1
+array(2) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+}
+===========================
+start: 0 num: 2.5 value:
+array(2) {
+ [0]=>
+ bool(false)
+ [1]=>
+ bool(false)
+}
+===========================
+start: 0 num: 2.5 value:
+array(2) {
+ [0]=>
+ NULL
+ [1]=>
+ NULL
+}
+===========================
+start: 0 num: 2.5 value: d
+array(2) {
+ [0]=>
+ string(1) "d"
+ [1]=>
+ string(1) "d"
+}
+===========================
+start: 0 num: 2.5 value: e
+array(2) {
+ [0]=>
+ string(1) "e"
+ [1]=>
+ string(1) "e"
+}
+===========================
+start: 0 num: 2.5 value: f
+array(2) {
+ [0]=>
+ string(1) "f"
+ [1]=>
+ string(1) "f"
+}
+===========================
+start: 1 num: 0 value: 1
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 0 value: d
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 0 value: e
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 0 value: f
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 1 value: 1
+array(1) {
+ [1]=>
+ bool(true)
+}
+===========================
+start: 1 num: 1 value:
+array(1) {
+ [1]=>
+ bool(false)
+}
+===========================
+start: 1 num: 1 value:
+array(1) {
+ [1]=>
+ NULL
+}
+===========================
+start: 1 num: 1 value: d
+array(1) {
+ [1]=>
+ string(1) "d"
+}
+===========================
+start: 1 num: 1 value: e
+array(1) {
+ [1]=>
+ string(1) "e"
+}
+===========================
+start: 1 num: 1 value: f
+array(1) {
+ [1]=>
+ string(1) "f"
+}
+===========================
+start: 1 num: 2.5 value: 1
+array(2) {
+ [1]=>
+ bool(true)
+ [2]=>
+ bool(true)
+}
+===========================
+start: 1 num: 2.5 value:
+array(2) {
+ [1]=>
+ bool(false)
+ [2]=>
+ bool(false)
+}
+===========================
+start: 1 num: 2.5 value:
+array(2) {
+ [1]=>
+ NULL
+ [2]=>
+ NULL
+}
+===========================
+start: 1 num: 2.5 value: d
+array(2) {
+ [1]=>
+ string(1) "d"
+ [2]=>
+ string(1) "d"
+}
+===========================
+start: 1 num: 2.5 value: e
+array(2) {
+ [1]=>
+ string(1) "e"
+ [2]=>
+ string(1) "e"
+}
+===========================
+start: 1 num: 2.5 value: f
+array(2) {
+ [1]=>
+ string(1) "f"
+ [2]=>
+ string(1) "f"
+}
+===========================
+start: 2.5 num: 0 value: 1
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 0 value: d
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 0 value: e
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 0 value: f
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 1 value: 1
+array(1) {
+ [2]=>
+ bool(true)
+}
+===========================
+start: 2.5 num: 1 value:
+array(1) {
+ [2]=>
+ bool(false)
+}
+===========================
+start: 2.5 num: 1 value:
+array(1) {
+ [2]=>
+ NULL
+}
+===========================
+start: 2.5 num: 1 value: d
+array(1) {
+ [2]=>
+ string(1) "d"
+}
+===========================
+start: 2.5 num: 1 value: e
+array(1) {
+ [2]=>
+ string(1) "e"
+}
+===========================
+start: 2.5 num: 1 value: f
+array(1) {
+ [2]=>
+ string(1) "f"
+}
+===========================
+start: 2.5 num: 2.5 value: 1
+array(2) {
+ [2]=>
+ bool(true)
+ [3]=>
+ bool(true)
+}
+===========================
+start: 2.5 num: 2.5 value:
+array(2) {
+ [2]=>
+ bool(false)
+ [3]=>
+ bool(false)
+}
+===========================
+start: 2.5 num: 2.5 value:
+array(2) {
+ [2]=>
+ NULL
+ [3]=>
+ NULL
+}
+===========================
+start: 2.5 num: 2.5 value: d
+array(2) {
+ [2]=>
+ string(1) "d"
+ [3]=>
+ string(1) "d"
+}
+===========================
+start: 2.5 num: 2.5 value: e
+array(2) {
+ [2]=>
+ string(1) "e"
+ [3]=>
+ string(1) "e"
+}
+===========================
+start: 2.5 num: 2.5 value: f
+array(2) {
+ [2]=>
+ string(1) "f"
+ [3]=>
+ string(1) "f"
+}
+== Done =================Done====================
diff --git a/ext/standard/tests/array/array_fill_keys.phpt b/ext/standard/tests/array/array_fill_keys.phpt
new file mode 100755
index 000000000..65c38234c
--- /dev/null
+++ b/ext/standard/tests/array/array_fill_keys.phpt
@@ -0,0 +1,42 @@
+--TEST--
+basic array_fill_keys test
+--FILE--
+<?php
+ var_dump(array_fill_keys('test', 1));
+ var_dump(array_fill_keys(array(), 1));
+ var_dump(array_fill_keys(array('foo', 'bar'), NULL));
+ var_dump(array_fill_keys(array('5', 'foo', 10, 1.23), 123));
+ var_dump(array_fill_keys(array('test', TRUE, 10, 100), ''));
+?>
+--EXPECTF--
+
+Warning: array_fill_keys() expects parameter 1 to be array, string given in %s on line %d
+NULL
+array(0) {
+}
+array(2) {
+ ["foo"]=>
+ NULL
+ ["bar"]=>
+ NULL
+}
+array(4) {
+ [5]=>
+ int(123)
+ ["foo"]=>
+ int(123)
+ [10]=>
+ int(123)
+ ["1.23"]=>
+ int(123)
+}
+array(4) {
+ ["test"]=>
+ string(0) ""
+ [1]=>
+ string(0) ""
+ [10]=>
+ string(0) ""
+ [100]=>
+ string(0) ""
+}
diff --git a/ext/standard/tests/array/array_filter.phpt b/ext/standard/tests/array/array_filter.phpt
new file mode 100644
index 000000000..c470c26c9
--- /dev/null
+++ b/ext/standard/tests/array/array_filter.phpt
@@ -0,0 +1,93 @@
+--TEST--
+basic array_filter test
+--FILE--
+<?php
+function odd($var)
+{
+ return($var & 1);
+}
+
+function even($var)
+{
+ return(!($var & 1));
+}
+
+$array1 = array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5);
+$array2 = array(6, 7, 8, 9, 10, 11, 12, 0);
+$array3 = array(TRUE, FALSE, NULL);
+
+echo "Odd :\n";
+var_dump(array_filter($array1, "odd"));
+var_dump(array_filter($array2, "odd"));
+var_dump(array_filter($array3, "odd"));
+echo "Even:\n";
+var_dump(array_filter($array1, "even"));
+var_dump(array_filter($array2, "even"));
+var_dump(array_filter($array3, "even"));
+
+var_dump(array_filter(array()));
+var_dump(array_filter(array(), array()));
+var_dump(array_filter("", null));
+var_dump(array_filter($array1, 1));
+
+echo '== DONE ==';
+?>
+--EXPECTF--
+Odd :
+array(3) {
+ ["a"]=>
+ int(1)
+ ["c"]=>
+ int(3)
+ ["e"]=>
+ int(5)
+}
+array(3) {
+ [1]=>
+ int(7)
+ [3]=>
+ int(9)
+ [5]=>
+ int(11)
+}
+array(1) {
+ [0]=>
+ bool(true)
+}
+Even:
+array(2) {
+ ["b"]=>
+ int(2)
+ ["d"]=>
+ int(4)
+}
+array(5) {
+ [0]=>
+ int(6)
+ [2]=>
+ int(8)
+ [4]=>
+ int(10)
+ [6]=>
+ int(12)
+ [7]=>
+ int(0)
+}
+array(2) {
+ [1]=>
+ bool(false)
+ [2]=>
+ NULL
+}
+array(0) {
+}
+
+Warning: array_filter(): The second argument, 'Array', should be a valid callback in %s on line %d
+NULL
+
+Warning: array_filter(): The first argument should be an array in %s on line %d
+NULL
+
+Warning: array_filter(): The second argument, '1', should be a valid callback in %s on line %d
+NULL
+== DONE ==
diff --git a/ext/standard/tests/array/array_flip.phpt b/ext/standard/tests/array/array_flip.phpt
new file mode 100644
index 000000000..27b14fdd9
--- /dev/null
+++ b/ext/standard/tests/array/array_flip.phpt
@@ -0,0 +1,37 @@
+--TEST--
+basic array_flip test
+--FILE--
+<?php
+$trans = array("a" => 1,
+ "b" => 1,
+ "c" => 2,
+ "z" => 0,
+ "d" => TRUE,
+ "E" => FALSE,
+ "F" => NULL,
+ 0 => "G",
+ 1 => "h",
+ 2 => "i");
+$trans = array_flip($trans);
+var_dump($trans);
+?>
+--EXPECTF--
+Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
+
+Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
+
+Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
+array(6) {
+ [1]=>
+ string(1) "b"
+ [2]=>
+ string(1) "c"
+ [0]=>
+ string(1) "z"
+ ["G"]=>
+ int(0)
+ ["h"]=>
+ int(1)
+ ["i"]=>
+ int(2)
+}
diff --git a/ext/standard/tests/array/array_intersect_1.phpt b/ext/standard/tests/array/array_intersect_1.phpt
index 74c4828c2..39df5cd1b 100644
--- a/ext/standard/tests/array/array_intersect_1.phpt
+++ b/ext/standard/tests/array/array_intersect_1.phpt
@@ -2,7 +2,7 @@
Test of the *intersect* bunch of functions (both assoc and non-assoc)
--FILE--
<?php
-error_reporting(E_ALL);
+error_reporting(E_ALL|E_STRICT);
class cr {
private $priv_member;
public $public_member;
@@ -14,6 +14,10 @@ class cr {
if ($a->priv_member === $b->priv_member) return 0;
return ($a->priv_member > $b->priv_member)? 1:-1;
}
+
+ function __toString() {
+ return "Object";
+ }
}
function comp_func($a, $b) {
@@ -35,7 +39,7 @@ echo "begin ------------ array_intersect() ----------------------------\n";
echo '$a='.var_export($a,TRUE).";\n";
echo '$b='.var_export($b,TRUE).";\n";
echo 'var_dump(array_intersect($a, $b);'."\n";
-var_dump(@array_intersect($a, $b));
+var_dump(array_intersect($a, $b));
echo "end ------------ array_intersect() ----------------------------\n";
/* array_uintersect() */
@@ -51,7 +55,7 @@ echo "begin ------------ array_intersect_assoc() ----------------------\n";
echo '$a='.var_export($a,TRUE).";\n";
echo '$b='.var_export($b,TRUE).";\n";
echo 'var_dump(array_intersect_assoc($a, $b));'."\n";
-var_dump(@array_intersect_assoc($a, $b));
+var_dump(array_intersect_assoc($a, $b));
echo "end ------------ array_intersect_assoc() ----------------------\n";
/* array_uintersect_assoc() */
@@ -67,7 +71,7 @@ echo "begin ------------ array_intersect_uassoc() ---------------------\n";
echo '$a='.var_export($a,TRUE).";\n";
echo '$b='.var_export($b,TRUE).";\n";
echo 'var_dump(array_intersect_uassoc($a, $b, "comp_func"));'."\n";
-var_dump(@array_intersect_uassoc($a, $b, "comp_func"));
+var_dump(array_intersect_uassoc($a, $b, "comp_func"));
echo "end ------------ array_intersect_uassoc() ---------------------\n";
/* array_uintersect_uassoc() - with ordinary function */
@@ -143,7 +147,42 @@ $b=array (
)),
);
var_dump(array_intersect($a, $b);
-array(0) {
+array(5) {
+ ["0.1"]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(9)
+ ["public_member"]=>
+ int(9)
+ }
+ ["0.5"]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(12)
+ ["public_member"]=>
+ int(12)
+ }
+ [0]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(23)
+ ["public_member"]=>
+ int(23)
+ }
+ [1]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(4)
+ ["public_member"]=>
+ int(4)
+ }
+ [2]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(-15)
+ ["public_member"]=>
+ int(-15)
+ }
}
end ------------ array_intersect() ----------------------------
begin ------------ array_uintersect() ---------------------------
@@ -204,21 +243,21 @@ $b=array (
var_dump(array_uintersect($a, $b, "comp_func_cr"));
array(3) {
["0.1"]=>
- object(cr)#1 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
[1]=>
- object(cr)#4 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
- object(cr)#5 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
@@ -282,7 +321,35 @@ $b=array (
)),
);
var_dump(array_intersect_assoc($a, $b));
-array(0) {
+array(4) {
+ ["0.5"]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(12)
+ ["public_member"]=>
+ int(12)
+ }
+ [0]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(23)
+ ["public_member"]=>
+ int(23)
+ }
+ [1]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(4)
+ ["public_member"]=>
+ int(4)
+ }
+ [2]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(-15)
+ ["public_member"]=>
+ int(-15)
+ }
}
end ------------ array_intersect_assoc() ----------------------
begin ------------ array_uintersect_assoc() ---------------------
@@ -343,14 +410,14 @@ $b=array (
var_dump(array_uintersect_assoc($a, $b, "comp_func_cr"));
array(2) {
[1]=>
- object(cr)#4 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
- object(cr)#5 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
@@ -414,7 +481,35 @@ $b=array (
)),
);
var_dump(array_intersect_uassoc($a, $b, "comp_func"));
-array(0) {
+array(4) {
+ ["0.5"]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(12)
+ ["public_member"]=>
+ int(12)
+ }
+ [0]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(23)
+ ["public_member"]=>
+ int(23)
+ }
+ [1]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(4)
+ ["public_member"]=>
+ int(4)
+ }
+ [2]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(-15)
+ ["public_member"]=>
+ int(-15)
+ }
}
end ------------ array_intersect_uassoc() ---------------------
begin ------------ array_uintersect_uassoc() with ordinary func -
@@ -475,14 +570,14 @@ $b=array (
var_dump(array_uintersect_uassoc($a, $b, "comp_func_cr", "comp_func"));
array(2) {
[1]=>
- object(cr)#4 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
- object(cr)#5 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
@@ -548,14 +643,14 @@ $b=array (
var_dump(array_uintersect_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func"));
array(2) {
[1]=>
- object(cr)#4 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
- object(cr)#5 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
diff --git a/ext/standard/tests/array/array_search1.phpt b/ext/standard/tests/array/array_search1.phpt
new file mode 100644
index 000000000..961c771eb
--- /dev/null
+++ b/ext/standard/tests/array/array_search1.phpt
@@ -0,0 +1,35 @@
+--TEST--
+array_search() tests
+--FILE--
+<?php
+
+$a = array(1=>0, 2=>1, 4=>3, "a"=>"b", "c"=>"d");
+
+var_dump(array_search(1));
+var_dump(array_search(1,1));
+var_dump(array_search("a",$a));
+var_dump(array_search("0",$a, true));
+var_dump(array_search("0",$a));
+var_dump(array_search(0,$a));
+var_dump(array_search(1,$a));
+var_dump(array_search("d",$a, true));
+var_dump(array_search("d",$a));
+var_dump(array_search(-1,$a, true));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for array_search() in %s on line %d
+NULL
+
+Warning: array_search(): Wrong datatype for second argument in %s on line %d
+bool(false)
+int(1)
+bool(false)
+int(1)
+int(1)
+int(2)
+string(1) "c"
+int(1)
+bool(false)
+Done
diff --git a/ext/standard/tests/array/array_walk.phpt b/ext/standard/tests/array/array_walk.phpt
new file mode 100644
index 000000000..a0e209831
--- /dev/null
+++ b/ext/standard/tests/array/array_walk.phpt
@@ -0,0 +1,48 @@
+--TEST--
+array_walk() tests
+--FILE--
+<?php
+
+var_dump(array_walk());
+$var = 1;
+var_dump(array_walk($var,1));
+$var = array();
+var_dump(array_walk($var,""));
+
+function foo($v1, $v2, $v3) {
+ var_dump($v1);
+ var_dump($v2);
+ var_dump($v3);
+}
+
+$var = array(1,2);
+var_dump(array_walk($var, "foo", "data"));
+
+function foo2($v1, $v2, $v3) {
+ throw new Exception($v3);
+}
+
+try {
+ var_dump(array_walk($var,"foo2", "data"));
+} catch (Exception $e) {
+ var_dump($e->getMessage());
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: array_walk() expects at least 2 parameters, 0 given in %s on line %d
+NULL
+
+Warning: array_walk(): The argument should be an array in %s on line %d
+bool(false)
+bool(true)
+int(1)
+int(0)
+string(4) "data"
+int(2)
+int(1)
+string(4) "data"
+bool(true)
+string(4) "data"
+Done
diff --git a/ext/standard/tests/array/array_walk_objects.phpt b/ext/standard/tests/array/array_walk_objects.phpt
new file mode 100644
index 000000000..0e838ef25
--- /dev/null
+++ b/ext/standard/tests/array/array_walk_objects.phpt
Binary files differ
diff --git a/ext/standard/tests/array/array_walk_rec_objects.phpt b/ext/standard/tests/array/array_walk_rec_objects.phpt
new file mode 100644
index 000000000..e1c5dd610
--- /dev/null
+++ b/ext/standard/tests/array/array_walk_rec_objects.phpt
Binary files differ
diff --git a/ext/standard/tests/array/array_walk_recursive1.phpt b/ext/standard/tests/array/array_walk_recursive1.phpt
new file mode 100644
index 000000000..8505b70e9
--- /dev/null
+++ b/ext/standard/tests/array/array_walk_recursive1.phpt
@@ -0,0 +1,54 @@
+--TEST--
+array_walk_recursive() tests
+--FILE--
+<?php
+
+var_dump(array_walk_recursive());
+$var = 1;
+var_dump(array_walk_recursive($var,1));
+$var = array();
+var_dump(array_walk_recursive($var,""));
+
+function foo($v1, $v2, $v3) {
+ var_dump($v1);
+ var_dump($v2);
+ var_dump($v3);
+}
+
+$var = array(1,2, array(2,3));
+var_dump(array_walk_recursive($var, "foo", "data"));
+
+function foo2($v1, $v2, $v3) {
+ throw new Exception($v3);
+}
+
+try {
+ var_dump(array_walk_recursive($var,"foo2", "data"));
+} catch (Exception $e) {
+ var_dump($e->getMessage());
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: array_walk_recursive() expects at least 2 parameters, 0 given in %s on line %d
+NULL
+
+Warning: array_walk_recursive(): The argument should be an array in %s on line %d
+bool(false)
+bool(true)
+int(1)
+int(0)
+string(4) "data"
+int(2)
+int(1)
+string(4) "data"
+int(2)
+int(0)
+string(4) "data"
+int(3)
+int(1)
+string(4) "data"
+bool(true)
+string(4) "data"
+Done
diff --git a/ext/standard/tests/array/bug30833.phpt b/ext/standard/tests/array/bug30833.phpt
index ecf5f1f52..728a659d8 100644
--- a/ext/standard/tests/array/bug30833.phpt
+++ b/ext/standard/tests/array/bug30833.phpt
@@ -1,5 +1,5 @@
--TEST--
-bug #30833 (array_count_values() modifying input array)
+Bug #30833 (array_count_values() modifies input array)
--FILE--
<?php
diff --git a/ext/standard/tests/array/bug34066.phpt b/ext/standard/tests/array/bug34066.phpt
new file mode 100644
index 000000000..31f6b4c1d
--- /dev/null
+++ b/ext/standard/tests/array/bug34066.phpt
@@ -0,0 +1,804 @@
+--TEST--
+Bug #34066 (recursive array_walk causes segfault)
+--FILE--
+<?php
+
+ $order = array(
+ "DocID" => "1",
+ "DocDate" => "19.09.06",
+ "ReSubmissionDate" => "",
+ "DocTyp" => "Stapelauftrag",
+ "CustID" => "00000",
+ "CustomerAddress" => array(
+ array(
+ "Name1" => 'name1',
+ "Name2" => 'name2',
+ "Name3" => "",
+ "City" => 'city',
+ "Street" => 'street',
+ "Postal" => 'postcode',
+ "IATA" => "90",
+ "Country" => "Deutschland",
+ "ShortName" => 'short',
+ "ContactKey" => "",
+ "EMail" => 'email@example.com',
+ )
+ ),
+ "Text1" => "",
+ "Text2" => "",
+ "Wildcard1" => "",
+ "Wildcard2" => "",
+ "Dispatch" => "Paketdienst",
+ "Weight" => "0,0",
+ "BillingCustID" => "4300200000",
+ "ExtDocNr" => "00000000003",
+ "AnalysisLock" => "",
+ "PrintFlag" => "",
+ "FormType" => "0",
+ "Curr" => "EUR",
+ "ExChangeRate" => "1,0000",
+ "WIRRate" => "0",
+ "OneTimeCustomer" => array(
+ array(
+ "BankCode" => "",
+ "BankAccount" => ""
+ )
+ ),
+ "Language" => "0",
+ "PriceGroup" => "1",
+ "PrFlag" => "0",
+ "SalesTaxKey" => "1",
+ "ProceedKey" => "0",
+ "CustDiscountGroup" => "0",
+ "Discount" => array(
+ array(
+ "FinDisc1" => "0,00",
+ "Disc1Base" => "145,72",
+ "Disc1Value" => "0,00",
+ "FinDisc2" => "0,00",
+ "Disc2Base" => "145,72",
+ "Disc2Value" => "0,00",
+ "FinDisc3" => "0,00",
+ "Disc3Base" => "145,72",
+ "Disc3Value" => "0,00",
+ "ValueSummary" => "0,00"
+ )
+ ),
+ "Contact" => array(
+ array(
+ "Repr" => "999",
+ "Region" => "99",
+ "Commission" => "0,00",
+ "Agent" => "000000"
+ )
+ ),
+ "Booking" => array(
+ array(
+ "CostUnit" => "0000000000",
+ "CostCentre" => "0000000000",
+ "AccountingArea"=> "01"
+ )
+ ),
+ "InvoiceCycleKey" => "0",
+ "AnalysisKey" => "",
+ "OrderNumber" => "",
+ "OrderDate" => "",
+ "OrderCode" => "",
+ "DocItems" => array(
+ "DocItem" => array(
+ "PosType" => "1",
+ "ItemRef" => "1002",
+ "CRef" => "",
+ "Desc1" => "Pr�sentation Niederlande per",
+ "Desc2" => "",
+ "ArticleGroup" => "102",
+ "PosTypeVersion" => "E",
+ "Delivery" => array(
+ array(
+ "DelWeek" => "",
+ "DelDay" => "",
+ "DelTime" => ""
+ )
+ ),
+ "PricePu" => "145,72",
+ "PriceUnit" => "0",
+ "PriceCalculation" => "0",
+ "ItemVal" => "145,72",
+ "InputKey" => "0",
+ "AveragePurchasePrice" => "0",
+ "Tax" => array(
+ array(
+ "TaxCode" => "00",
+ "TaxBra" => "000",
+ "TaxBraAccess" => "0",
+ "TaxSumIndex" => "0"
+ )
+ ),
+ "DiscountArticle" => array(
+ array(
+ "DiscPC" => "0,00",
+ "DiscKey" => "1"
+ )
+ ),
+ "ProceedKeyArticle" => "01",
+ "ActionKey" => "00",
+ "ContactCommissionArticle"=> "0,00",
+ "QuantDependantPriceKey"=> "",
+ "Quant" => "1",
+ "QuantUnit" => "",
+ "Meas" => array(
+ array(
+ "Count" => "1",
+ "Length" => "0,000",
+ "Width" => "0,000",
+ "Height" => "0,000"
+ )
+ ),
+ "DecimalPlace" => "0",
+ "MultiplierQuant" => "1,000000",
+ "DifferingQuantUnit" => "",
+ "DecimalPlaceConversion"=> "0",
+ "WeightArticle" => array(
+ array(
+ "Amount" => "0",
+ "Unit" => "0"
+ )
+ ),
+ "Wreath" => "0,000",
+ "Stock" => "1",
+ "CostUnitArticle" => "",
+ "SerialNbKey" => "0",
+ "TextComplementKey" => "0",
+ "PartsListPrintKey" => "",
+ "Prod" => "0000000000"
+ )
+ ),
+ "Payment" => array(
+ "PaymentKey" => "0",
+ "ReminderKey" => "00",
+ "PayTerms" => array(
+ array(
+ "PayTerm" => "1",
+ "PayDays" => "000",
+ "CashDiscDays1" => "000",
+ "CashDiscDays2" => "000",
+ "CashDiscPer1" => "0,00",
+ "CashDiscPer2" => "0,00"
+ ),
+ array(
+ "PayTerm" => "2",
+ "PayDays" => "000",
+ "CashDiscDays1" => "000",
+ "CashDiscDays2" => "000",
+ "CashDiscPer1" => "0,00",
+ "CashDiscPer2" => "0,00"
+ )
+ )
+ ),
+ "NetAmountByTurnOverTax" => array(
+ array(
+ "TurnOverTaxFree" => "145,72",
+ "TurnOverTax1" => "0,00",
+ "TurnOverTax2" => "0,00",
+ "TurnOverTax3" => "0,00",
+ "TurnOverTax4" => "0,00",
+ "TurnOverTax5" => "0,00",
+ "TurnOverTax6" => "0,00",
+ "TurnOverTax7" => "0,00",
+ "TurnOverTax8" => "0,00"
+ ),
+ ),
+ "GrossAmount" => "145,72",
+ "ProceedAmount" => "145,72",
+ "NetAmountByPayTerm2" => array(
+ array(
+ "Sum0" => "0,00",
+ "Sum1" => "0,00",
+ "Sum2" => "0,00",
+ "Sum3" => "0,00",
+ "Sum4" => "0,00",
+ "Sum5" => "0,00",
+ "Sum6" => "0,00",
+ "Sum7" => "0,00",
+ "Sum8" => "0,00"
+ ),
+ ),
+ "TaxCodes" => array(
+ array(
+ "TaxCode1" => "0",
+ "TaxCode2" => "0",
+ "TaxCode3" => "0",
+ "TaxCode4" => "0",
+ "TaxCode5" => "0",
+ "TaxCode6" => "0",
+ "TaxCode7" => "0",
+ "TaxCode8" => "0"
+ )
+ )
+ );
+ $docs = array(
+ array(
+ "Version" => "1.0",
+ "ProducerName" => "xxxxxxxx",
+ "ProductName" => "Classic Line",
+ "xmlns" => "x-schema:CL310_DezABFSchema.XML"
+ ),
+ "Company" => array(
+ array(
+ "MandateNumber" => "111",
+ "MandateName" => "xxx xxxxxxx-xxxxx xxxxxxx",
+ "MandateCurr" => "EUR"
+ ),
+ ),
+ "Doc" => $order
+ );
+
+ dump2xml($docs);
+
+
+function dump2xml($array) {
+ // output of this goes through 2xml
+ array_walk($array, "gen_xml", "/Docs/");
+}
+function gen_xml($val, $key, $prefix)
+{
+ global $xml_fd;
+ print "gen_xml(prefix=$prefix)\n";
+ if (is_array($val)) {
+ if (preg_match('/^\d+$/', $key)) {
+ if ($key == 1) {
+ print substr($prefix, 0, -1) . "\n";
+ }
+ array_walk($val, "gen_xml", "$prefix@");
+ }
+ else {
+ array_walk($val, "gen_xml", "$prefix$key/");
+ }
+ }
+ else {
+ if (strlen($val) > 0)
+ print "$prefix$key=$val\n";
+ else
+ print "$prefix$key\n";
+ }
+ print "gen_xml(prefix=$prefix) end\n";
+}
+echo "Done\n";
+?>
+--EXPECTF--
+gen_xml(prefix=/Docs/)
+gen_xml(prefix=/Docs/@)
+/Docs/@Version=1.0
+gen_xml(prefix=/Docs/@) end
+gen_xml(prefix=/Docs/@)
+/Docs/@ProducerName=xxxxxxxx
+gen_xml(prefix=/Docs/@) end
+gen_xml(prefix=/Docs/@)
+/Docs/@ProductName=Classic Line
+gen_xml(prefix=/Docs/@) end
+gen_xml(prefix=/Docs/@)
+/Docs/@xmlns=x-schema:CL310_DezABFSchema.XML
+gen_xml(prefix=/Docs/@) end
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+gen_xml(prefix=/Docs/Company/)
+gen_xml(prefix=/Docs/Company/@)
+/Docs/Company/@MandateNumber=111
+gen_xml(prefix=/Docs/Company/@) end
+gen_xml(prefix=/Docs/Company/@)
+/Docs/Company/@MandateName=xxx xxxxxxx-xxxxx xxxxxxx
+gen_xml(prefix=/Docs/Company/@) end
+gen_xml(prefix=/Docs/Company/@)
+/Docs/Company/@MandateCurr=EUR
+gen_xml(prefix=/Docs/Company/@) end
+gen_xml(prefix=/Docs/Company/) end
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/DocID=1
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/DocDate=19.09.06
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/ReSubmissionDate
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/DocTyp=Stapelauftrag
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/CustID=00000
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/CustomerAddress/)
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Name1=name1
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Name2=name2
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Name3
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@City=city
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Street=street
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Postal=postcode
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@IATA=90
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Country=Deutschland
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@ShortName=short
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@ContactKey
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@EMail=email@example.com
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Text1
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Text2
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Wildcard1
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Wildcard2
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Dispatch=Paketdienst
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Weight=0,0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/BillingCustID=4300200000
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/ExtDocNr=00000000003
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/AnalysisLock
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/PrintFlag
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/FormType=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Curr=EUR
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/ExChangeRate=1,0000
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/WIRRate=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/)
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/@)
+/Docs/Doc/OneTimeCustomer/@BankCode
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/@) end
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/@)
+/Docs/Doc/OneTimeCustomer/@BankAccount
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/@) end
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Language=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/PriceGroup=1
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/PrFlag=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/SalesTaxKey=1
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/ProceedKey=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/CustDiscountGroup=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/Discount/)
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@FinDisc1=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc1Base=145,72
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc1Value=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@FinDisc2=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc2Base=145,72
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc2Value=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@FinDisc3=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc3Base=145,72
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc3Value=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@ValueSummary=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/Contact/)
+gen_xml(prefix=/Docs/Doc/Contact/@)
+/Docs/Doc/Contact/@Repr=999
+gen_xml(prefix=/Docs/Doc/Contact/@) end
+gen_xml(prefix=/Docs/Doc/Contact/@)
+/Docs/Doc/Contact/@Region=99
+gen_xml(prefix=/Docs/Doc/Contact/@) end
+gen_xml(prefix=/Docs/Doc/Contact/@)
+/Docs/Doc/Contact/@Commission=0,00
+gen_xml(prefix=/Docs/Doc/Contact/@) end
+gen_xml(prefix=/Docs/Doc/Contact/@)
+/Docs/Doc/Contact/@Agent=000000
+gen_xml(prefix=/Docs/Doc/Contact/@) end
+gen_xml(prefix=/Docs/Doc/Contact/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/Booking/)
+gen_xml(prefix=/Docs/Doc/Booking/@)
+/Docs/Doc/Booking/@CostUnit=0000000000
+gen_xml(prefix=/Docs/Doc/Booking/@) end
+gen_xml(prefix=/Docs/Doc/Booking/@)
+/Docs/Doc/Booking/@CostCentre=0000000000
+gen_xml(prefix=/Docs/Doc/Booking/@) end
+gen_xml(prefix=/Docs/Doc/Booking/@)
+/Docs/Doc/Booking/@AccountingArea=01
+gen_xml(prefix=/Docs/Doc/Booking/@) end
+gen_xml(prefix=/Docs/Doc/Booking/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/InvoiceCycleKey=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/AnalysisKey
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/OrderNumber
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/OrderDate
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/OrderCode
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/DocItems/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PosType=1
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ItemRef=1002
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/CRef
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Desc1=Pr�sentation Niederlande per
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Desc2
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ArticleGroup=102
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PosTypeVersion=E
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@)
+/Docs/Doc/DocItems/DocItem/Delivery/@DelWeek
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@)
+/Docs/Doc/DocItems/DocItem/Delivery/@DelDay
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@)
+/Docs/Doc/DocItems/DocItem/Delivery/@DelTime
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PricePu=145,72
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PriceUnit=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PriceCalculation=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ItemVal=145,72
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/InputKey=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/AveragePurchasePrice=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@)
+/Docs/Doc/DocItems/DocItem/Tax/@TaxCode=00
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@)
+/Docs/Doc/DocItems/DocItem/Tax/@TaxBra=000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@)
+/Docs/Doc/DocItems/DocItem/Tax/@TaxBraAccess=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@)
+/Docs/Doc/DocItems/DocItem/Tax/@TaxSumIndex=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/@)
+/Docs/Doc/DocItems/DocItem/DiscountArticle/@DiscPC=0,00
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/@)
+/Docs/Doc/DocItems/DocItem/DiscountArticle/@DiscKey=1
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ProceedKeyArticle=01
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ActionKey=00
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ContactCommissionArticle=0,00
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/QuantDependantPriceKey
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Quant=1
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/QuantUnit
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@)
+/Docs/Doc/DocItems/DocItem/Meas/@Count=1
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@)
+/Docs/Doc/DocItems/DocItem/Meas/@Length=0,000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@)
+/Docs/Doc/DocItems/DocItem/Meas/@Width=0,000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@)
+/Docs/Doc/DocItems/DocItem/Meas/@Height=0,000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/DecimalPlace=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/MultiplierQuant=1,000000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/DifferingQuantUnit
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/DecimalPlaceConversion=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/@)
+/Docs/Doc/DocItems/DocItem/WeightArticle/@Amount=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/@)
+/Docs/Doc/DocItems/DocItem/WeightArticle/@Unit=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Wreath=0,000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Stock=1
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/CostUnitArticle
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/SerialNbKey=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/TextComplementKey=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PartsListPrintKey
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Prod=0000000000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/Payment/)
+/Docs/Doc/Payment/PaymentKey=0
+gen_xml(prefix=/Docs/Doc/Payment/) end
+gen_xml(prefix=/Docs/Doc/Payment/)
+/Docs/Doc/Payment/ReminderKey=00
+gen_xml(prefix=/Docs/Doc/Payment/) end
+gen_xml(prefix=/Docs/Doc/Payment/)
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/)
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@PayTerm=1
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@PayDays=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscDays1=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscDays2=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscPer1=0,00
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscPer2=0,00
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/)
+/Docs/Doc/Payment/PayTerms
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@PayTerm=2
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@PayDays=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscDays1=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscDays2=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscPer1=0,00
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscPer2=0,00
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/) end
+gen_xml(prefix=/Docs/Doc/Payment/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/)
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTaxFree=145,72
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax1=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax2=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax3=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax4=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax5=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax6=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax7=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax8=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/GrossAmount=145,72
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/ProceedAmount=145,72
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/)
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum0=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum1=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum2=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum3=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum4=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum5=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum6=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum7=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum8=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/TaxCodes/)
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode1=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode2=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode3=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode4=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode5=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode6=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode7=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode8=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/) end
+Done
diff --git a/ext/standard/tests/array/bug34066_1.phpt b/ext/standard/tests/array/bug34066_1.phpt
new file mode 100644
index 000000000..edc16efd0
--- /dev/null
+++ b/ext/standard/tests/array/bug34066_1.phpt
@@ -0,0 +1,731 @@
+--TEST--
+Bug #34066 (recursive array_walk causes segfault)
+--FILE--
+<?php
+
+ $order = array(
+ "DocID" => "1",
+ "DocDate" => "19.09.06",
+ "ReSubmissionDate" => "",
+ "DocTyp" => "Stapelauftrag",
+ "CustID" => "00000",
+ "CustomerAddress" => array(
+ array(
+ "Name1" => 'name1',
+ "Name2" => 'name2',
+ "Name3" => "",
+ "City" => 'city',
+ "Street" => 'street',
+ "Postal" => 'postcode',
+ "IATA" => "90",
+ "Country" => "Deutschland",
+ "ShortName" => 'short',
+ "ContactKey" => "",
+ "EMail" => 'email@example.com',
+ )
+ ),
+ "Text1" => "",
+ "Text2" => "",
+ "Wildcard1" => "",
+ "Wildcard2" => "",
+ "Dispatch" => "Paketdienst",
+ "Weight" => "0,0",
+ "BillingCustID" => "4300200000",
+ "ExtDocNr" => "00000000003",
+ "AnalysisLock" => "",
+ "PrintFlag" => "",
+ "FormType" => "0",
+ "Curr" => "EUR",
+ "ExChangeRate" => "1,0000",
+ "WIRRate" => "0",
+ "OneTimeCustomer" => array(
+ array(
+ "BankCode" => "",
+ "BankAccount" => ""
+ )
+ ),
+ "Language" => "0",
+ "PriceGroup" => "1",
+ "PrFlag" => "0",
+ "SalesTaxKey" => "1",
+ "ProceedKey" => "0",
+ "CustDiscountGroup" => "0",
+ "Discount" => array(
+ array(
+ "FinDisc1" => "0,00",
+ "Disc1Base" => "145,72",
+ "Disc1Value" => "0,00",
+ "FinDisc2" => "0,00",
+ "Disc2Base" => "145,72",
+ "Disc2Value" => "0,00",
+ "FinDisc3" => "0,00",
+ "Disc3Base" => "145,72",
+ "Disc3Value" => "0,00",
+ "ValueSummary" => "0,00"
+ )
+ ),
+ "Contact" => array(
+ array(
+ "Repr" => "999",
+ "Region" => "99",
+ "Commission" => "0,00",
+ "Agent" => "000000"
+ )
+ ),
+ "Booking" => array(
+ array(
+ "CostUnit" => "0000000000",
+ "CostCentre" => "0000000000",
+ "AccountingArea"=> "01"
+ )
+ ),
+ "InvoiceCycleKey" => "0",
+ "AnalysisKey" => "",
+ "OrderNumber" => "",
+ "OrderDate" => "",
+ "OrderCode" => "",
+ "DocItems" => array(
+ "DocItem" => array(
+ "PosType" => "1",
+ "ItemRef" => "1002",
+ "CRef" => "",
+ "Desc1" => "Pr�sentation Niederlande per",
+ "Desc2" => "",
+ "ArticleGroup" => "102",
+ "PosTypeVersion" => "E",
+ "Delivery" => array(
+ array(
+ "DelWeek" => "",
+ "DelDay" => "",
+ "DelTime" => ""
+ )
+ ),
+ "PricePu" => "145,72",
+ "PriceUnit" => "0",
+ "PriceCalculation" => "0",
+ "ItemVal" => "145,72",
+ "InputKey" => "0",
+ "AveragePurchasePrice" => "0",
+ "Tax" => array(
+ array(
+ "TaxCode" => "00",
+ "TaxBra" => "000",
+ "TaxBraAccess" => "0",
+ "TaxSumIndex" => "0"
+ )
+ ),
+ "DiscountArticle" => array(
+ array(
+ "DiscPC" => "0,00",
+ "DiscKey" => "1"
+ )
+ ),
+ "ProceedKeyArticle" => "01",
+ "ActionKey" => "00",
+ "ContactCommissionArticle"=> "0,00",
+ "QuantDependantPriceKey"=> "",
+ "Quant" => "1",
+ "QuantUnit" => "",
+ "Meas" => array(
+ array(
+ "Count" => "1",
+ "Length" => "0,000",
+ "Width" => "0,000",
+ "Height" => "0,000"
+ )
+ ),
+ "DecimalPlace" => "0",
+ "MultiplierQuant" => "1,000000",
+ "DifferingQuantUnit" => "",
+ "DecimalPlaceConversion"=> "0",
+ "WeightArticle" => array(
+ array(
+ "Amount" => "0",
+ "Unit" => "0"
+ )
+ ),
+ "Wreath" => "0,000",
+ "Stock" => "1",
+ "CostUnitArticle" => "",
+ "SerialNbKey" => "0",
+ "TextComplementKey" => "0",
+ "PartsListPrintKey" => "",
+ "Prod" => "0000000000"
+ )
+ ),
+ "Payment" => array(
+ "PaymentKey" => "0",
+ "ReminderKey" => "00",
+ "PayTerms" => array(
+ array(
+ "PayTerm" => "1",
+ "PayDays" => "000",
+ "CashDiscDays1" => "000",
+ "CashDiscDays2" => "000",
+ "CashDiscPer1" => "0,00",
+ "CashDiscPer2" => "0,00"
+ ),
+ array(
+ "PayTerm" => "2",
+ "PayDays" => "000",
+ "CashDiscDays1" => "000",
+ "CashDiscDays2" => "000",
+ "CashDiscPer1" => "0,00",
+ "CashDiscPer2" => "0,00"
+ )
+ )
+ ),
+ "NetAmountByTurnOverTax" => array(
+ array(
+ "TurnOverTaxFree" => "145,72",
+ "TurnOverTax1" => "0,00",
+ "TurnOverTax2" => "0,00",
+ "TurnOverTax3" => "0,00",
+ "TurnOverTax4" => "0,00",
+ "TurnOverTax5" => "0,00",
+ "TurnOverTax6" => "0,00",
+ "TurnOverTax7" => "0,00",
+ "TurnOverTax8" => "0,00"
+ ),
+ ),
+ "GrossAmount" => "145,72",
+ "ProceedAmount" => "145,72",
+ "NetAmountByPayTerm2" => array(
+ array(
+ "Sum0" => "0,00",
+ "Sum1" => "0,00",
+ "Sum2" => "0,00",
+ "Sum3" => "0,00",
+ "Sum4" => "0,00",
+ "Sum5" => "0,00",
+ "Sum6" => "0,00",
+ "Sum7" => "0,00",
+ "Sum8" => "0,00"
+ ),
+ ),
+ "TaxCodes" => array(
+ array(
+ "TaxCode1" => "0",
+ "TaxCode2" => "0",
+ "TaxCode3" => "0",
+ "TaxCode4" => "0",
+ "TaxCode5" => "0",
+ "TaxCode6" => "0",
+ "TaxCode7" => "0",
+ "TaxCode8" => "0"
+ )
+ )
+ );
+ $docs = array(
+ array(
+ "Version" => "1.0",
+ "ProducerName" => "xxxxxxxx",
+ "ProductName" => "Classic Line",
+ "xmlns" => "x-schema:CL310_DezABFSchema.XML"
+ ),
+ "Company" => array(
+ array(
+ "MandateNumber" => "111",
+ "MandateName" => "xxx xxxxxxx-xxxxx xxxxxxx",
+ "MandateCurr" => "EUR"
+ ),
+ ),
+ "Doc" => $order
+ );
+
+ dump2xml($docs);
+
+
+function dump2xml($array) {
+ // output of this goes through 2xml
+ array_walk_recursive($array, "gen_xml", "/Docs/");
+}
+function gen_xml($val, $key, $prefix)
+{
+ global $xml_fd;
+ print "gen_xml(prefix=$prefix)\n";
+ if (is_array($val)) {
+ if (preg_match('/^\d+$/', $key)) {
+ if ($key == 1) {
+ print substr($prefix, 0, -1) . "\n";
+ }
+ array_walk_recursive($val, "gen_xml", "$prefix@");
+ }
+ else {
+ array_walk_recursive($val, "gen_xml", "$prefix$key/");
+ }
+ }
+ else {
+ if (strlen($val) > 0)
+ print "$prefix$key=$val\n";
+ else
+ print "$prefix$key\n";
+ }
+ print "gen_xml(prefix=$prefix) end\n";
+}
+echo "Done\n";
+?>
+--EXPECTF--
+gen_xml(prefix=/Docs/)
+/Docs/Version=1.0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ProducerName=xxxxxxxx
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ProductName=Classic Line
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/xmlns=x-schema:CL310_DezABFSchema.XML
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/MandateNumber=111
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/MandateName=xxx xxxxxxx-xxxxx xxxxxxx
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/MandateCurr=EUR
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DocID=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DocDate=19.09.06
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ReSubmissionDate
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DocTyp=Stapelauftrag
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CustID=00000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Name1=name1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Name2=name2
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Name3
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/City=city
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Street=street
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Postal=postcode
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/IATA=90
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Country=Deutschland
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ShortName=short
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ContactKey
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/EMail=email@example.com
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Text1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Text2
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Wildcard1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Wildcard2
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Dispatch=Paketdienst
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Weight=0,0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/BillingCustID=4300200000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ExtDocNr=00000000003
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/AnalysisLock
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PrintFlag
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/FormType=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Curr=EUR
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ExChangeRate=1,0000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/WIRRate=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/BankCode
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/BankAccount
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Language=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PriceGroup=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PrFlag=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/SalesTaxKey=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ProceedKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CustDiscountGroup=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/FinDisc1=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc1Base=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc1Value=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/FinDisc2=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc2Base=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc2Value=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/FinDisc3=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc3Base=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc3Value=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ValueSummary=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Repr=999
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Region=99
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Commission=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Agent=000000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CostUnit=0000000000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CostCentre=0000000000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/AccountingArea=01
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/InvoiceCycleKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/AnalysisKey
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/OrderNumber
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/OrderDate
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/OrderCode
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PosType=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ItemRef=1002
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CRef
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Desc1=Pr�sentation Niederlande per
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Desc2
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ArticleGroup=102
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PosTypeVersion=E
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DelWeek
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DelDay
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DelTime
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PricePu=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PriceUnit=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PriceCalculation=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ItemVal=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/InputKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/AveragePurchasePrice=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode=00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxBra=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxBraAccess=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxSumIndex=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DiscPC=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DiscKey=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ProceedKeyArticle=01
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ActionKey=00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ContactCommissionArticle=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/QuantDependantPriceKey
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Quant=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/QuantUnit
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Count=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Length=0,000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Width=0,000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Height=0,000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DecimalPlace=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/MultiplierQuant=1,000000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DifferingQuantUnit
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DecimalPlaceConversion=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Amount=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Unit=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Wreath=0,000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Stock=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CostUnitArticle
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/SerialNbKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TextComplementKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PartsListPrintKey
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Prod=0000000000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PaymentKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ReminderKey=00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PayTerm=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PayDays=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscDays1=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscDays2=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscPer1=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscPer2=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PayTerm=2
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PayDays=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscDays1=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscDays2=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscPer1=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscPer2=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTaxFree=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax1=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax2=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax3=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax4=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax5=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax6=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax7=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax8=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/GrossAmount=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ProceedAmount=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum0=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum1=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum2=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum3=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum4=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum5=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum6=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum7=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum8=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode1=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode2=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode3=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode4=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode5=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode6=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode7=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode8=0
+gen_xml(prefix=/Docs/) end
+Done
diff --git a/ext/standard/tests/array/bug38464.phpt b/ext/standard/tests/array/bug38464.phpt
new file mode 100644
index 000000000..42f7a6ab5
--- /dev/null
+++ b/ext/standard/tests/array/bug38464.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #38464 (array_count_values() mishandles numeric strings)
+--FILE--
+<?php
+$array = array('-000', ' 001', 1, ' 123', '+123');
+var_dump(array_count_values($array));
+?>
+--EXPECT--
+array(5) {
+ ["-000"]=>
+ int(1)
+ [" 001"]=>
+ int(1)
+ [1]=>
+ int(1)
+ [" 123"]=>
+ int(1)
+ ["+123"]=>
+ int(1)
+}
diff --git a/ext/standard/tests/array/max.phpt b/ext/standard/tests/array/max.phpt
new file mode 100644
index 000000000..7edcab755
--- /dev/null
+++ b/ext/standard/tests/array/max.phpt
@@ -0,0 +1,39 @@
+--TEST--
+max() tests
+--FILE--
+<?php
+
+var_dump(max());
+var_dump(max(1));
+var_dump(max(array()));
+var_dump(max(new stdclass));
+var_dump(max(2,1,2));
+var_dump(max(2.1,2.11,2.09));
+var_dump(max("", "t", "b"));
+var_dump(max(false, true, false));
+var_dump(max(true, false, true));
+var_dump(max(1, true, false, true));
+var_dump(max(0, true, false, true));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: max(): Atleast one value should be passed in %s on line %d
+NULL
+
+Warning: Wrong parameter count for max() in %s on line %d
+NULL
+
+Warning: max(): Array must contain atleast one element in %s on line %d
+bool(false)
+
+Warning: Wrong parameter count for max() in %s on line %d
+NULL
+int(2)
+float(2.11)
+string(1) "t"
+bool(true)
+bool(true)
+int(1)
+bool(true)
+Done
diff --git a/ext/standard/tests/array/min.phpt b/ext/standard/tests/array/min.phpt
new file mode 100644
index 000000000..70e3555f1
--- /dev/null
+++ b/ext/standard/tests/array/min.phpt
@@ -0,0 +1,39 @@
+--TEST--
+min() tests
+--FILE--
+<?php
+
+var_dump(min());
+var_dump(min(1));
+var_dump(min(array()));
+var_dump(min(new stdclass));
+var_dump(min(2,1,2));
+var_dump(min(2.1,2.11,2.09));
+var_dump(min("", "t", "b"));
+var_dump(min(false, true, false));
+var_dump(min(true, false, true));
+var_dump(min(1, true, false, true));
+var_dump(min(0, true, false, true));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: min(): Atleast one value should be passed in %s on line %d
+NULL
+
+Warning: Wrong parameter count for min() in %s on line %d
+NULL
+
+Warning: min(): Array must contain atleast one element in %s on line %d
+bool(false)
+
+Warning: Wrong parameter count for min() in %s on line %d
+NULL
+int(1)
+float(2.09)
+string(0) ""
+bool(false)
+bool(false)
+bool(false)
+int(0)
+Done
diff --git a/ext/standard/tests/assert/assert02.phpt b/ext/standard/tests/assert/assert02.phpt
new file mode 100644
index 000000000..88a1e1242
--- /dev/null
+++ b/ext/standard/tests/assert/assert02.phpt
@@ -0,0 +1,42 @@
+--TEST--
+catch assert() errors
+--FILE--
+<?php
+function handler($errno, $errstr) {
+ echo "in handler()\n";
+ assert(E_RECOVERABLE_ERROR === $errno);
+ var_dump($errstr);
+}
+
+set_error_handler('handler', E_RECOVERABLE_ERROR);
+
+assert(1);
+assert('1');
+assert('$a');
+
+assert('aa=sd+as+safsafasfasafsaf');
+
+assert('0');
+
+assert_options(ASSERT_BAIL, 1);
+assert('aa=sd+as+safsafasfasafsaf');
+
+echo "done\n";
+
+?>
+--EXPECTF--
+Notice: Undefined variable: a in %sassert02.php(12) : assert code on line 1
+
+Warning: assert(): Assertion "$a" failed in %sassert02.php on line %d
+
+Parse error: %s error%sassert02.php(%d) : assert code on line 1
+in handler()
+string(64) "assert(): Failure evaluating code:
+aa=sd+as+safsafasfasafsaf"
+
+Warning: assert(): Assertion "0" failed in %sassert02.php on line %d
+
+Parse error: %s error%sassert02.php(%d) : assert code on line 1
+in handler()
+string(64) "assert(): Failure evaluating code:
+aa=sd+as+safsafasfasafsaf"
diff --git a/ext/standard/tests/file/bug22414.phpt b/ext/standard/tests/file/bug22414.phpt
index f4f097d66..0775fc8a7 100644
--- a/ext/standard/tests/file/bug22414.phpt
+++ b/ext/standard/tests/file/bug22414.phpt
@@ -15,7 +15,6 @@ output_handler=
echo "\n";
/* Binary Data Test */
- @unlink($pwd . '/passthru_test');
$cmd = $php . ' -n -r \"readfile(@getenv(\'TEST_PHP_EXECUTABLE\')); \"';
$cmd = $php . ' -n -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ;
diff --git a/ext/standard/tests/file/bug24313.phpt b/ext/standard/tests/file/bug24313.phpt
index 4b84bcac4..04057c58a 100644
--- a/ext/standard/tests/file/bug24313.phpt
+++ b/ext/standard/tests/file/bug24313.phpt
@@ -1,10 +1,10 @@
--TEST--
-Bug #24313 (file_exists() warning on non-existant files when is open_basedir enabled)
+Bug #24313 (file_exists() throws a warning on nonexistent files when is open_basedir enabled)
--INI--
-open_basedir=/tmp
+open_basedir=/dev
--FILE--
<?php
- var_dump(file_exists("/tmp/bogus_file_no_such_thing"));
+ var_dump(file_exists("/dev/bogus_file_no_such_thing"));
?>
--EXPECT--
bool(false)
diff --git a/ext/standard/tests/file/bug37864.phpt b/ext/standard/tests/file/bug37864.phpt
new file mode 100644
index 000000000..d74647cc7
--- /dev/null
+++ b/ext/standard/tests/file/bug37864.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #37864 (file_get_contents() leaks on empty file)
+--FILE--
+<?php
+ $tmpfname = tempnam("/tmp", "emptyfile");
+ var_dump(file_get_contents($tmpfname));
+ echo "done.\n";
+ unlink($tmpfname);
+?>
+--EXPECT--
+string(0) ""
+done.
diff --git a/ext/standard/tests/file/bug38086.phpt b/ext/standard/tests/file/bug38086.phpt
new file mode 100644
index 000000000..ed8af75a4
--- /dev/null
+++ b/ext/standard/tests/file/bug38086.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger than the actual length)
+--FILE--
+<?php
+
+$initial_file = dirname(__FILE__).'/bug38086.txt';
+$new_file = dirname(__FILE__).'/bug38086_1.txt';
+
+$src = fopen($initial_file, 'r');
+stream_filter_append($src, "string.rot13", STREAM_FILTER_READ);
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+$src = fopen($initial_file, 'r');
+stream_filter_append($src, "string.rot13", STREAM_FILTER_READ);
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, 10000));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(134)
+string(134) "Nabgure qnl
+Jura gur cnvaf bs yvsr jba'g one zl jnl
+V'yy oernx gurfr punvaf
+Gung ubyq zr qbja
+V'yy grne lbh qbja vagb zl cevingr uryy
+"
+int(134)
+string(134) "Nabgure qnl
+Jura gur cnvaf bs yvsr jba'g one zl jnl
+V'yy oernx gurfr punvaf
+Gung ubyq zr qbja
+V'yy grne lbh qbja vagb zl cevingr uryy
+"
+Done
diff --git a/ext/standard/tests/file/bug38086.txt b/ext/standard/tests/file/bug38086.txt
new file mode 100644
index 000000000..8e324724c
--- /dev/null
+++ b/ext/standard/tests/file/bug38086.txt
@@ -0,0 +1,5 @@
+Another day
+When the pains of life won't bar my way
+I'll break these chains
+That hold me down
+I'll tear you down into my private hell
diff --git a/ext/standard/tests/file/bug38450.phpt b/ext/standard/tests/file/bug38450.phpt
new file mode 100644
index 000000000..6fcdab871
--- /dev/null
+++ b/ext/standard/tests/file/bug38450.phpt
@@ -0,0 +1,114 @@
+--TEST--
+Bug #38450 (constructor is not called for classes used in userspace stream wrappers)
+--FILE--
+<?php
+
+class VariableStream {
+ var $position;
+ var $varname;
+
+ function VariableStream($var) {
+ var_dump("constructor!");
+ }
+
+ function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $url = parse_url($path);
+ $this->varname = $url["host"];
+ $this->position = 0;
+
+ return true;
+ }
+
+ function stream_read($count)
+ {
+ $ret = substr($GLOBALS[$this->varname], $this->position, $count);
+ $this->position += strlen($ret);
+ return $ret;
+ }
+
+ function stream_write($data)
+ {
+ $left = substr($GLOBALS[$this->varname], 0, $this->position);
+ $right = substr($GLOBALS[$this->varname], $this->position + strlen($data));
+ $GLOBALS[$this->varname] = $left . $data . $right;
+ $this->position += strlen($data);
+ return strlen($data);
+ }
+
+ function stream_tell()
+ {
+ return $this->position;
+ }
+
+ function stream_eof()
+ {
+ return $this->position >= strlen($GLOBALS[$this->varname]);
+ }
+ function stream_seek($offset, $whence)
+ {
+ switch ($whence) {
+ case SEEK_SET:
+ if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) {
+ $this->position = $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ case SEEK_CUR:
+ if ($offset >= 0) {
+ $this->position += $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ case SEEK_END:
+ if (strlen($GLOBALS[$this->varname]) + $offset >= 0) {
+ $this->position = strlen($GLOBALS[$this->varname]) + $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ default:
+ return false;
+ }
+ }
+}
+
+stream_wrapper_register("var", "VariableStream")
+ or die("Failed to register protocol");
+
+$myvar = "";
+
+$fp = fopen("var://myvar", "r+");
+
+fwrite($fp, "line1\n");
+fwrite($fp, "line2\n");
+fwrite($fp, "line3\n");
+
+rewind($fp);
+while (!feof($fp)) {
+ echo fgets($fp);
+}
+fclose($fp);
+var_dump($myvar);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Missing argument 1 for VariableStream::VariableStream() in %s on line %d
+string(12) "constructor!"
+line1
+line2
+line3
+string(18) "line1
+line2
+line3
+"
+Done
diff --git a/ext/standard/tests/file/bug38450_1.phpt b/ext/standard/tests/file/bug38450_1.phpt
new file mode 100644
index 000000000..094755e47
--- /dev/null
+++ b/ext/standard/tests/file/bug38450_1.phpt
@@ -0,0 +1,114 @@
+--TEST--
+Bug #38450 (constructor is not called for classes used in userspace stream wrappers)
+--FILE--
+<?php
+
+class VariableStream {
+ var $position;
+ var $varname;
+
+ function __construct($var) {
+ var_dump("constructor!");
+ }
+
+ function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $url = parse_url($path);
+ $this->varname = $url["host"];
+ $this->position = 0;
+
+ return true;
+ }
+
+ function stream_read($count)
+ {
+ $ret = substr($GLOBALS[$this->varname], $this->position, $count);
+ $this->position += strlen($ret);
+ return $ret;
+ }
+
+ function stream_write($data)
+ {
+ $left = substr($GLOBALS[$this->varname], 0, $this->position);
+ $right = substr($GLOBALS[$this->varname], $this->position + strlen($data));
+ $GLOBALS[$this->varname] = $left . $data . $right;
+ $this->position += strlen($data);
+ return strlen($data);
+ }
+
+ function stream_tell()
+ {
+ return $this->position;
+ }
+
+ function stream_eof()
+ {
+ return $this->position >= strlen($GLOBALS[$this->varname]);
+ }
+ function stream_seek($offset, $whence)
+ {
+ switch ($whence) {
+ case SEEK_SET:
+ if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) {
+ $this->position = $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ case SEEK_CUR:
+ if ($offset >= 0) {
+ $this->position += $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ case SEEK_END:
+ if (strlen($GLOBALS[$this->varname]) + $offset >= 0) {
+ $this->position = strlen($GLOBALS[$this->varname]) + $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ default:
+ return false;
+ }
+ }
+}
+
+stream_wrapper_register("var", "VariableStream")
+ or die("Failed to register protocol");
+
+$myvar = "";
+
+$fp = fopen("var://myvar", "r+");
+
+fwrite($fp, "line1\n");
+fwrite($fp, "line2\n");
+fwrite($fp, "line3\n");
+
+rewind($fp);
+while (!feof($fp)) {
+ echo fgets($fp);
+}
+fclose($fp);
+var_dump($myvar);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Missing argument 1 for VariableStream::__construct() in %s on line %d
+string(12) "constructor!"
+line1
+line2
+line3
+string(18) "line1
+line2
+line3
+"
+Done
diff --git a/ext/standard/tests/file/bug38450_2.phpt b/ext/standard/tests/file/bug38450_2.phpt
new file mode 100644
index 000000000..625fd7c5c
--- /dev/null
+++ b/ext/standard/tests/file/bug38450_2.phpt
@@ -0,0 +1,114 @@
+--TEST--
+Bug #38450 (constructor is not called for classes used in userspace stream wrappers)
+--FILE--
+<?php
+
+class VariableStream {
+ var $position;
+ var $varname;
+
+ function __construct($var) {
+ throw new Exception("constructor");
+ }
+
+ function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $url = parse_url($path);
+ $this->varname = $url["host"];
+ $this->position = 0;
+
+ return true;
+ }
+
+ function stream_read($count)
+ {
+ $ret = substr($GLOBALS[$this->varname], $this->position, $count);
+ $this->position += strlen($ret);
+ return $ret;
+ }
+
+ function stream_write($data)
+ {
+ $left = substr($GLOBALS[$this->varname], 0, $this->position);
+ $right = substr($GLOBALS[$this->varname], $this->position + strlen($data));
+ $GLOBALS[$this->varname] = $left . $data . $right;
+ $this->position += strlen($data);
+ return strlen($data);
+ }
+
+ function stream_tell()
+ {
+ return $this->position;
+ }
+
+ function stream_eof()
+ {
+ return $this->position >= strlen($GLOBALS[$this->varname]);
+ }
+ function stream_seek($offset, $whence)
+ {
+ switch ($whence) {
+ case SEEK_SET:
+ if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) {
+ $this->position = $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ case SEEK_CUR:
+ if ($offset >= 0) {
+ $this->position += $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ case SEEK_END:
+ if (strlen($GLOBALS[$this->varname]) + $offset >= 0) {
+ $this->position = strlen($GLOBALS[$this->varname]) + $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ default:
+ return false;
+ }
+ }
+}
+
+stream_wrapper_register("var", "VariableStream")
+ or die("Failed to register protocol");
+
+$myvar = "";
+
+$fp = fopen("var://myvar", "r+");
+
+fwrite($fp, "line1\n");
+fwrite($fp, "line2\n");
+fwrite($fp, "line3\n");
+
+rewind($fp);
+while (!feof($fp)) {
+ echo fgets($fp);
+}
+fclose($fp);
+var_dump($myvar);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Missing argument 1 for VariableStream::__construct() in %s on line %d
+
+Warning: fopen(var://myvar): failed to open stream: "VariableStream::stream_open" call failed in %s on line %d
+
+Fatal error: Uncaught exception 'Exception' with message 'constructor' in %s:%d
+Stack trace:
+#0 [internal function]: VariableStream->__construct()
+#1 %s(%d): fopen('var://myvar', 'r+')
+#2 {main}
+ thrown in %s on line %d
diff --git a/ext/standard/tests/file/bug38450_3.phpt b/ext/standard/tests/file/bug38450_3.phpt
new file mode 100644
index 000000000..d11ebd91e
--- /dev/null
+++ b/ext/standard/tests/file/bug38450_3.phpt
@@ -0,0 +1,105 @@
+--TEST--
+Bug #38450 (constructor is not called for classes used in userspace stream wrappers)
+--FILE--
+<?php
+
+class VariableStream {
+ var $position;
+ var $varname;
+
+ function __construct(array $var) {
+ var_dump("constructor!");
+ }
+
+ function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $url = parse_url($path);
+ $this->varname = $url["host"];
+ $this->position = 0;
+
+ return true;
+ }
+
+ function stream_read($count)
+ {
+ $ret = substr($GLOBALS[$this->varname], $this->position, $count);
+ $this->position += strlen($ret);
+ return $ret;
+ }
+
+ function stream_write($data)
+ {
+ $left = substr($GLOBALS[$this->varname], 0, $this->position);
+ $right = substr($GLOBALS[$this->varname], $this->position + strlen($data));
+ $GLOBALS[$this->varname] = $left . $data . $right;
+ $this->position += strlen($data);
+ return strlen($data);
+ }
+
+ function stream_tell()
+ {
+ return $this->position;
+ }
+
+ function stream_eof()
+ {
+ return $this->position >= strlen($GLOBALS[$this->varname]);
+ }
+ function stream_seek($offset, $whence)
+ {
+ switch ($whence) {
+ case SEEK_SET:
+ if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) {
+ $this->position = $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ case SEEK_CUR:
+ if ($offset >= 0) {
+ $this->position += $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ case SEEK_END:
+ if (strlen($GLOBALS[$this->varname]) + $offset >= 0) {
+ $this->position = strlen($GLOBALS[$this->varname]) + $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ default:
+ return false;
+ }
+ }
+}
+
+stream_wrapper_register("var", "VariableStream")
+ or die("Failed to register protocol");
+
+$myvar = "";
+
+$fp = fopen("var://myvar", "r+");
+
+fwrite($fp, "line1\n");
+fwrite($fp, "line2\n");
+fwrite($fp, "line3\n");
+
+rewind($fp);
+while (!feof($fp)) {
+ echo fgets($fp);
+}
+fclose($fp);
+var_dump($myvar);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Catchable fatal error: Argument 1 passed to VariableStream::__construct() must be an array, none given in %s on line %d
diff --git a/ext/standard/tests/file/file_put_contents.phpt b/ext/standard/tests/file/file_put_contents.phpt
new file mode 100644
index 000000000..de08141b8
--- /dev/null
+++ b/ext/standard/tests/file/file_put_contents.phpt
@@ -0,0 +1,28 @@
+--TEST--
+file_put_contents() and invalid parameters
+--FILE--
+<?php
+
+$file = dirname(__FILE__)."/file_put_contents.txt";
+
+$context = stream_context_create();
+
+var_dump(file_put_contents($file, $context));
+var_dump(file_put_contents($file, new stdClass));
+$fp = fopen($file, "r");
+var_dump(file_put_contents($file, "string", 0, $fp));
+
+@unlink($file);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: file_put_contents(): supplied resource is not a valid stream resource in %s on line %d
+bool(false)
+
+Warning: file_put_contents(): The 2nd parameter should be either a string or an array in %s on line %d
+bool(false)
+
+Warning: file_put_contents(): supplied resource is not a valid Stream-Context resource in %s on line %d
+int(6)
+Done
diff --git a/ext/standard/tests/file/mkdir-001.phpt b/ext/standard/tests/file/mkdir-001.phpt
new file mode 100644
index 000000000..be653da29
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-001.phpt
@@ -0,0 +1,36 @@
+--TEST--
+mkdir() tests
+--FILE--
+<?php
+
+var_dump(mkdir("testdir"));
+var_dump(mkdir("testdir/subdir"));
+var_dump(rmdir("testdir/subdir"));
+var_dump(rmdir("testdir"));
+
+var_dump(mkdir("./testdir"));
+var_dump(mkdir("./testdir/subdir"));
+var_dump(rmdir("./testdir/subdir"));
+var_dump(rmdir("./testdir"));
+
+var_dump(mkdir(dirname(__FILE__)."/testdir"));
+var_dump(mkdir(dirname(__FILE__)."/testdir/subdir"));
+var_dump(rmdir(dirname(__FILE__)."/testdir/subdir"));
+var_dump(rmdir(dirname(__FILE__)."/testdir"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+Done
diff --git a/ext/standard/tests/file/mkdir-002.phpt b/ext/standard/tests/file/mkdir-002.phpt
new file mode 100644
index 000000000..bc4f19aca
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-002.phpt
@@ -0,0 +1,49 @@
+--TEST--
+mkdir(dir, 0777) tests
+--FILE--
+<?php
+
+var_dump(mkdir("testdir", 0777));
+var_dump(mkdir("testdir/subdir", 0777));
+var_dump(`ls -l testdir`);
+var_dump(rmdir("testdir/subdir"));
+var_dump(rmdir("testdir"));
+
+var_dump(mkdir("./testdir", 0777));
+var_dump(mkdir("./testdir/subdir", 0777));
+var_dump(`ls -l ./testdir`);
+var_dump(rmdir("./testdir/subdir"));
+var_dump(rmdir("./testdir"));
+
+var_dump(mkdir(dirname(__FILE__)."/testdir", 0777));
+var_dump(mkdir(dirname(__FILE__)."/testdir/subdir", 0777));
+$dirname = dirname(__FILE__)."/testdir";
+var_dump(`ls -l $dirname`);
+var_dump(rmdir(dirname(__FILE__)."/testdir/subdir"));
+var_dump(rmdir(dirname(__FILE__)."/testdir"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+string(%d) "%s
+d%s subdir
+"
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+string(%d) "%s
+d%s subdir
+"
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+string(%d) "%s
+d%s subdir
+"
+bool(true)
+bool(true)
+Done
diff --git a/ext/standard/tests/file/mkdir-003.phpt b/ext/standard/tests/file/mkdir-003.phpt
new file mode 100644
index 000000000..50ad5e6c4
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-003.phpt
@@ -0,0 +1,30 @@
+--TEST--
+recursive mkdir() tests
+--FILE--
+<?php
+
+var_dump(mkdir("testdir/subdir", 0777, true));
+var_dump(rmdir("testdir/subdir"));
+var_dump(rmdir("testdir"));
+
+var_dump(mkdir("./testdir/subdir", 0777, true));
+var_dump(rmdir("./testdir/subdir"));
+var_dump(rmdir("./testdir"));
+
+var_dump(mkdir(dirname(__FILE__)."/testdir/subdir", 0777, true));
+var_dump(rmdir(dirname(__FILE__)."/testdir/subdir"));
+var_dump(rmdir(dirname(__FILE__)."/testdir"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+Done
diff --git a/ext/standard/tests/file/mkdir-004.phpt b/ext/standard/tests/file/mkdir-004.phpt
new file mode 100644
index 000000000..45c275106
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-004.phpt
@@ -0,0 +1,24 @@
+--TEST--
+recursive mkdir() tests
+--SKIPIF--
+<?php
+chdir("/");
+if (!@mkdir("testtmpskipifdir")) {
+ die("skip for root only");
+}
+rmdir("testtmpskipifdir");
+?>
+--FILE--
+<?php
+
+var_dump(mkdir("/testdir/subdir", 0777, true));
+var_dump(rmdir("/testdir/subdir"));
+var_dump(rmdir("/testdir"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+Done
diff --git a/ext/standard/tests/file/mkdir-005.phpt b/ext/standard/tests/file/mkdir-005.phpt
new file mode 100644
index 000000000..af2387ca7
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-005.phpt
@@ -0,0 +1,25 @@
+--TEST--
+recursive mkdir() tests
+--SKIPIF--
+<?php
+chdir("/");
+if (!@mkdir("testtmpskipifdir")) {
+ die("skip for root only");
+}
+rmdir("testtmpskipifdir");
+?>
+--FILE--
+<?php
+
+chdir("/");
+var_dump(mkdir("./testdir/subdir", 0777, true));
+var_dump(rmdir("./testdir/subdir"));
+var_dump(rmdir("./testdir"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+Done
diff --git a/ext/standard/tests/file/mkdir-006.phpt b/ext/standard/tests/file/mkdir-006.phpt
new file mode 100644
index 000000000..5bfa8e814
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-006.phpt
@@ -0,0 +1,26 @@
+--TEST--
+recursive mkdir() with unclean paths
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip only for Windows');
+}
+?>
+--FILE--
+<?php
+chdir(dirname(__FILE__));
+$dirpath = "./tmp/foo//bar/logs";
+mkdir($dirpath, 0777, true);
+
+if (is_dir($dirpath)) {
+ echo "Ok.\n";
+} else {
+ echo "Failed.\n";
+}
+rmdir("./tmp/foo/bar/logs");
+rmdir("./tmp/foo/bar/");
+rmdir("./tmp/foo/");
+rmdir("./tmp/");
+?>
+--EXPECT--
+Ok.
diff --git a/ext/standard/tests/file/stream_001.phpt b/ext/standard/tests/file/stream_001.phpt
new file mode 100644
index 000000000..8a3f03409
--- /dev/null
+++ b/ext/standard/tests/file/stream_001.phpt
@@ -0,0 +1,24 @@
+--TEST--
+stream_wrapper_unregister() & stream_wrapper_restore()
+--FILE--
+<?php
+
+var_dump(stream_wrapper_unregister('file'));
+var_dump(fopen("file://".__FILE__, "r"));
+var_dump(stream_wrapper_restore('file'));
+var_dump(fopen("file://".__FILE__, "r"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+
+Notice: fopen(): Unable to find the wrapper "file" - did you forget to enable it when you configured PHP? in %s on line %d
+
+Warning: fopen(): Plainfiles wrapper disabled in %s on line %d
+
+Warning: fopen(file:///%s): failed to open stream: no suitable wrapper could be found in %s on line %d
+bool(false)
+bool(true)
+resource(%d) of type (stream)
+Done
diff --git a/ext/standard/tests/file/stream_002.phpt b/ext/standard/tests/file/stream_002.phpt
new file mode 100644
index 000000000..ae10abf2d
--- /dev/null
+++ b/ext/standard/tests/file/stream_002.phpt
@@ -0,0 +1,53 @@
+--TEST--
+stream_socket_client() and invalid arguments
+--FILE--
+<?php
+
+$a = NULL;
+$b = NULL;
+var_dump(stream_socket_client("", $a, $b));
+var_dump($a, $b);
+var_dump(stream_socket_client("[", $a, $b));
+var_dump($a, $b);
+var_dump(stream_socket_client("[ ", $a, $b));
+var_dump($a, $b);
+var_dump(stream_socket_client(".", $a, $b));
+var_dump($a, $b);
+var_dump(stream_socket_client(1, $a, $b));
+var_dump($a, $b);
+var_dump(stream_socket_client(array(), $a, $b));
+var_dump($a, $b);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: stream_socket_client(): unable to connect to (Failed to parse address "") in %s on line %d
+bool(false)
+int(0)
+string(26) "Failed to parse address """
+
+Warning: stream_socket_client(): unable to connect to [ (Failed to parse address "[") in %s on line %d
+bool(false)
+int(0)
+string(27) "Failed to parse address "[""
+
+Warning: stream_socket_client(): unable to connect to [ (Failed to parse IPv6 address "[ ") in %s on line %d
+bool(false)
+int(0)
+string(33) "Failed to parse IPv6 address "[ ""
+
+Warning: stream_socket_client(): unable to connect to . (Failed to parse address ".") in %s on line %d
+bool(false)
+int(0)
+string(27) "Failed to parse address ".""
+
+Warning: stream_socket_client(): unable to connect to 1 (Failed to parse address "1") in %s on line %d
+bool(false)
+int(0)
+string(27) "Failed to parse address "1""
+
+Warning: stream_socket_client() expects parameter 1 to be string, array given in %s on line %d
+bool(false)
+int(0)
+string(27) "Failed to parse address "1""
+Done
diff --git a/ext/standard/tests/file/stream_copy_to_stream.phpt b/ext/standard/tests/file/stream_copy_to_stream.phpt
new file mode 100644
index 000000000..3f46eec0c
--- /dev/null
+++ b/ext/standard/tests/file/stream_copy_to_stream.phpt
@@ -0,0 +1,129 @@
+--TEST--
+stream_copy_to_stream() tests
+--FILE--
+<?php
+
+$initial_file = dirname(__FILE__).'/bug38086.txt';
+$new_file = dirname(__FILE__).'/bug38086_1.txt';
+
+$src = fopen($initial_file, 'r');
+stream_filter_append($src, "string.rot13", STREAM_FILTER_READ);
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, 0));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+stream_filter_append($src, "string.rot13", STREAM_FILTER_READ);
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, -1));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+stream_filter_append($src, "string.rot13", STREAM_FILTER_READ);
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, 1000000));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, 10));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, -1));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(0)
+string(0) ""
+int(134)
+string(134) "Nabgure qnl
+Jura gur cnvaf bs yvsr jba'g one zl jnl
+V'yy oernx gurfr punvaf
+Gung ubyq zr qbja
+V'yy grne lbh qbja vagb zl cevingr uryy
+"
+int(134)
+string(134) "Nabgure qnl
+Jura gur cnvaf bs yvsr jba'g one zl jnl
+V'yy oernx gurfr punvaf
+Gung ubyq zr qbja
+V'yy grne lbh qbja vagb zl cevingr uryy
+"
+int(134)
+string(134) "Another day
+When the pains of life won't bar my way
+I'll break these chains
+That hold me down
+I'll tear you down into my private hell
+"
+int(134)
+string(134) "Another day
+When the pains of life won't bar my way
+I'll break these chains
+That hold me down
+I'll tear you down into my private hell
+"
+int(10)
+string(10) "Another da"
+int(134)
+string(134) "Another day
+When the pains of life won't bar my way
+I'll break these chains
+That hold me down
+I'll tear you down into my private hell
+"
+Done
diff --git a/ext/standard/tests/file/stream_rfc2397_001.phpt b/ext/standard/tests/file/stream_rfc2397_001.phpt
new file mode 100755
index 000000000..23a573092
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_001.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Stream: RFC2397
+--FILE--
+<?php
+
+$data = 'data://,hello world';
+
+var_dump(file_get_contents($data));
+
+$file = fopen($data, 'r');
+unset($data);
+
+var_dump(stream_get_contents($file));
+
+?>
+===DONE===
+--EXPECT--
+string(11) "hello world"
+string(11) "hello world"
+===DONE=== \ No newline at end of file
diff --git a/ext/standard/tests/file/stream_rfc2397_002.phpt b/ext/standard/tests/file/stream_rfc2397_002.phpt
new file mode 100755
index 000000000..0a0a14a8e
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_002.phpt
@@ -0,0 +1,180 @@
+--TEST--
+Stream: RFC2397 getting meta data
+--FILE--
+<?php
+
+$streams = array(
+ 'data://,',
+ 'data://',
+ 'data://;base64,',
+ 'data://;base64',
+ 'data://foo,',
+ 'data://foo=bar,',
+ 'data://text/plain,',
+ 'data://text/plain;foo,',
+ 'data://text/plain;foo=bar,',
+ 'data://text/plain;foo=bar;bla,',
+ 'data://text/plain;foo=bar;base64,',
+ 'data://text/plain;foo=bar;bar=baz',
+ 'data://text/plain;foo=bar;bar=baz,',
+ );
+
+foreach($streams as $stream)
+{
+ $stream = fopen($stream, 'r');
+ $meta = @stream_get_meta_data($stream);
+ var_dump($meta);
+ var_dump(isset($meta['foo']) ? $meta['foo'] : null);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+array(7) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(8) "data://,"
+ ["base64"]=>
+ bool(false)
+}
+NULL
+
+Warning: fopen(data://): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+array(7) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(15) "data://;base64,"
+ ["base64"]=>
+ bool(true)
+}
+NULL
+
+Warning: fopen(data://;base64): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+
+Warning: fopen(data://foo,): failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+
+Warning: fopen(data://foo=bar,): failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+array(8) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(18) "data://text/plain,"
+ ["mediatype"]=>
+ string(10) "text/plain"
+ ["base64"]=>
+ bool(false)
+}
+NULL
+
+Warning: fopen(data://text/plain;foo,): failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+array(9) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(26) "data://text/plain;foo=bar,"
+ ["mediatype"]=>
+ string(10) "text/plain"
+ ["foo"]=>
+ string(3) "bar"
+ ["base64"]=>
+ bool(false)
+}
+string(3) "bar"
+
+Warning: fopen(data://text/plain;foo=bar;bla,): failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+array(9) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(33) "data://text/plain;foo=bar;base64,"
+ ["mediatype"]=>
+ string(10) "text/plain"
+ ["foo"]=>
+ string(3) "bar"
+ ["base64"]=>
+ bool(true)
+}
+string(3) "bar"
+
+Warning: fopen(data://text/plain;foo=bar;bar=baz): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+array(10) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(34) "data://text/plain;foo=bar;bar=baz,"
+ ["mediatype"]=>
+ string(10) "text/plain"
+ ["foo"]=>
+ string(3) "bar"
+ ["bar"]=>
+ string(3) "baz"
+ ["base64"]=>
+ bool(false)
+}
+string(3) "bar"
+===DONE===
diff --git a/ext/standard/tests/file/stream_rfc2397_003.gif b/ext/standard/tests/file/stream_rfc2397_003.gif
new file mode 100755
index 000000000..3dc4fc65f
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_003.gif
Binary files differ
diff --git a/ext/standard/tests/file/stream_rfc2397_003.phpt b/ext/standard/tests/file/stream_rfc2397_003.phpt
new file mode 100755
index 000000000..a4d019d18
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_003.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Stream: RFC2397 decoding data
+--FILE--
+<?php
+
+$streams = array(
+ 'data://,A%20brief%20note',
+ 'data://application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local',
+ 'data://;base64,Zm9vYmFyIGZvb2Jhcg==',
+ 'stream_rfc2397_003.gif' => 'data://image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw
+AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz
+ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp
+a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl
+ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis
+F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH
+hhx4dbgYKAAA7',
+ );
+
+foreach($streams as $original => $stream)
+{
+ if (is_string($original)) {
+ var_dump(file_get_contents(dirname(__FILE__) . '/' . $original) == file_get_contents($stream));
+ } else {
+ var_dump(file_get_contents($stream));
+ }
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(12) "A brief note"
+string(40) "select_vcount,fcol_from_fieldtable/local"
+string(13) "foobar foobar"
+bool(true)
+===DONE===
diff --git a/ext/standard/tests/file/stream_rfc2397_004.phpt b/ext/standard/tests/file/stream_rfc2397_004.phpt
new file mode 100755
index 000000000..ac7156476
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_004.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Stream: RFC2397 Mozilla tests
+--FILE--
+<?php
+
+$streams = array(
+ 'data://,;test',
+ 'data://text/plain,test',
+ 'data://text/plain;charset=US-ASCII,test',
+ 'data://;charset=UTF-8,Hello',
+ 'data://text/plain;charset=UTF-8,Hello',
+ 'data://,a,b',
+ );
+
+foreach($streams as $stream)
+{
+ var_dump(@file_get_contents($stream));
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(5) ";test"
+string(4) "test"
+string(4) "test"
+bool(false)
+string(5) "Hello"
+string(3) "a,b"
+===DONE=== \ No newline at end of file
diff --git a/ext/standard/tests/file/stream_rfc2397_005.phpt b/ext/standard/tests/file/stream_rfc2397_005.phpt
new file mode 100755
index 000000000..892af432b
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_005.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Stream: RFC2397 without //
+--FILE--
+<?php
+
+$streams = array(
+ 'data:,A%20brief%20note',
+ 'data:application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local',
+ 'data:;base64,Zm9vYmFyIGZvb2Jhcg==',
+ 'data:,;test',
+ 'data:text/plain,test',
+ 'data:text/plain;charset=US-ASCII,test',
+ 'data:;charset=UTF-8,Hello',
+ 'data:text/plain;charset=UTF-8,Hello',
+ 'data:,a,b',
+ );
+
+foreach($streams as $stream)
+{
+ var_dump(@file_get_contents($stream));
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(12) "A brief note"
+string(40) "select_vcount,fcol_from_fieldtable/local"
+string(13) "foobar foobar"
+string(5) ";test"
+string(4) "test"
+string(4) "test"
+bool(false)
+string(5) "Hello"
+string(3) "a,b"
+===DONE=== \ No newline at end of file
diff --git a/ext/standard/tests/file/stream_rfc2397_006.phpt b/ext/standard/tests/file/stream_rfc2397_006.phpt
new file mode 100755
index 000000000..06734fba3
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_006.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Stream: RFC2397 with corrupt? payload
+--FILE--
+<?php
+
+$streams = array(
+ "data:;base64,\0Zm9vYmFyIGZvb2Jhcg==",
+ "data:;base64,Zm9vYmFy\0IGZvb2Jhcg==",
+ 'data:;base64,#Zm9vYmFyIGZvb2Jhcg==',
+ 'data:;base64,#Zm9vYmFyIGZvb2Jhc=',
+ );
+
+foreach($streams as $stream)
+{
+ var_dump(file_get_contents($stream));
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(0) ""
+string(6) "foobar"
+string(13) "foobar foobar"
+
+Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhc=): failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d
+bool(false)
+===DONE===
diff --git a/ext/standard/tests/file/stream_rfc2397_007.phpt b/ext/standard/tests/file/stream_rfc2397_007.phpt
new file mode 100755
index 000000000..e4341526d
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_007.phpt
@@ -0,0 +1,141 @@
+--TEST--
+Stream: RFC2397 and seeking
+--FILE--
+<?php
+
+$streams = array(
+ "data:,012345",
+ );
+
+foreach($streams as $stream)
+{
+ echo "===$stream===\n";
+
+ $fp = fopen($stream, 'rb');
+
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:4,S===\n";
+ var_dump(fseek($fp, 4));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===GETC===\n";
+ var_dump(fgetc($fp));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===GETC===\n";
+ var_dump(fgetc($fp));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===REWIND===\n";
+ var_dump(rewind($fp));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===GETC===\n";
+ var_dump(fgetc($fp));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:3,S===\n";
+ var_dump(fseek($fp, 3, SEEK_SET));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:1,C===\n";
+ var_dump(fseek($fp, 1, SEEK_CUR));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:-2,C===\n";
+ var_dump(fseek($fp, -2, SEEK_CUR));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:-10,C===\n";
+ var_dump(fseek($fp, -10, SEEK_CUR));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:3,S===\n";
+ var_dump(fseek($fp, 3, SEEK_SET));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:10,C===\n";
+ var_dump(fseek($fp, 10, SEEK_CUR));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:-1,E===\n";
+ var_dump(fseek($fp, -1, SEEK_END));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:0,E===\n";
+ var_dump(fseek($fp, 0, SEEK_END));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:1,E===\n";
+ var_dump(fseek($fp, 1, SEEK_END));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+
+ fclose($fp);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===data:,012345===
+int(0)
+bool(false)
+===S:4,S===
+int(0)
+int(4)
+bool(false)
+===GETC===
+string(1) "4"
+int(5)
+bool(false)
+===GETC===
+string(1) "5"
+int(6)
+bool(true)
+===REWIND===
+bool(true)
+int(0)
+bool(false)
+===GETC===
+string(1) "0"
+int(1)
+bool(false)
+===S:3,S===
+int(0)
+int(3)
+bool(false)
+===S:1,C===
+int(0)
+int(4)
+bool(false)
+===S:-2,C===
+int(0)
+int(2)
+bool(false)
+===S:-10,C===
+int(-1)
+bool(false)
+bool(false)
+===S:3,S===
+int(0)
+int(3)
+bool(false)
+===S:10,C===
+int(-1)
+bool(false)
+bool(false)
+===S:-1,E===
+int(0)
+int(5)
+bool(false)
+===S:0,E===
+int(0)
+int(6)
+bool(false)
+===S:1,E===
+int(-1)
+bool(false)
+bool(false)
+===DONE===
diff --git a/ext/standard/tests/filters/001.phpt b/ext/standard/tests/filters/001.phpt
new file mode 100644
index 000000000..afbcdcfdd
--- /dev/null
+++ b/ext/standard/tests/filters/001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+stream_filter_register() and invalid arguments
+--FILE--
+<?php
+
+var_dump(stream_filter_register("", ""));
+var_dump(stream_filter_register("test", ""));
+var_dump(stream_filter_register("", "test"));
+var_dump(stream_filter_register("------", "nonexistentclass"));
+var_dump(stream_filter_register(array(), "aa"));
+var_dump(stream_filter_register("", array()));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: stream_filter_register(): Filter name cannot be empty in %s on line %d
+bool(false)
+
+Warning: stream_filter_register(): Class name cannot be empty in %s on line %d
+bool(false)
+
+Warning: stream_filter_register(): Filter name cannot be empty in %s on line %d
+bool(false)
+bool(true)
+
+Warning: stream_filter_register() expects parameter 1 to be string, array given in %s on line %d
+bool(false)
+
+Warning: stream_filter_register() expects parameter 2 to be string, array given in %s on line %d
+bool(false)
+Done
diff --git a/ext/standard/tests/filters/php_user_filter_01.phpt b/ext/standard/tests/filters/php_user_filter_01.phpt
new file mode 100644
index 000000000..534b9abf3
--- /dev/null
+++ b/ext/standard/tests/filters/php_user_filter_01.phpt
@@ -0,0 +1,17 @@
+--TEST--
+class php_user_filter#1
+--FILE--
+<?php
+class foo extends php_user_filter {
+ function filter($in, $out, &$consumed, $closing) {}
+ function onCreate() {}
+ function onClose() {}
+}
+class bar extends php_user_filter {
+ function filter($in, $out, &$consumed) {}
+ function onCreate() {}
+ function onClose() {}
+}
+?>
+--EXPECTF--
+Strict Standards: Declaration of bar::filter() should be compatible with that of php_user_filter::filter() in %s on line %d
diff --git a/ext/standard/tests/filters/php_user_filter_02.phpt b/ext/standard/tests/filters/php_user_filter_02.phpt
new file mode 100644
index 000000000..73a1f0267
--- /dev/null
+++ b/ext/standard/tests/filters/php_user_filter_02.phpt
@@ -0,0 +1,12 @@
+--TEST--
+class php_user_filter#2
+--FILE--
+<?php
+class foo extends php_user_filter {
+ function filter($in, $out, $consumed, $closing) {}
+ function onCreate() {}
+ function onClose() {}
+}
+?>
+--EXPECTF--
+Strict Standards: Declaration of foo::filter() should be compatible with that of php_user_filter::filter() in %s on line %d
diff --git a/ext/standard/tests/filters/php_user_filter_03.phpt b/ext/standard/tests/filters/php_user_filter_03.phpt
new file mode 100644
index 000000000..5962951ee
--- /dev/null
+++ b/ext/standard/tests/filters/php_user_filter_03.phpt
@@ -0,0 +1,12 @@
+--TEST--
+class php_user_filter#3
+--FILE--
+<?php
+class foo extends php_user_filter {
+ function filter($in, $out, &$consumed, $closing) {}
+ function onCreate($var) {}
+ function onClose() {}
+}
+?>
+--EXPECTF--
+Strict Standards: Declaration of foo::onCreate() should be compatible with that of php_user_filter::onCreate() in %s on line %d
diff --git a/ext/standard/tests/general_functions/010.phpt b/ext/standard/tests/general_functions/010.phpt
new file mode 100644
index 000000000..8d1075f84
--- /dev/null
+++ b/ext/standard/tests/general_functions/010.phpt
@@ -0,0 +1,25 @@
+--TEST--
+register_shutdown_function() & __call
+--FILE--
+<?php
+class test {
+ function _foo() {
+ throw new Exception('test');
+ }
+ function __call($name=null, $args=null) {
+ return test::_foo();
+ }
+}
+
+var_dump(register_shutdown_function(array("test","__call")));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Non-static method test::__call() cannot be called statically in %s on line %d
+NULL
+Done
+
+Strict Standards: Non-static method test::__call() cannot be called statically in Unknown on line 0
+
+Fatal error: Non-static method test::__call() cannot be called statically in Unknown on line 0
diff --git a/ext/standard/tests/general_functions/sunfuncts.phpt b/ext/standard/tests/general_functions/sunfuncts.phpt
index 8d32e7171..4d95c59ec 100644
--- a/ext/standard/tests/general_functions/sunfuncts.phpt
+++ b/ext/standard/tests/general_functions/sunfuncts.phpt
@@ -17,28 +17,28 @@ for($a=1;$a<=12;$a++){
echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n";
}
?>
---EXPECT--
-1041395864 06:37 6.629013145891
-1041432452 16:47 16.79245111439
-1044073855 06:30 6.515408927982
-1044112463 17:14 17.23987028904
-1046491495 06:04 6.082214503336
-1046533075 17:37 17.63201103534
-1049167581 05:26 5.439443811173
-1049212774 17:59 17.99303572948
-1051757532 04:52 4.870193412616
-1051806007 18:20 18.33539050867
-1054434776 04:32 4.548982718277
-1054485647 18:40 18.67981294906
-1057026949 04:35 4.597195637274
-1057078197 18:49 18.83256339675
-1059706409 04:53 4.891657508917
-1059755837 18:37 18.62144070428
-1062385999 05:13 5.222095112101
-1062432291 18:04 18.08095716848
-1064979098 05:31 5.527319921542
-1065021952 17:25 17.43133913592
-1067658845 05:54 5.901629287095
-1067698274 16:51 16.85390245352
-1070252387 06:19 6.329924268936
-1070289382 16:36 16.60631260094
+--EXPECTF--
+1041395864 06:37 6.6290131458%d
+1041432452 16:47 16.792451114%d
+1044073855 06:30 6.5154089279%d
+1044112463 17:14 17.239870289%d
+1046491495 06:04 6.0822145033%d
+1046533075 17:37 17.632011035%d
+1049167581 05:26 5.4394438111%d
+1049212774 17:59 17.993035729%d
+1051757532 04:52 4.8701934126%d
+1051806007 18:20 18.335390508%d
+1054434776 04:32 4.5489827182%d
+1054485647 18:40 18.679812949%d
+1057026949 04:35 4.5971956372%d
+1057078197 18:49 18.832563396%d
+1059706409 04:53 4.8916575089%d
+1059755837 18:37 18.621440704%d
+1062385999 05:13 5.2220951121%d
+1062432291 18:04 18.080957168%d
+1064979098 05:31 5.5273199215%d
+1065021952 17:25 17.431339135%d
+1067658845 05:54 5.9016292870%d
+1067698274 16:51 16.853902453%d
+1070252387 06:19 6.3299242689%d
+1070289382 16:36 16.606312600%d
diff --git a/ext/standard/tests/image/image_type_to_extension.phpt b/ext/standard/tests/image/image_type_to_extension.phpt
new file mode 100644
index 000000000..31bcfd612
--- /dev/null
+++ b/ext/standard/tests/image/image_type_to_extension.phpt
@@ -0,0 +1,103 @@
+--TEST--
+image_type_to_extension()
+--SKIPIF--
+<?php
+ if (!function_exists('image_type_to_extension')) die('skip image_type_to_extension() not available');
+ require_once('skipif_imagetype.inc');
+?>
+--FILE--
+<?php
+ $constants = array(
+ "IMAGETYPE_GIF" => IMAGETYPE_GIF,
+ "IMAGETYPE_JPEG" => IMAGETYPE_JPEG,
+ "IMAGETYPE_PNG" => IMAGETYPE_PNG,
+ "IMAGETYPE_SWF" => IMAGETYPE_SWF,
+ "IMAGETYPE_PSD" => IMAGETYPE_PSD,
+ "IMAGETYPE_BMP" => IMAGETYPE_BMP,
+ "IMAGETYPE_TIFF_II" => IMAGETYPE_TIFF_II,
+ "IMAGETYPE_TIFF_MM" => IMAGETYPE_TIFF_MM,
+ "IMAGETYPE_JPC" => IMAGETYPE_JPC,
+ "IMAGETYPE_JP2" => IMAGETYPE_JP2,
+ "IMAGETYPE_JPX" => IMAGETYPE_JPX,
+ "IMAGETYPE_JB2" => IMAGETYPE_JB2,
+ "IMAGETYPE_IFF" => IMAGETYPE_IFF,
+ "IMAGETYPE_WBMP" => IMAGETYPE_WBMP,
+ "IMAGETYPE_JPEG2000" => IMAGETYPE_JPEG2000,
+ "IMAGETYPE_XBM" => IMAGETYPE_XBM
+ );
+ foreach($constants as $name => $constant) {
+ printf("Constant: %s\n\tWith dot: %s\n\tWithout dot: %s\n", $name, image_type_to_extension($constant), image_type_to_extension($constant, false));
+ }
+
+ var_dump(image_type_to_extension(-1, array()));
+ var_dump(image_type_to_extension(new stdclass));
+ var_dump(image_type_to_extension(1000000, NULL));
+ var_dump(image_type_to_extension());
+ var_dump(image_type_to_extension(0));
+ var_dump(image_type_to_extension(0, 0, 0));
+?>
+Done
+--EXPECTF--
+Constant: IMAGETYPE_GIF
+ With dot: .gif
+ Without dot: gif
+Constant: IMAGETYPE_JPEG
+ With dot: .jpeg
+ Without dot: jpeg
+Constant: IMAGETYPE_PNG
+ With dot: .png
+ Without dot: png
+Constant: IMAGETYPE_SWF
+ With dot: .swf
+ Without dot: swf
+Constant: IMAGETYPE_PSD
+ With dot: .psd
+ Without dot: psd
+Constant: IMAGETYPE_BMP
+ With dot: .bmp
+ Without dot: bmp
+Constant: IMAGETYPE_TIFF_II
+ With dot: .tiff
+ Without dot: tiff
+Constant: IMAGETYPE_TIFF_MM
+ With dot: .tiff
+ Without dot: tiff
+Constant: IMAGETYPE_JPC
+ With dot: .jpc
+ Without dot: jpc
+Constant: IMAGETYPE_JP2
+ With dot: .jp2
+ Without dot: jp2
+Constant: IMAGETYPE_JPX
+ With dot: .jpx
+ Without dot: jpx
+Constant: IMAGETYPE_JB2
+ With dot: .jb2
+ Without dot: jb2
+Constant: IMAGETYPE_IFF
+ With dot: .iff
+ Without dot: iff
+Constant: IMAGETYPE_WBMP
+ With dot: .bmp
+ Without dot: bmp
+Constant: IMAGETYPE_JPEG2000
+ With dot: .jpc
+ Without dot: jpc
+Constant: IMAGETYPE_XBM
+ With dot: .xbm
+ Without dot: xbm
+
+Warning: image_type_to_extension() expects parameter 2 to be boolean, array given in %s on line %d
+bool(false)
+
+Warning: image_type_to_extension() expects parameter 1 to be long, object given in %s on line %d
+bool(false)
+bool(false)
+
+Warning: image_type_to_extension() expects at least 1 parameter, 0 given in %s on line %d
+bool(false)
+bool(false)
+
+Warning: image_type_to_extension() expects at most 2 parameters, 3 given in %s on line %d
+bool(false)
+Done
diff --git a/ext/standard/tests/math/constants.phpt b/ext/standard/tests/math/constants.phpt
new file mode 100644
index 000000000..7b5110f53
--- /dev/null
+++ b/ext/standard/tests/math/constants.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Math constants
+--FILE--
+<?php
+$constants = array(
+ "M_E",
+ "M_LOG2E",
+ "M_LOG10E",
+ "M_LN2",
+ "M_LN10",
+ "M_PI",
+ "M_PI_2",
+ "M_PI_4",
+ "M_1_PI",
+ "M_2_PI",
+ "M_SQRTPI",
+ "M_2_SQRTPI",
+ "M_LNPI",
+ "M_EULER",
+ "M_SQRT2",
+ "M_SQRT1_2",
+ "M_SQRT3"
+);
+foreach($constants as $constant) {
+ printf("%-10s: %s\n", $constant, constant($constant));
+}
+?>
+--EXPECTREGEX--
+M_E : 2.718281[0-9]*
+M_LOG2E : 1.442695[0-9]*
+M_LOG10E : 0.434294[0-9]*
+M_LN2 : 0.693147[0-9]*
+M_LN10 : 2.302585[0-9]*
+M_PI : 3.141592[0-9]*
+M_PI_2 : 1.570796[0-9]*
+M_PI_4 : 0.785398[0-9]*
+M_1_PI : 0.318309[0-9]*
+M_2_PI : 0.636619[0-9]*
+M_SQRTPI : 1.772453[0-9]*
+M_2_SQRTPI: 1.128379[0-9]*
+M_LNPI : 1.144729[0-9]*
+M_EULER : 0.577215[0-9]*
+M_SQRT2 : 1.414213[0-9]*
+M_SQRT1_2 : 0.707106[0-9]*
+M_SQRT3 : 1.732050[0-9]*
+
diff --git a/ext/standard/tests/serialize/bug37947.phpt b/ext/standard/tests/serialize/bug37947.phpt
new file mode 100755
index 000000000..89641635c
--- /dev/null
+++ b/ext/standard/tests/serialize/bug37947.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #37947 (zend_ptr_stack reallocation problem)
+--INI--
+error_reporting=0
+--FILE--
+<?php
+class test {
+ function extend_zend_ptr_stack($count,$a,$b,$c,$d,$e) {
+ if ($count>0) $this->extend_zend_ptr_stack($count -
+1,$a,$b,$c,$d,$e);
+ }
+
+ function __wakeup() {
+ $this->extend_zend_ptr_stack(10,'a','b','c','d','e');
+ }
+}
+
+$str='a:2:{i:0;O:4:"test":0:{}junk';
+var_dump(unserialize($str));
+--EXPECT--
+bool(false)
diff --git a/ext/standard/tests/strings/bug22224.phpt b/ext/standard/tests/strings/bug22224.phpt
index d64fc0acf..c30f222f3 100644
--- a/ext/standard/tests/strings/bug22224.phpt
+++ b/ext/standard/tests/strings/bug22224.phpt
@@ -4,7 +4,12 @@ Bug #22224 (implode changes object references in array)
error_reporting=0
--FILE--
<?php
-class foo {
+class foo
+{
+ function __toString()
+ {
+ return "Object";
+ }
}
diff --git a/ext/standard/tests/strings/bug24098.phpt b/ext/standard/tests/strings/bug24098.phpt
index 9ff51a420..1998d9ed0 100644
--- a/ext/standard/tests/strings/bug24098.phpt
+++ b/ext/standard/tests/strings/bug24098.phpt
@@ -7,11 +7,13 @@ Bug #24098 (pathinfo() crash)
var_dump(pathinfo("/dsds.asa"));
?>
--EXPECT--
-array(3) {
+array(4) {
["dirname"]=>
string(1) "/"
["basename"]=>
string(8) "dsds.asa"
["extension"]=>
string(3) "asa"
+ ["filename"]=>
+ string(4) "dsds"
}
diff --git a/ext/standard/tests/strings/bug29538.phpt b/ext/standard/tests/strings/bug29538.phpt
new file mode 100644
index 000000000..6af25fb89
--- /dev/null
+++ b/ext/standard/tests/strings/bug29538.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #29538 (number_format and problem with 0)
+--FILE--
+<?php
+ echo number_format(0.25, 2, '', ''), "\n";
+ echo number_format(1234, 2, '', ',');
+?>
+--EXPECT--
+025
+1,23400
diff --git a/ext/standard/tests/strings/bug37244.phpt b/ext/standard/tests/strings/bug37244.phpt
new file mode 100644
index 000000000..0718c8a4d
--- /dev/null
+++ b/ext/standard/tests/strings/bug37244.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #37244 (base64_decode violates RFC 3548)
+--FILE--
+<?php
+$strings = array(
+ 'SW1wbGVtZW50YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu',
+ 'SW1wbGVtZW$0YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu',
+ 'SW1wbGVtZW0YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu'
+);
+foreach($strings as $string) {
+ var_dump(base64_decode($string, true));
+}
+?>
+--EXPECT--
+string(93) "Implementations MUST reject the encoding if it contains characters outside the base alphabet."
+bool(false)
+string(92) "Implemem][ۜUTZXH[[Y]۝Z[\X\]YHH\H[X] "
+
diff --git a/ext/standard/tests/strings/bug37262.phpt b/ext/standard/tests/strings/bug37262.phpt
new file mode 100644
index 000000000..474251a81
--- /dev/null
+++ b/ext/standard/tests/strings/bug37262.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bug #37262 (var_export() does not escape \0 character)
+--FILE--
+<?php
+$func = create_function('$a', 'return $a;');
+var_export($func);
+?>
+--EXPECT--
+'\000lambda_1'
diff --git a/ext/standard/tests/strings/bug38322.phpt b/ext/standard/tests/strings/bug38322.phpt
new file mode 100644
index 000000000..37f5a93f6
--- /dev/null
+++ b/ext/standard/tests/strings/bug38322.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #38322 (reading past array in sscanf() leads to segfault/arbitary code execution)
+--FILE--
+<?php
+
+$str = "a b c d e";
+var_dump(sscanf("a ",'%1$s',$str));
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(1)
+Done
diff --git a/ext/standard/tests/strings/bug39032.phpt b/ext/standard/tests/strings/bug39032.phpt
new file mode 100644
index 000000000..dbd39ec9d
--- /dev/null
+++ b/ext/standard/tests/strings/bug39032.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #39032 (strcspn() stops on null character)
+--FILE--
+<?php
+
+var_dump(strcspn(chr(0),"x"));
+var_dump(strcspn(chr(0),""));
+var_dump(strcspn(chr(0),"qweqwe"));
+var_dump(strcspn(chr(1),"qweqwe"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(1)
+int(0)
+int(1)
+int(1)
+Done
diff --git a/ext/standard/tests/strings/explode.phpt b/ext/standard/tests/strings/explode.phpt
index 1198a09a9..defb79c22 100644
--- a/ext/standard/tests/strings/explode.phpt
+++ b/ext/standard/tests/strings/explode.phpt
@@ -29,7 +29,7 @@ var_dump(explode(":^:","a lazy dog:^:jumps::over:^:",-1));
var_dump(explode(":^:","a lazy dog:^:jumps::over:^:",-2));
?>
--EXPECTF--
-26d4e18734cb2582df5055e2175223df
+6e5d59d5afd6693547a733219d079658
bool(false)
bool(false)
bool(false)
diff --git a/ext/standard/tests/strings/htmlentities15.phpt b/ext/standard/tests/strings/htmlentities15.phpt
index a0e534aba..2dc36e6f7 100644
--- a/ext/standard/tests/strings/htmlentities15.phpt
+++ b/ext/standard/tests/strings/htmlentities15.phpt
@@ -6,14 +6,14 @@ default_charset=
mbstring.internal_encoding=none
--SKIPIF--
<?php
-$result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r");
+$result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R");
if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) {
die("skip setlocale() failed\n");
}
?>
--FILE--
<?php
-setlocale(LC_CTYPE, "ru_RU.koi8r");
+setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R");
$str = "";
var_dump($str, htmlentities($str, ENT_QUOTES, ''));
?>
diff --git a/ext/standard/tests/strings/implode1.phpt b/ext/standard/tests/strings/implode1.phpt
new file mode 100644
index 000000000..1582c2516
--- /dev/null
+++ b/ext/standard/tests/strings/implode1.phpt
@@ -0,0 +1,59 @@
+--TEST--
+implode() and various args
+--FILE--
+<?php
+
+$a = array(
+ array(1,2),
+ array(1.1,2.2),
+ array(array(2),array(1)),
+ array(false,true),
+ );
+
+foreach ($a as $val) {
+ var_dump(implode(', ', $val));
+ var_dump($val);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(4) "1, 2"
+array(2) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+}
+string(8) "1.1, 2.2"
+array(2) {
+ [0]=>
+ float(1.1)
+ [1]=>
+ float(2.2)
+}
+
+Notice: Array to string conversion in %s on line %d
+
+Notice: Array to string conversion in %s on line %d
+string(12) "Array, Array"
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
+}
+string(3) ", 1"
+array(2) {
+ [0]=>
+ bool(false)
+ [1]=>
+ bool(true)
+}
+Done
diff --git a/ext/standard/tests/strings/pathinfo.phpt b/ext/standard/tests/strings/pathinfo.phpt
new file mode 100644
index 000000000..c1d58f05b
--- /dev/null
+++ b/ext/standard/tests/strings/pathinfo.phpt
@@ -0,0 +1,108 @@
+--TEST--
+pathinfo() tests
+--FILE--
+<?php
+
+var_dump(pathinfo());
+var_dump(pathinfo(""));
+var_dump(pathinfo("."));
+var_dump(pathinfo(".."));
+var_dump(pathinfo("/"));
+var_dump(pathinfo("./"));
+var_dump(pathinfo("/."));
+var_dump(pathinfo(".cvsignore"));
+var_dump(pathinfo(__FILE__, PATHINFO_BASENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_FILENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION));
+var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME));
+var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME));
+var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_BASENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_BASENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_DIRNAME));
+var_dump(pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_BASENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_EXTENSION));
+var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_BASENAME));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: pathinfo() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+array(2) {
+ ["basename"]=>
+ string(0) ""
+ ["filename"]=>
+ string(0) ""
+}
+array(4) {
+ ["dirname"]=>
+ string(1) "."
+ ["basename"]=>
+ string(1) "."
+ ["extension"]=>
+ string(0) ""
+ ["filename"]=>
+ string(0) ""
+}
+array(4) {
+ ["dirname"]=>
+ string(1) "."
+ ["basename"]=>
+ string(2) ".."
+ ["extension"]=>
+ string(0) ""
+ ["filename"]=>
+ string(1) "."
+}
+array(3) {
+ ["dirname"]=>
+ string(1) "/"
+ ["basename"]=>
+ string(0) ""
+ ["filename"]=>
+ string(0) ""
+}
+array(4) {
+ ["dirname"]=>
+ string(1) "."
+ ["basename"]=>
+ string(1) "."
+ ["extension"]=>
+ string(0) ""
+ ["filename"]=>
+ string(0) ""
+}
+array(4) {
+ ["dirname"]=>
+ string(1) "/"
+ ["basename"]=>
+ string(1) "."
+ ["extension"]=>
+ string(0) ""
+ ["filename"]=>
+ string(0) ""
+}
+array(4) {
+ ["dirname"]=>
+ string(1) "."
+ ["basename"]=>
+ string(10) ".cvsignore"
+ ["extension"]=>
+ string(9) "cvsignore"
+ ["filename"]=>
+ string(0) ""
+}
+string(12) "pathinfo.php"
+string(8) "pathinfo"
+string(3) "php"
+string(%d) "%s/strings"
+string(%d) "%s/strings"
+string(12) "pathinfo.php"
+string(3) "php"
+string(12) "pathinfo.php"
+string(%d) "%s/strings"
+string(12) "pathinfo.php"
+string(%d) "%s/strings"
+string(%d) "%s/strings"
+Done
diff --git a/ext/standard/tests/strings/str_replace.phpt b/ext/standard/tests/strings/str_replace.phpt
new file mode 100644
index 000000000..46d732a69
--- /dev/null
+++ b/ext/standard/tests/strings/str_replace.phpt
@@ -0,0 +1,108 @@
+--TEST--
+str_replace() tests
+--FILE--
+<?php
+
+var_dump(str_replace("", "", ""));
+
+var_dump(str_replace("e", "b", "test"));
+
+var_dump(str_replace("", "", "", $count));
+var_dump($count);
+
+var_dump(str_replace("q", "q", "q", $count));
+var_dump($count);
+
+var_dump(str_replace("long string here", "", "", $count));
+var_dump($count);
+
+var_dump(str_replace(chr(0), "a", "", $count));
+var_dump($count);
+
+var_dump(str_replace(chr(0), "a", chr(0), $count));
+var_dump($count);
+
+var_dump(str_replace("multi", "a", "aaa", $count));
+var_dump($count);
+
+var_dump(str_replace("a", "multi", "aaa", $count));
+var_dump($count);
+
+var_dump(str_replace(array("a", "a", "b"), "multi", "aaa", $count));
+var_dump($count);
+
+var_dump(str_replace(array("a", "a", "b"), array("q", "q", "c"), "aaa", $count));
+var_dump($count);
+
+var_dump(str_replace(array("a", "a", "b"), array("q", "q", "c"), array("aaa", "bbb"), $count));
+var_dump($count);
+
+var_dump(str_replace("a", array("q", "q", "c"), array("aaa", "bbb"), $count));
+var_dump($count);
+
+var_dump(str_replace("a", 1, array("aaa", "bbb"), $count));
+var_dump($count);
+
+var_dump(str_replace(1, 3, array("aaa1", "2bbb"), $count));
+var_dump($count);
+
+$fp = fopen(__FILE__, "r");
+var_dump(str_replace($fp, $fp, $fp, $fp));
+var_dump($fp);
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(0) ""
+string(4) "tbst"
+string(0) ""
+int(0)
+string(1) "q"
+int(1)
+string(0) ""
+int(0)
+string(0) ""
+int(0)
+string(1) "a"
+int(1)
+string(3) "aaa"
+int(0)
+string(15) "multimultimulti"
+int(3)
+string(15) "multimultimulti"
+int(3)
+string(3) "qqq"
+int(3)
+array(2) {
+ [0]=>
+ string(3) "qqq"
+ [1]=>
+ string(3) "ccc"
+}
+int(6)
+
+Notice: Array to string conversion in %s on line %d
+array(2) {
+ [0]=>
+ string(15) "ArrayArrayArray"
+ [1]=>
+ string(3) "bbb"
+}
+int(3)
+array(2) {
+ [0]=>
+ string(3) "111"
+ [1]=>
+ string(3) "bbb"
+}
+int(3)
+array(2) {
+ [0]=>
+ string(4) "aaa3"
+ [1]=>
+ string(4) "2bbb"
+}
+int(1)
+string(%d) "Resource id #%d"
+int(1)
+Done
diff --git a/ext/standard/tests/strings/str_word_count.phpt b/ext/standard/tests/strings/str_word_count.phpt
index 9d41fc147..11e1bb65e 100644
--- a/ext/standard/tests/strings/str_word_count.phpt
+++ b/ext/standard/tests/strings/str_word_count.phpt
@@ -12,7 +12,7 @@ var_dump(str_word_count($str));
var_dump(str_word_count($str, 3));
var_dump(str_word_count($str, 123));
var_dump(str_word_count($str, -1));
-var_dump(str_word_count($str, 99999999999999999));
+var_dump(str_word_count($str, 999999999));
var_dump(str_word_count($str, array()));
var_dump(str_word_count($str, $b));
var_dump($str);
@@ -41,6 +41,8 @@ var_dump(str_word_count("'foo'", 2));
var_dump(str_word_count("'foo'", 2, "'"));
var_dump(str_word_count("-foo-", 2));
var_dump(str_word_count("-foo-", 2, "-"));
+
+echo "Done\n";
?>
--EXPECTF--
array(6) {
@@ -72,19 +74,23 @@ array(6) {
string(5) "today"
}
int(6)
-NULL
-NULL
-NULL
-NULL
-Warning: str_word_count() expects parameter 2 to be long, array given in %s on line 13
+Warning: str_word_count(): Invalid format value 3 in %s on line %d
+bool(false)
-Warning: Wrong parameter count for str_word_count() in %s on line 13
-NULL
+Warning: str_word_count(): Invalid format value 123 in %s on line %d
+bool(false)
-Warning: str_word_count() expects parameter 2 to be long, string given in %s on line 14
+Warning: str_word_count(): Invalid format value -1 in %s on line %d
+bool(false)
-Warning: Wrong parameter count for str_word_count() in %s on line 14
+Warning: str_word_count(): Invalid format value 999999999 in %s on line %d
+bool(false)
+
+Warning: str_word_count() expects parameter 2 to be long, array given in %s on line %d
+NULL
+
+Warning: str_word_count() expects parameter 2 to be long, string given in %s on line %d
NULL
string(55) "Hello friend, you're
looking good today!"
@@ -92,14 +98,10 @@ int(5)
int(6)
int(5)
-Warning: str_word_count() expects parameter 3 to be string, array given in %s on line 21
-
-Warning: Wrong parameter count for str_word_count() in %s on line 21
+Warning: str_word_count() expects parameter 3 to be string, array given in %s on line %d
NULL
-Warning: str_word_count() expects parameter 3 to be string, object given in %s on line 22
-
-Warning: Wrong parameter count for str_word_count() in %s on line 22
+Warning: str_word_count() expects parameter 3 to be string, object given in %s on line %d
NULL
int(7)
array(5) {
@@ -141,14 +143,10 @@ array(5) {
string(3) "foo"
}
-Warning: str_word_count() expects parameter 3 to be string, array given in %s on line 27
-
-Warning: Wrong parameter count for str_word_count() in %s on line 27
+Warning: str_word_count() expects parameter 3 to be string, array given in %s on line %d
NULL
-Warning: str_word_count() expects parameter 3 to be string, object given in %s on line 28
-
-Warning: Wrong parameter count for str_word_count() in %s on line 28
+Warning: str_word_count() expects parameter 3 to be string, object given in %s on line %d
NULL
array(7) {
[0]=>
@@ -205,14 +203,10 @@ array(5) {
string(3) "foo"
}
-Warning: str_word_count() expects parameter 3 to be string, array given in %s on line 33
-
-Warning: Wrong parameter count for str_word_count() in %s on line 33
+Warning: str_word_count() expects parameter 3 to be string, array given in %s on line %d
NULL
-Warning: str_word_count() expects parameter 3 to be string, object given in %s on line 34
-
-Warning: Wrong parameter count for str_word_count() in %s on line 34
+Warning: str_word_count() expects parameter 3 to be string, object given in %s on line %d
NULL
array(7) {
[0]=>
@@ -252,3 +246,4 @@ array(1) {
[0]=>
string(5) "-foo-"
}
+Done
diff --git a/ext/standard/tests/strings/str_word_count1.phpt b/ext/standard/tests/strings/str_word_count1.phpt
new file mode 100644
index 000000000..5f49fcfbf
--- /dev/null
+++ b/ext/standard/tests/strings/str_word_count1.phpt
@@ -0,0 +1,26 @@
+--TEST--
+str_word_count() and invalid arguments
+--FILE--
+<?php
+
+var_dump(str_word_count(""));
+var_dump(str_word_count("", -1));
+var_dump(str_word_count("", -1, $a));
+var_dump($a);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(0)
+
+Warning: str_word_count(): Invalid format value -1 in %s on line %d
+bool(false)
+
+Notice: Undefined variable: a in %s on line %d
+
+Warning: str_word_count(): Invalid format value -1 in %s on line %d
+bool(false)
+
+Notice: Undefined variable: a in %s on line %d
+NULL
+Done
diff --git a/ext/standard/tests/strings/strings001.phpt b/ext/standard/tests/strings/strings001.phpt
index 87f8489b8..70b709295 100644
--- a/ext/standard/tests/strings/strings001.phpt
+++ b/ext/standard/tests/strings/strings001.phpt
@@ -9,4 +9,4 @@ var_dump(strrchr($s," nic"));
?>
--EXPECTREGEX--
string\(18\) \"nica\x00turska panica\"
-string\(19\) \" nica\x00turska panica\"
+string\(7\) \" panica\"
diff --git a/ext/standard/tests/strings/stripos.phpt b/ext/standard/tests/strings/stripos.phpt
new file mode 100644
index 000000000..ef0efe5b2
--- /dev/null
+++ b/ext/standard/tests/strings/stripos.phpt
@@ -0,0 +1,55 @@
+--TEST--
+stripos() function test
+--FILE--
+<?php
+ var_dump(stripos("test string", "TEST"));
+ var_dump(stripos("test string", "strIng"));
+ var_dump(stripos("test string", "stRin"));
+ var_dump(stripos("test string", "t S"));
+ var_dump(stripos("test string", "G"));
+ var_dump(stripos("te".chr(0)."st", chr(0)));
+ var_dump(stripos("tEst", "test"));
+ var_dump(stripos("teSt", "test"));
+ var_dump(stripos("", ""));
+ var_dump(stripos("a", ""));
+ var_dump(stripos("", "a"));
+ var_dump(stripos("a", " "));
+ var_dump(stripos("a", "a"));
+ var_dump(stripos("", 1));
+ var_dump(stripos("", false));
+ var_dump(stripos("", true));
+ var_dump(stripos("a", 1));
+ var_dump(stripos("a", false));
+ var_dump(stripos("a", true));
+ var_dump(stripos("1", 1));
+ var_dump(stripos("0", false));
+ var_dump(stripos("1", true));
+ var_dump(stripos("\\\\a", "\\a"));
+
+ echo "Done\n";
+?>
+--EXPECT--
+int(0)
+int(5)
+int(5)
+int(3)
+int(10)
+int(2)
+int(0)
+int(0)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+int(0)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+int(1)
+Done
diff --git a/ext/standard/tests/strings/strrchr.phpt b/ext/standard/tests/strings/strrchr.phpt
new file mode 100644
index 000000000..5a1fe12a8
--- /dev/null
+++ b/ext/standard/tests/strings/strrchr.phpt
@@ -0,0 +1,22 @@
+--TEST--
+strrchr() tests
+--FILE--
+<?php
+
+var_dump(strrchr("", ""));
+var_dump(strrchr("abc", ""));
+var_dump(strrchr("", "abc"));
+var_dump(strrchr("abc", "abc"));
+var_dump(strrchr("test ".chr(0)." test", " "));
+var_dump(strrchr("test".chr(0)."string", "t"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+bool(false)
+bool(false)
+string(3) "abc"
+string(5) " test"
+string(5) "tring"
+Done
diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt
index 2d18fa5c0..e0e541103 100644
--- a/ext/standard/tests/strings/url_t.phpt
+++ b/ext/standard/tests/strings/url_t.phpt
@@ -71,6 +71,7 @@ $sample_urls = array (
'scheme:',
'foo+bar://baz@bang/bla',
'gg:9130731',
+'http://user:@pass@host/path?argument?value#etc',
);
foreach ($sample_urls as $url) {
@@ -525,11 +526,11 @@ array(7) {
["scheme"]=>
string(4) "http"
["host"]=>
- string(19) "hideout@www.php.net"
+ string(11) "www.php.net"
["port"]=>
int(80)
["user"]=>
- string(6) "secret"
+ string(14) "secret@hideout"
["path"]=>
string(10) "/index.php"
["query"]=>
@@ -685,6 +686,22 @@ array(2) {
["path"]=>
string(7) "9130731"
}
+array(7) {
+ ["scheme"]=>
+ string(4) "http"
+ ["host"]=>
+ string(4) "host"
+ ["user"]=>
+ string(4) "user"
+ ["pass"]=>
+ string(5) "@pass"
+ ["path"]=>
+ string(5) "/path"
+ ["query"]=>
+ string(14) "argument?value"
+ ["fragment"]=>
+ string(3) "etc"
+}
string(4) "http"
string(11) "www.php.net"
int(80)
diff --git a/ext/standard/tests/time/bug38524.phpt b/ext/standard/tests/time/bug38524.phpt
new file mode 100755
index 000000000..e9ccaaf38
--- /dev/null
+++ b/ext/standard/tests/time/bug38524.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #38524 (strptime() does not initialize the internal date storage structure)
+--FILE--
+<?php
+ var_dump(strptime('2006-08-20', '%Y-%m-%d'));
+?>
+===DONE===
+--EXPECTF--
+array(9) {
+ ["tm_sec"]=>
+ int(0)
+ ["tm_min"]=>
+ int(0)
+ ["tm_hour"]=>
+ int(0)
+ ["tm_mday"]=>
+ int(20)
+ ["tm_mon"]=>
+ int(7)
+ ["tm_year"]=>
+ int(106)
+ ["tm_wday"]=>
+ int(0)
+ ["tm_yday"]=>
+ int(%d)
+ ["unparsed"]=>
+ string(0) ""
+}
+===DONE===
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 09da50aef..26662b2cb 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -15,7 +15,7 @@
| Author: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: url.c,v 1.86.2.5 2006/02/12 16:39:44 iliaa Exp $ */
+/* $Id: url.c,v 1.86.2.5.2.6 2006/09/28 14:52:30 iliaa Exp $ */
#include <stdlib.h>
#include <string.h>
@@ -211,7 +211,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
}
/* check for login and password */
- if ((p = memchr(s, '@', (e-s)))) {
+ if ((p = zend_memrchr(s, '@', (e-s)))) {
if ((pp = memchr(s, ':', (p-s)))) {
if ((pp-s) > 0) {
ret->user = estrndup(s, (pp-s));
@@ -344,7 +344,7 @@ PHP_FUNCTION(parse_url)
resource = php_url_parse_ex(str, str_len);
if (resource == NULL) {
- php_error_docref1(NULL TSRMLS_CC, str, E_WARNING, "Unable to parse url");
+ php_error_docref1(NULL TSRMLS_CC, str, E_WARNING, "Unable to parse URL");
RETURN_FALSE;
}
@@ -375,7 +375,7 @@ PHP_FUNCTION(parse_url)
if (resource->fragment != NULL) RETVAL_STRING(resource->fragment, 1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid url component identifier %ld.", key);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL component identifier %ld.", key);
RETVAL_FALSE;
}
goto done;
@@ -653,7 +653,7 @@ PHPAPI int php_raw_url_decode(char *str, int len)
}
/* }}} */
-/* {{{ proto array get_headers(string url)
+/* {{{ proto array get_headers(string url[, int format])
fetches all the headers sent by the server in response to a HTTP request */
PHP_FUNCTION(get_headers)
{
@@ -661,8 +661,9 @@ PHP_FUNCTION(get_headers)
int url_len;
php_stream_context *context;
php_stream *stream;
- zval **prev_val, **hdr = NULL;
+ zval **prev_val, **hdr = NULL, **h;
HashPosition pos;
+ HashTable *hashT;
long format = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) {
@@ -674,10 +675,31 @@ PHP_FUNCTION(get_headers)
RETURN_FALSE;
}
+ if (!stream->wrapperdata || Z_TYPE_P(stream->wrapperdata) != IS_ARRAY) {
+ php_stream_close(stream);
+ RETURN_FALSE;
+ }
+
array_init(return_value);
- zend_hash_internal_pointer_reset_ex(HASH_OF(stream->wrapperdata), &pos);
- while (zend_hash_get_current_data_ex(HASH_OF(stream->wrapperdata), (void**)&hdr, &pos) != FAILURE) {
+ /* check for curl-wrappers that provide headers via a special "headers" element */
+ if (zend_hash_find(HASH_OF(stream->wrapperdata), "headers", sizeof("headers"), (void **)&h) != FAILURE && Z_TYPE_PP(h) == IS_ARRAY) {
+ /* curl-wrappers don't load data until the 1st read */
+ if (!Z_ARRVAL_PP(h)->nNumOfElements) {
+ php_stream_getc(stream);
+ }
+ zend_hash_find(HASH_OF(stream->wrapperdata), "headers", sizeof("headers"), (void **)&h);
+ hashT = Z_ARRVAL_PP(h);
+ } else {
+ hashT = HASH_OF(stream->wrapperdata);
+ }
+
+ zend_hash_internal_pointer_reset_ex(hashT, &pos);
+ while (zend_hash_get_current_data_ex(hashT, (void**)&hdr, &pos) != FAILURE) {
+ if (!hdr || Z_TYPE_PP(hdr) != IS_STRING) {
+ zend_hash_move_forward_ex(hashT, &pos);
+ continue;
+ }
if (!format) {
no_name_header:
add_next_index_stringl(return_value, Z_STRVAL_PP(hdr), Z_STRLEN_PP(hdr), 1);
@@ -705,7 +727,7 @@ no_name_header:
goto no_name_header;
}
}
- zend_hash_move_forward_ex(HASH_OF(stream->wrapperdata), &pos);
+ zend_hash_move_forward_ex(hashT, &pos);
}
php_stream_close(stream);
diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c
index cffc28dda..8304168c9 100644
--- a/ext/standard/user_filters.c
+++ b/ext/standard/user_filters.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: user_filters.c,v 1.31.2.4 2006/03/30 21:10:23 tony2001 Exp $ */
+/* $Id: user_filters.c,v 1.31.2.4.2.2 2006/10/11 14:46:40 tony2001 Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -54,11 +54,26 @@ 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)
+ ZEND_ARG_INFO(1, consumed)
+ 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()
static zend_function_entry user_filter_class_funcs[] = {
- PHP_NAMED_FE(filter, PHP_FN(user_filter_nop), NULL)
- PHP_NAMED_FE(onCreate, PHP_FN(user_filter_nop), NULL)
- PHP_NAMED_FE(onClose, PHP_FN(user_filter_nop), NULL)
+ PHP_NAMED_FE(filter, PHP_FN(user_filter_nop), arginfo_php_user_filter_filter)
+ PHP_NAMED_FE(onCreate, PHP_FN(user_filter_nop), arginfo_php_user_filter_onCreate)
+ PHP_NAMED_FE(onClose, PHP_FN(user_filter_nop), arginfo_php_user_filter_onClose)
{ NULL, NULL, NULL }
};
@@ -75,11 +90,14 @@ static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
PHP_MINIT_FUNCTION(user_filters)
{
+ zend_class_entry *php_user_filter;
/* init the filter class ancestor */
INIT_CLASS_ENTRY(user_filter_class_entry, "php_user_filter", user_filter_class_funcs);
- if (NULL == zend_register_internal_class(&user_filter_class_entry TSRMLS_CC)) {
+ if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry TSRMLS_CC)) == NULL) {
return FAILURE;
}
+ zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
/* init the filter resource; it has no dtor, as streams will always clean it up
* at the correct time */
@@ -531,6 +549,16 @@ PHP_FUNCTION(stream_filter_register)
RETVAL_FALSE;
+ if (!filtername_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter name cannot be empty");
+ return;
+ }
+
+ if (!classname_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class name cannot be empty");
+ return;
+ }
+
if (!BG(user_filter_map)) {
BG(user_filter_map) = (HashTable*) emalloc(sizeof(HashTable));
zend_hash_init(BG(user_filter_map), 5, NULL, (dtor_func_t) filter_item_dtor, 0);
diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c
index ac56d0bf5..12db49c7c 100644
--- a/ext/standard/uuencode.c
+++ b/ext/standard/uuencode.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: uuencode.c,v 1.5.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: uuencode.c,v 1.5.2.1.2.1 2006/06/26 18:48:56 bjori Exp $ */
/*
* Portions of this code are based on Berkeley's uuencode/uudecode
@@ -183,7 +183,7 @@ err:
return -1;
}
-/* {{{ proto string uuencode(string data)
+/* {{{ proto string convert_uuencode(string data)
uuencode a string */
PHP_FUNCTION(convert_uuencode)
{
@@ -200,7 +200,7 @@ PHP_FUNCTION(convert_uuencode)
}
/* }}} */
-/* {{{ proto string uudecode(string data)
+/* {{{ proto string convert_uudecode(string data)
decode a uuencoded string */
PHP_FUNCTION(convert_uudecode)
{
diff --git a/ext/standard/var.c b/ext/standard/var.c
index a1311a198..8369b6ea7 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.203.2.7 2006/04/05 02:28:06 iliaa Exp $ */
+/* $Id: var.c,v 1.203.2.7.2.8 2006/10/09 18:08:34 iliaa Exp $ */
@@ -76,8 +76,8 @@ static int php_object_property_dump(zval **zv, int num_args, va_list args, zend_
if (hash_key->nKeyLength ==0 ) { /* numeric key */
php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h);
} else { /* string key */
- zend_unmangle_property_name_ex(hash_key->arKey, hash_key->nKeyLength, &class_name, &prop_name);
- if (class_name) {
+ int unmangle = zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name);
+ if (class_name && unmangle == SUCCESS) {
php_printf("%*c[\"%s", level + 1, ' ', prop_name);
if (class_name[0]=='*') {
ZEND_PUTS(":protected");
@@ -85,7 +85,8 @@ static int php_object_property_dump(zval **zv, int num_args, va_list args, zend_
ZEND_PUTS(":private");
}
} else {
- php_printf("%*c[\"%s", level + 1, ' ', hash_key->arKey);
+ php_printf("%*c[\"", level + 1, ' ');
+ PHPWRITE(hash_key->arKey, hash_key->nKeyLength - 1);
#ifdef ANDREY_0
ZEND_PUTS(":public");
#endif
@@ -232,7 +233,7 @@ static int zval_object_property_dump(zval **zv, int num_args, va_list args, zend
if (hash_key->nKeyLength ==0 ) { /* numeric key */
php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h);
} else { /* string key */
- zend_unmangle_property_name_ex(hash_key->arKey, hash_key->nKeyLength, &class_name, &prop_name);
+ zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name);
if (class_name) {
php_printf("%*c[\"%s", level + 1, ' ', prop_name);
if (class_name[0]=='*') {
@@ -385,7 +386,7 @@ static int php_object_element_export(zval **zv, int num_args, va_list args, zend
if (hash_key->nKeyLength != 0) {
php_printf("%*c", level + 1, ' ');
- zend_unmangle_property_name_ex(hash_key->arKey, hash_key->nKeyLength, &class_name, &prop_name);
+ zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name);
php_printf(" '%s' => ", prop_name);
php_var_export(zv, level + 2 TSRMLS_CC);
PUTS (",\n");
@@ -415,7 +416,7 @@ PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC)
php_printf("%.*G", (int) EG(precision), Z_DVAL_PP(struc));
break;
case IS_STRING:
- tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "'\\", 2 TSRMLS_CC);
+ tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "'\\\0", 3 TSRMLS_CC);
PUTS ("'");
PHPWRITE(tmp_str, tmp_len);
PUTS ("'");
@@ -881,41 +882,55 @@ PHP_FUNCTION(serialize)
PHP_FUNCTION(unserialize)
{
- zval **buf;
+ char *buf;
+ int buf_len;
+ const unsigned char *p;
php_unserialize_data_t var_hash;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &buf) == FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
+ RETURN_FALSE;
}
- if (Z_TYPE_PP(buf) == IS_STRING) {
- const unsigned char *p = (unsigned char*)Z_STRVAL_PP(buf);
-
- if (Z_STRLEN_PP(buf) == 0) {
- RETURN_FALSE;
- }
+ if (buf_len == 0) {
+ RETURN_FALSE;
+ }
- PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (!php_var_unserialize(&return_value, &p, p + Z_STRLEN_PP(buf), &var_hash TSRMLS_CC)) {
- PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
- zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %d bytes", (long)((char*)p - Z_STRVAL_PP(buf)), Z_STRLEN_PP(buf));
- RETURN_FALSE;
- }
+ p = (const unsigned char*)buf;
+ PHP_VAR_UNSERIALIZE_INIT(var_hash);
+ if (!php_var_unserialize(&return_value, &p, p + buf_len, &var_hash TSRMLS_CC)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Argument is not a string");
+ zval_dtor(return_value);
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %d bytes", (long)((char*)p - buf), buf_len);
RETURN_FALSE;
}
+ PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
}
/* }}} */
#if MEMORY_LIMIT
-/* {{{ proto int memory_get_usage()
+/* {{{ proto int memory_get_usage([real_usage])
Returns the allocated by PHP memory */
PHP_FUNCTION(memory_get_usage) {
- RETURN_LONG(AG(allocated_memory));
+ zend_bool real_usage = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ RETURN_LONG(zend_memory_usage(real_usage TSRMLS_CC));
+}
+/* }}} */
+/* {{{ proto int memory_get_peak_usage([real_usage])
+ Returns the peak allocated by PHP memory */
+PHP_FUNCTION(memory_get_peak_usage) {
+ zend_bool real_usage = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ RETURN_LONG(zend_memory_peak_usage(real_usage TSRMLS_CC));
}
/* }}} */
#endif
diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c
index 8ab7cf393..2ebaedb66 100644
--- a/ext/standard/versioning.c
+++ b/ext/standard/versioning.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: versioning.c,v 1.19.2.1 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: versioning.c,v 1.19.2.1.2.1 2006/06/26 18:48:56 bjori Exp $ */
#include <stdio.h>
#include <sys/types.h>
@@ -204,8 +204,6 @@ php_version_compare(const char *orig_ver1, const char *orig_ver2)
}
/* }}} */
-/* {{{ do_version_compare() */
-
/* {{{ proto int version_compare(string ver1, string ver2 [, string oper])
Compares two "PHP-standardized" version number strings */