summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/array.c306
-rw-r--r--ext/standard/assert.c2
-rw-r--r--ext/standard/basic_functions.c119
-rw-r--r--ext/standard/basic_functions.h4
-rw-r--r--ext/standard/credits.c10
-rw-r--r--ext/standard/credits_ext.h4
-rw-r--r--ext/standard/credits_sapi.h1
-rw-r--r--ext/standard/crypt.c2
-rw-r--r--ext/standard/crypt_freesec.h17
-rw-r--r--ext/standard/crypt_sha256.c6
-rw-r--r--ext/standard/crypt_sha512.c6
-rw-r--r--ext/standard/css.c31
-rw-r--r--ext/standard/css.h4
-rw-r--r--ext/standard/dir.c2
-rw-r--r--ext/standard/file.c144
-rw-r--r--ext/standard/file.h12
-rw-r--r--ext/standard/filestat.c2
-rw-r--r--ext/standard/ftp_fopen_wrapper.c30
-rw-r--r--ext/standard/html.c28
-rw-r--r--ext/standard/html_tables/ents_html401.txt2
-rw-r--r--ext/standard/http_fopen_wrapper.c35
-rw-r--r--ext/standard/image.c4
-rw-r--r--ext/standard/info.c72
-rw-r--r--ext/standard/info.h16
-rw-r--r--ext/standard/math.c38
-rw-r--r--ext/standard/pack.c154
-rw-r--r--ext/standard/password.c2
-rw-r--r--ext/standard/php_array.h9
-rw-r--r--ext/standard/php_fopen_wrapper.c88
-rw-r--r--ext/standard/php_fopen_wrappers.h4
-rw-r--r--ext/standard/proc_open.c5
-rw-r--r--ext/standard/scanf.h2
-rw-r--r--ext/standard/streamsfuncs.c41
-rw-r--r--ext/standard/string.c7
-rw-r--r--ext/standard/tests/array/array_fill.phpt90
-rw-r--r--ext/standard/tests/array/array_fill_error.phpt9
-rw-r--r--ext/standard/tests/array/array_fill_variation2.phpt42
-rw-r--r--ext/standard/tests/array/array_filter_error.phpt4
-rw-r--r--ext/standard/tests/array/array_filter_variation10.phpt103
-rw-r--r--ext/standard/tests/dir/chdir_basic.phpt24
-rw-r--r--ext/standard/tests/dir/chdir_variation2.phpt58
-rw-r--r--ext/standard/tests/file/bug41655_2.phpt4
-rw-r--r--ext/standard/tests/file/copy_variation16-win32.phpt4
-rw-r--r--ext/standard/tests/file/copy_variation16.phpt4
-rw-r--r--ext/standard/tests/file/disk_free_space_basic.phpt6
-rw-r--r--ext/standard/tests/file/fopen_include_path.inc2
-rw-r--r--ext/standard/tests/file/fopen_variation16.phpt2
-rw-r--r--ext/standard/tests/file/fopen_variation17.phpt2
-rw-r--r--ext/standard/tests/file/fscanf_variation53.phpt2
-rw-r--r--ext/standard/tests/file/glob_variation3.phpt3
-rw-r--r--ext/standard/tests/file/rename_variation1.phpt12
-rw-r--r--ext/standard/tests/file/rename_variation2-win32.phpt18
-rw-r--r--ext/standard/tests/file/rename_variation2.phpt14
-rw-r--r--ext/standard/tests/file/rename_variation3.phpt18
-rw-r--r--ext/standard/tests/file/rename_variation4.phpt12
-rw-r--r--ext/standard/tests/file/rename_variation5.phpt12
-rw-r--r--ext/standard/tests/general_functions/parse_ini_string_003.phpt40
-rw-r--r--ext/standard/tests/http/bug65634.phpt81
-rw-r--r--ext/standard/tests/math/bug45712.phpt4
-rw-r--r--ext/standard/tests/math/pow-operator.phpt22
-rw-r--r--ext/standard/tests/math/pow_variation1.phpt2
-rw-r--r--ext/standard/tests/math/pow_variation1_64bit.phpt4
-rw-r--r--ext/standard/tests/math/pow_variation2.phpt4
-rw-r--r--ext/standard/tests/serialize/005.phpt8
-rw-r--r--ext/standard/tests/serialize/bug67072_2.phpt84
-rw-r--r--ext/standard/tests/streams/stream_get_meta_data_socket_basic.phpt2
-rw-r--r--ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt4
-rw-r--r--ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt4
-rw-r--r--ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt4
-rw-r--r--ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt4
-rw-r--r--ext/standard/tests/strings/addcslashes_005.phpt12
-rw-r--r--ext/standard/tests/strings/bin2hex_001.phpt11
-rw-r--r--ext/standard/tests/strings/crypt.phpt2
-rw-r--r--ext/standard/tests/strings/default_charset.phpt104
-rw-r--r--ext/standard/tests/strings/pack64.phpt115
-rw-r--r--ext/standard/tests/strings/pack64_32.phpt44
-rw-r--r--ext/standard/tests/strings/setlocale_variation2.phpt7
-rw-r--r--ext/standard/tests/strings/sprintf_variation34.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation40_64bit.phpt4
-rw-r--r--ext/standard/var.c2
-rw-r--r--ext/standard/var_unserializer.c69
-rw-r--r--ext/standard/var_unserializer.re7
82 files changed, 1374 insertions, 928 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index b2e9a6f284..f4806593c1 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -64,9 +64,6 @@
#define CASE_LOWER 0
#define CASE_UPPER 1
-#define COUNT_NORMAL 0
-#define COUNT_RECURSIVE 1
-
#define DIFF_NORMAL 1
#define DIFF_KEY 2
#define DIFF_ASSOC 6
@@ -127,6 +124,9 @@ PHP_MINIT_FUNCTION(array) /* {{{ */
REGISTER_LONG_CONSTANT("COUNT_NORMAL", COUNT_NORMAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("COUNT_RECURSIVE", COUNT_RECURSIVE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("ARRAY_FILTER_USE_BOTH", ARRAY_FILTER_USE_BOTH, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("ARRAY_FILTER_USE_KEY", ARRAY_FILTER_USE_KEY, CONST_CS | CONST_PERSISTENT);
+
return SUCCESS;
}
/* }}} */
@@ -271,7 +271,7 @@ PHP_FUNCTION(ksort)
}
/* }}} */
-static int php_count_recursive(zval *array, long mode TSRMLS_DC) /* {{{ */
+PHPAPI int php_count_recursive(zval *array, long mode TSRMLS_DC) /* {{{ */
{
long cnt = 0;
zval **element;
@@ -830,7 +830,7 @@ PHP_FUNCTION(end)
RETURN_FALSE;
}
- RETURN_ZVAL(*entry, 1, 0);
+ RETURN_ZVAL_FAST(*entry);
}
}
/* }}} */
@@ -853,7 +853,7 @@ PHP_FUNCTION(prev)
RETURN_FALSE;
}
- RETURN_ZVAL(*entry, 1, 0);
+ RETURN_ZVAL_FAST(*entry);
}
}
/* }}} */
@@ -876,7 +876,7 @@ PHP_FUNCTION(next)
RETURN_FALSE;
}
- RETURN_ZVAL(*entry, 1, 0);
+ RETURN_ZVAL_FAST(*entry);
}
}
/* }}} */
@@ -899,7 +899,7 @@ PHP_FUNCTION(reset)
RETURN_FALSE;
}
- RETURN_ZVAL(*entry, 1, 0);
+ RETURN_ZVAL_FAST(*entry);
}
}
/* }}} */
@@ -918,7 +918,8 @@ PHP_FUNCTION(current)
if (zend_hash_get_current_data(array, (void **) &entry) == FAILURE) {
RETURN_FALSE;
}
- RETURN_ZVAL(*entry, 1, 0);
+
+ RETURN_ZVAL_FAST(*entry);
}
/* }}} */
@@ -958,7 +959,7 @@ PHP_FUNCTION(min)
RETVAL_NULL();
} else {
if (zend_hash_minmax(Z_ARRVAL_PP(args[0]), php_array_data_compare, 0, (void **) &result TSRMLS_CC) == SUCCESS) {
- RETVAL_ZVAL(*result, 1, 0);
+ RETVAL_ZVAL_FAST(*result);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element");
RETVAL_FALSE;
@@ -978,7 +979,7 @@ PHP_FUNCTION(min)
}
}
- RETVAL_ZVAL(*min, 1, 0);
+ RETVAL_ZVAL_FAST(*min);
}
if (args) {
@@ -1009,7 +1010,7 @@ PHP_FUNCTION(max)
RETVAL_NULL();
} else {
if (zend_hash_minmax(Z_ARRVAL_PP(args[0]), php_array_data_compare, 1, (void **) &result TSRMLS_CC) == SUCCESS) {
- RETVAL_ZVAL(*result, 1, 0);
+ RETVAL_ZVAL_FAST(*result);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element");
RETVAL_FALSE;
@@ -1029,7 +1030,7 @@ PHP_FUNCTION(max)
}
}
- RETVAL_ZVAL(*max, 1, 0);
+ RETVAL_ZVAL_FAST(*max);
}
if (args) {
@@ -1517,14 +1518,18 @@ PHP_FUNCTION(array_fill)
return;
}
- if (num < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements must be positive");
+ if (num < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements can't be negative");
RETURN_FALSE;
}
/* allocate an array for return */
array_init_size(return_value, num);
+ if (num == 0) {
+ return;
+ }
+
num--;
zend_hash_index_update(Z_ARRVAL_P(return_value), start_key, &val, sizeof(zval *), NULL);
zval_add_ref(&val);
@@ -1778,13 +1783,7 @@ static void php_array_data_shuffle(zval *array TSRMLS_DC) /* {{{ */
}
temp = hash->pListHead;
j = 0;
- while (temp != NULL) {
- temp->nKeyLength = 0;
- temp->h = j++;
- temp = temp->pListNext;
- }
- hash->nNextFreeElement = n_elems;
- zend_hash_rehash(hash);
+ zend_hash_reindex(hash, 0);
HANDLE_UNBLOCK_INTERRUPTIONS();
efree(elems);
@@ -1807,93 +1806,15 @@ PHP_FUNCTION(shuffle)
}
/* }}} */
-PHPAPI HashTable* php_splice(HashTable *in_hash, int offset, int length, zval ***list, int list_count, HashTable **removed) /* {{{ */
+PHPAPI void php_splice(HashTable *ht, zend_uint offset, zend_uint length, zval ***list, zend_uint list_count, HashTable *removed TSRMLS_DC) /* {{{ */
{
- HashTable *out_hash = NULL; /* Output hashtable */
- int num_in, /* Number of entries in the input hashtable */
- pos, /* Current position in the hashtable */
- i; /* Loop counter */
- Bucket *p; /* Pointer to hash bucket */
- zval *entry; /* Hash entry */
-
- /* If input hash doesn't exist, we have nothing to do */
- if (!in_hash) {
- return NULL;
- }
-
- /* Get number of entries in the input hash */
- num_in = zend_hash_num_elements(in_hash);
-
- /* Clamp the offset.. */
- if (offset > num_in) {
- offset = num_in;
- } else if (offset < 0 && (offset = (num_in + offset)) < 0) {
- offset = 0;
- }
-
- /* ..and the length */
- if (length < 0) {
- length = num_in - offset + length;
- } else if (((unsigned)offset + (unsigned)length) > (unsigned)num_in) {
- length = num_in - offset;
- }
-
- /* Create and initialize output hash */
- ALLOC_HASHTABLE(out_hash);
- zend_hash_init(out_hash, (length > 0 ? num_in - length : 0) + list_count, NULL, ZVAL_PTR_DTOR, 0);
-
- /* Start at the beginning of the input hash and copy entries to output hash until offset is reached */
- for (pos = 0, p = in_hash->pListHead; pos < offset && p ; pos++, p = p->pListNext) {
- /* Get entry and increase reference count */
- entry = *((zval **)p->pData);
- Z_ADDREF_P(entry);
+ zend_hash_splice(ht, sizeof(zval *), (copy_ctor_func_t) zval_add_ref, offset, length, (void **) list, list_count, removed);
- /* Update output hash depending on key type */
- if (p->nKeyLength == 0) {
- zend_hash_next_index_insert(out_hash, &entry, sizeof(zval *), NULL);
- } else {
- zend_hash_quick_update(out_hash, p->arKey, p->nKeyLength, p->h, &entry, sizeof(zval *), NULL);
- }
- }
+ zend_hash_internal_pointer_reset(ht);
- /* If hash for removed entries exists, go until offset+length and copy the entries to it */
- if (removed != NULL) {
- for ( ; pos < offset + length && p; pos++, p = p->pListNext) {
- entry = *((zval **)p->pData);
- Z_ADDREF_P(entry);
- if (p->nKeyLength == 0) {
- zend_hash_next_index_insert(*removed, &entry, sizeof(zval *), NULL);
- } else {
- zend_hash_quick_update(*removed, p->arKey, p->nKeyLength, p->h, &entry, sizeof(zval *), NULL);
- }
- }
- } else { /* otherwise just skip those entries */
- for ( ; pos < offset + length && p; pos++, p = p->pListNext);
- }
-
- /* If there are entries to insert.. */
- if (list != NULL) {
- /* ..for each one, create a new zval, copy entry into it and copy it into the output hash */
- for (i = 0; i < list_count; i++) {
- entry = *list[i];
- Z_ADDREF_P(entry);
- zend_hash_next_index_insert(out_hash, &entry, sizeof(zval *), NULL);
- }
- }
-
- /* Copy the remaining input hash entries to the output hash */
- for ( ; p ; p = p->pListNext) {
- entry = *((zval **)p->pData);
- Z_ADDREF_P(entry);
- if (p->nKeyLength == 0) {
- zend_hash_next_index_insert(out_hash, &entry, sizeof(zval *), NULL);
- } else {
- zend_hash_quick_update(out_hash, p->arKey, p->nKeyLength, p->h, &entry, sizeof(zval *), NULL);
- }
+ if (ht == &EG(symbol_table)) {
+ zend_reset_all_cv(&EG(symbol_table) TSRMLS_CC);
}
-
- zend_hash_internal_pointer_reset(out_hash);
- return out_hash;
}
/* }}} */
@@ -1955,7 +1876,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end)
zend_hash_internal_pointer_reset(Z_ARRVAL_P(stack));
}
zend_hash_get_current_data(Z_ARRVAL_P(stack), (void **)&val);
- RETVAL_ZVAL(*val, 1, 0);
+ RETVAL_ZVAL_FAST(*val);
/* Delete the first or last value */
zend_hash_get_current_key_ex(Z_ARRVAL_P(stack), &key, &key_len, &index, 0, NULL);
@@ -1967,24 +1888,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end)
/* If we did a shift... re-index like it did before */
if (!off_the_end) {
- unsigned int k = 0;
- int should_rehash = 0;
- Bucket *p = Z_ARRVAL_P(stack)->pListHead;
- while (p != NULL) {
- if (p->nKeyLength == 0) {
- if (p->h != k) {
- p->h = k++;
- should_rehash = 1;
- } else {
- k++;
- }
- }
- p = p->pListNext;
- }
- Z_ARRVAL_P(stack)->nNextFreeElement = k;
- if (should_rehash) {
- zend_hash_rehash(Z_ARRVAL_P(stack));
- }
+ zend_hash_reindex(Z_ARRVAL_P(stack), 1);
} else if (!key_len && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) {
Z_ARRVAL_P(stack)->nNextFreeElement = Z_ARRVAL_P(stack)->nNextFreeElement - 1;
}
@@ -2015,24 +1919,14 @@ PHP_FUNCTION(array_unshift)
{
zval ***args, /* Function arguments array */
*stack; /* Input stack */
- HashTable *new_hash; /* New hashtable for the stack */
- HashTable old_hash;
int argc; /* Number of function arguments */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a+", &stack, &args, &argc) == FAILURE) {
return;
}
- /* Use splice to insert the elements at the beginning. Destroy old
- * hashtable and replace it with new one */
- new_hash = php_splice(Z_ARRVAL_P(stack), 0, 0, &args[0], argc, NULL);
- old_hash = *Z_ARRVAL_P(stack);
- if (Z_ARRVAL_P(stack) == &EG(symbol_table)) {
- zend_reset_all_cv(&EG(symbol_table) TSRMLS_CC);
- }
- *Z_ARRVAL_P(stack) = *new_hash;
- FREE_HASHTABLE(new_hash);
- zend_hash_destroy(&old_hash);
+ /* Use splice to insert the elements at the beginning. */
+ php_splice(Z_ARRVAL_P(stack), 0, 0, args, argc, NULL TSRMLS_CC);
/* Clean up and return the number of elements in the stack */
efree(args);
@@ -2045,11 +1939,9 @@ PHP_FUNCTION(array_unshift)
PHP_FUNCTION(array_splice)
{
zval *array, /* Input array */
- *repl_array = NULL, /* Replacement array */
+ **repl_array = NULL, /* Replacement array */
***repl = NULL; /* Replacement elements */
- HashTable *new_hash = NULL, /* Output array's hash */
- **rem_hash = NULL; /* Removed elements' hash */
- HashTable old_hash;
+ HashTable *rem_hash = NULL; /* Removed elements' hash */
Bucket *p; /* Bucket used for traversing hash */
long i,
offset,
@@ -2057,7 +1949,7 @@ PHP_FUNCTION(array_splice)
repl_num = 0; /* Number of replacement elements */
int num_in; /* Number of elements in the input array */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "al|lz/", &array, &offset, &length, &repl_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "al|lZ", &array, &offset, &length, &repl_array) == FAILURE) {
return;
}
@@ -2067,56 +1959,44 @@ PHP_FUNCTION(array_splice)
length = num_in;
}
- if (ZEND_NUM_ARGS() == 4) {
+ if (repl_array) {
/* Make sure the last argument, if passed, is an array */
- convert_to_array(repl_array);
+ convert_to_array_ex(repl_array);
/* Create the array of replacement elements */
- repl_num = zend_hash_num_elements(Z_ARRVAL_P(repl_array));
+ repl_num = zend_hash_num_elements(Z_ARRVAL_PP(repl_array));
repl = (zval ***)safe_emalloc(repl_num, sizeof(zval **), 0);
- for (p = Z_ARRVAL_P(repl_array)->pListHead, i = 0; p; p = p->pListNext, i++) {
+ for (p = Z_ARRVAL_PP(repl_array)->pListHead, i = 0; p; p = p->pListNext, i++) {
repl[i] = ((zval **)p->pData);
}
}
+ /* Clamp the offset */
+ if (offset < 0 && (offset = num_in + offset) < 0) {
+ offset = 0;
+ } else if (offset > num_in) {
+ offset = num_in;
+ }
+
+ /* Clamp the length */
+ if (length < 0 && (length = num_in - offset + length) < 0) {
+ length = 0;
+ } else if ((unsigned long) offset + (unsigned long) length > (unsigned) num_in) {
+ length = num_in - offset;
+ }
+
/* Don't create the array of removed elements if it's not going
* to be used; e.g. only removing and/or replacing elements */
if (return_value_used) {
- int size = length;
-
- /* Clamp the offset.. */
- if (offset > num_in) {
- offset = num_in;
- } else if (offset < 0 && (offset = (num_in + offset)) < 0) {
- offset = 0;
- }
-
- /* ..and the length */
- if (length < 0) {
- size = num_in - offset + length;
- } else if (((unsigned long) offset + (unsigned long) length) > (unsigned) num_in) {
- size = num_in - offset;
- }
-
- /* Initialize return value */
- array_init_size(return_value, size > 0 ? size : 0);
- rem_hash = &Z_ARRVAL_P(return_value);
+ array_init_size(return_value, length);
+ rem_hash = Z_ARRVAL_P(return_value);
}
/* Perform splice */
- new_hash = php_splice(Z_ARRVAL_P(array), offset, length, repl, repl_num, rem_hash);
-
- /* Replace input array's hashtable with the new one */
- old_hash = *Z_ARRVAL_P(array);
- if (Z_ARRVAL_P(array) == &EG(symbol_table)) {
- zend_reset_all_cv(&EG(symbol_table) TSRMLS_CC);
- }
- *Z_ARRVAL_P(array) = *new_hash;
- FREE_HASHTABLE(new_hash);
- zend_hash_destroy(&old_hash);
+ php_splice(Z_ARRVAL_P(array), offset, length, repl, repl_num, rem_hash TSRMLS_CC);
/* Clean up */
- if (ZEND_NUM_ARGS() == 4) {
+ if (repl) {
efree(repl);
}
}
@@ -2678,8 +2558,6 @@ PHP_FUNCTION(array_pad)
zval *input; /* Input array */
zval *pad_value; /* Padding value obviously */
zval ***pads; /* Array to pass to splice */
- HashTable *new_hash;/* Return value from splice */
- HashTable old_hash;
long pad_size; /* Size to pad to */
long pad_size_abs; /* Absolute value of pad_size */
int input_size; /* Size of the input array */
@@ -2723,20 +2601,11 @@ PHP_FUNCTION(array_pad)
/* Pad on the right or on the left */
if (pad_size > 0) {
- new_hash = php_splice(Z_ARRVAL_P(return_value), input_size, 0, pads, num_pads, NULL);
+ php_splice(Z_ARRVAL_P(return_value), input_size, 0, pads, num_pads, NULL TSRMLS_CC);
} else {
- new_hash = php_splice(Z_ARRVAL_P(return_value), 0, 0, pads, num_pads, NULL);
+ php_splice(Z_ARRVAL_P(return_value), 0, 0, pads, num_pads, NULL TSRMLS_CC);
}
- /* Copy the result hash into return value */
- old_hash = *Z_ARRVAL_P(return_value);
- if (Z_ARRVAL_P(return_value) == &EG(symbol_table)) {
- zend_reset_all_cv(&EG(symbol_table) TSRMLS_CC);
- }
- *Z_ARRVAL_P(return_value) = *new_hash;
- FREE_HASHTABLE(new_hash);
- zend_hash_destroy(&old_hash);
-
/* Clean up */
efree(pads);
}
@@ -3970,15 +3839,7 @@ PHP_FUNCTION(array_multisort)
hash->pListTail = indirect[k][i];
}
- p = hash->pListHead;
- k = 0;
- while (p != NULL) {
- if (p->nKeyLength == 0)
- p->h = k++;
- p = p->pListNext;
- }
- hash->nNextFreeElement = array_size;
- zend_hash_rehash(hash);
+ zend_hash_reindex(hash, 1);
}
HANDLE_UNBLOCK_INTERRUPTIONS();
@@ -4204,9 +4065,11 @@ PHP_FUNCTION(array_filter)
{
zval *array;
zval **operand;
- zval **args[1];
+ zval **args[2];
zval *retval = NULL;
+ zval *key = NULL;
zend_bool have_callback = 0;
+ long use_type = 0;
char *string_key;
zend_fcall_info fci = empty_fcall_info;
zend_fcall_info_cache fci_cache = empty_fcall_info_cache;
@@ -4214,7 +4077,7 @@ PHP_FUNCTION(array_filter)
ulong num_key;
HashPosition pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|f", &array, &fci, &fci_cache) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|fl", &array, &fci, &fci_cache, &use_type) == FAILURE) {
return;
}
@@ -4227,23 +4090,54 @@ PHP_FUNCTION(array_filter)
have_callback = 1;
fci.no_separation = 0;
fci.retval_ptr_ptr = &retval;
- fci.param_count = 1;
+
+ if (use_type == ARRAY_FILTER_USE_BOTH) {
+ fci.param_count = 2;
+ args[1] = &key;
+ } else {
+ fci.param_count = 1;
+ if (use_type == ARRAY_FILTER_USE_KEY) {
+ args[0] = &key;
+ }
+ }
}
for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(array), &pos);
zend_hash_get_current_data_ex(Z_ARRVAL_P(array), (void **)&operand, &pos) == SUCCESS;
zend_hash_move_forward_ex(Z_ARRVAL_P(array), &pos)
) {
+ int key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(array), &string_key, &string_key_len, &num_key, 0, &pos);
+
if (have_callback) {
- args[0] = operand;
+ if (use_type) {
+ MAKE_STD_ZVAL(key);
+ /* Set up the key */
+ switch (key_type) {
+ case HASH_KEY_IS_LONG:
+ Z_TYPE_P(key) = IS_LONG;
+ Z_LVAL_P(key) = num_key;
+ break;
+
+ case HASH_KEY_IS_STRING:
+ ZVAL_STRINGL(key, string_key, string_key_len - 1, 1);
+ break;
+ }
+ }
+
+ if (use_type != ARRAY_FILTER_USE_KEY) {
+ args[0] = operand;
+ }
fci.params = args;
if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && retval) {
- if (!zend_is_true(retval)) {
- zval_ptr_dtor(&retval);
+ int retval_true = zend_is_true(retval);
+
+ zval_ptr_dtor(&retval);
+ if (use_type) {
+ zval_ptr_dtor(&key);
+ }
+ if (!retval_true) {
continue;
- } else {
- zval_ptr_dtor(&retval);
}
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the filter callback");
@@ -4254,7 +4148,7 @@ PHP_FUNCTION(array_filter)
}
zval_add_ref(operand);
- switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(array), &string_key, &string_key_len, &num_key, 0, &pos)) {
+ switch (key_type) {
case HASH_KEY_IS_STRING:
zend_hash_update(Z_ARRVAL_P(return_value), string_key, string_key_len, operand, sizeof(zval *), NULL);
break;
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index cae4c6fd61..a9567f3b0a 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -200,7 +200,7 @@ PHP_FUNCTION(assert)
}
if (ASSERTG(callback)) {
- zval **args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval **), 0);
+ zval **args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval *), 0);
zval *retval;
int i;
uint lineno = zend_get_executed_lineno(TSRMLS_C);
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index cadbb7f2e5..c6fe61dd55 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -288,24 +288,20 @@ ZEND_BEGIN_ARG_INFO(arginfo_reset, 0)
ZEND_ARG_INFO(1, arg)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO(arginfo_current, ZEND_SEND_PREFER_REF)
+ZEND_BEGIN_ARG_INFO(arginfo_current, 0)
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO(arginfo_key, ZEND_SEND_PREFER_REF)
+ZEND_BEGIN_ARG_INFO(arginfo_key, 0)
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg)
ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk, 0, 0, 2)
@@ -339,8 +335,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_extract, 0, 0, 1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_compact, 0, 0, 1)
- ZEND_ARG_INFO(0, var_names)
- ZEND_ARG_INFO(0, ...)
+ ZEND_ARG_VARIADIC_INFO(0, var_names)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_array_fill, 0)
@@ -366,8 +361,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, vars)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_array_pop, 0)
@@ -380,8 +374,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, vars)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_splice, 0, 0, 2)
@@ -400,26 +393,22 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 2)
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
- ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */
- ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
+ ZEND_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 2)
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
- ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */
- ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_keys, 0, 0, 1)
@@ -468,8 +457,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_ukey, 0)
@@ -480,8 +468,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect, 0)
@@ -492,8 +479,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_assoc, 0)
@@ -517,8 +503,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_array_diff_ukey, 0)
@@ -529,8 +514,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_array_udiff, 0)
@@ -541,8 +525,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_array_diff_uassoc, 0)
@@ -564,13 +547,11 @@ ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_uassoc, 0)
ZEND_ARG_INFO(0, callback_key_comp_func)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, ZEND_SEND_PREFER_REF, 0, 1)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, 0, 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_ARG_INFO(ZEND_SEND_PREFER_REF, sort_order)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_flags)
+ ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, arr2)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1)
@@ -595,12 +576,12 @@ ZEND_END_ARG_INFO()
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_ARG_INFO(0, use_keys)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 2)
ZEND_ARG_INFO(0, callback)
- ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
- ZEND_ARG_INFO(0, ...)
+ ZEND_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_array_key_exists, 0)
@@ -710,8 +691,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, parameters)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func_array, 0, 0, 2)
@@ -722,8 +702,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, parameters)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_call_user_method_array, 0)
@@ -734,8 +713,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call, 0, 0, 1)
ZEND_ARG_INFO(0, function_name)
- ZEND_ARG_INFO(0, parameter)
- ZEND_ARG_INFO(0, ...)
+ ZEND_ARG_VARIADIC_INFO(0, parameters)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call_array, 0, 0, 2)
@@ -743,8 +721,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call_array, 0, 0, 2)
ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO(arginfo_register_shutdown_function, 0)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_register_shutdown_function, 0, 0, 1)
ZEND_ARG_INFO(0, function_name)
+ ZEND_ARG_VARIADIC_INFO(0, parameters)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_file, 0, 0, 1)
@@ -831,8 +810,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, parameters)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_unregister_tick_function, 0)
@@ -976,11 +954,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_scandir, 0, 0, 1)
ZEND_ARG_INFO(0, context)
ZEND_END_ARG_INFO()
/* }}} */
-/* {{{ arginfo ext/standard/dl.c */
-ZEND_BEGIN_ARG_INFO(arginfo_dl, 0)
- ZEND_ARG_INFO(0, extension_filename)
-ZEND_END_ARG_INFO()
-/* }}} */
/* {{{ dns.c */
ZEND_BEGIN_ARG_INFO(arginfo_gethostbyaddr, 0)
ZEND_ARG_INFO(0, ip_address)
@@ -1139,10 +1112,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetss, 0, 0, 1)
ZEND_ARG_INFO(0, allowable_tags)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_fscanf, 1, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fscanf, 0, 0, 2)
ZEND_ARG_INFO(0, stream)
ZEND_ARG_INFO(0, format)
- ZEND_ARG_INFO(1, ...)
+ ZEND_ARG_VARIADIC_INFO(1, vars)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_fwrite, 0, 0, 2)
@@ -1389,8 +1362,7 @@ ZEND_END_ARG_INFO()
/* {{{ formatted_print.c */
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_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_vsprintf, 0)
@@ -1400,8 +1372,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_vprintf, 0)
@@ -1412,8 +1383,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_vfprintf, 0)
@@ -1835,8 +1805,7 @@ ZEND_END_ARG_INFO()
/* {{{ pack.c */
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_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_unpack, 0)
@@ -2398,8 +2367,7 @@ ZEND_END_ARG_INFO()
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_ARG_VARIADIC_INFO(0, locales)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_str, 0, 0, 1)
@@ -2451,10 +2419,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_str_pad, 0, 0, 2)
ZEND_ARG_INFO(0, pad_type)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_sscanf, 1, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sscanf, 0, 0, 2)
ZEND_ARG_INFO(0, str)
ZEND_ARG_INFO(0, format)
- ZEND_ARG_INFO(1, ...)
+ ZEND_ARG_VARIADIC_INFO(1, vars)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_str_rot13, 0)
@@ -2660,13 +2628,11 @@ ZEND_END_ARG_INFO()
/* }}} */
/* {{{ var.c */
ZEND_BEGIN_ARG_INFO_EX(arginfo_var_dump, 0, 0, 1)
- ZEND_ARG_INFO(0, var)
- ZEND_ARG_INFO(0, ...)
+ ZEND_ARG_VARIADIC_INFO(0, vars)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_debug_zval_dump, 0, 0, 1)
- ZEND_ARG_INFO(0, var)
- ZEND_ARG_INFO(0, ...)
+ ZEND_ARG_VARIADIC_INFO(0, vars)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_var_export, 0, 0, 1)
@@ -3592,6 +3558,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
REGISTER_LONG_CONSTANT("INI_SCANNER_NORMAL", ZEND_INI_SCANNER_NORMAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("INI_SCANNER_RAW", ZEND_INI_SCANNER_RAW, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("INI_SCANNER_TYPED", ZEND_INI_SCANNER_TYPED, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PHP_URL_SCHEME", PHP_URL_SCHEME, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PHP_URL_HOST", PHP_URL_HOST, CONST_CS | CONST_PERSISTENT);
@@ -5085,7 +5052,7 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_
}
/* }}} */
-void php_call_shutdown_functions(TSRMLS_D) /* {{{ */
+PHPAPI void php_call_shutdown_functions(TSRMLS_D) /* {{{ */
{
if (BG(user_shutdown_function_names)) {
zend_try {
@@ -5097,7 +5064,7 @@ void php_call_shutdown_functions(TSRMLS_D) /* {{{ */
}
/* }}} */
-void php_free_shutdown_functions(TSRMLS_D) /* {{{ */
+PHPAPI void php_free_shutdown_functions(TSRMLS_D) /* {{{ */
{
if (BG(user_shutdown_function_names))
zend_try {
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 3af85b3d40..eaeb9bca83 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -261,4 +261,8 @@ PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, siz
PHPAPI extern zend_bool remove_user_shutdown_function(char *function_name, size_t function_len TSRMLS_DC);
PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry TSRMLS_DC);
+PHPAPI void php_call_shutdown_functions(TSRMLS_D);
+PHPAPI void php_free_shutdown_functions(TSRMLS_D);
+
+
#endif /* BASIC_FUNCTIONS_H */
diff --git a/ext/standard/credits.c b/ext/standard/credits.c
index 006c2d4c1a..3cb6eef724 100644
--- a/ext/standard/credits.c
+++ b/ext/standard/credits.c
@@ -61,10 +61,10 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */
php_info_print_table_start();
php_info_print_table_colspan_header(2, "PHP Authors");
php_info_print_table_header(2, "Contribution", "Authors");
- CREDIT_LINE("Zend Scripting Language Engine", "Andi Gutmans, Zeev Suraski, Stanislav Malyshev, Marcus Boerger, Dmitry Stogov");
+ CREDIT_LINE("Zend Scripting Language Engine", "Andi Gutmans, Zeev Suraski, Stanislav Malyshev, Marcus Boerger, Dmitry Stogov, Xinchen Hui, Nikita Popov");
CREDIT_LINE("Extension Module API", "Andi Gutmans, Zeev Suraski, Andrei Zmievski");
CREDIT_LINE("UNIX Build and Modularization", "Stig Bakken, Sascha Schumann, Jani Taskinen");
- CREDIT_LINE("Windows Port", "Shane Caraveo, Zeev Suraski, Wez Furlong, Pierre-Alain Joye");
+ CREDIT_LINE("Windows Port", "Shane Caraveo, Zeev Suraski, Wez Furlong, Pierre-Alain Joye, Anatol Belski");
CREDIT_LINE("Server API (SAPI) Abstraction Layer", "Andi Gutmans, Shane Caraveo, Zeev Suraski");
CREDIT_LINE("Streams Abstraction Layer", "Wez Furlong, Sara Golemon");
CREDIT_LINE("PHP Data Objects Layer", "Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle, Ilia Alshanetsky");
@@ -95,7 +95,7 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */
if (flag & PHP_CREDITS_DOCS) {
php_info_print_table_start();
php_info_print_table_colspan_header(2, "PHP Documentation");
- CREDIT_LINE("Authors", "Mehdi Achour, Friedhelm Betz, Antony Dovgal, Nuno Lopes, Hannes Magnusson, Georg Richter, Damien Seguy, Jakub Vrana");
+ CREDIT_LINE("Authors", "Mehdi Achour, Friedhelm Betz, Antony Dovgal, Nuno Lopes, Hannes Magnusson, Georg Richter, Damien Seguy, Jakub Vrana, Adam Harvey, Peter Cowburn");
CREDIT_LINE("Editor", "Philip Olson");
CREDIT_LINE("User Note Maintainers", "Daniel P. Brown, Thiago Henrique Pojda");
CREDIT_LINE("Other Contributors", "Previously active authors, editors and other contributors are listed in the manual.");
@@ -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 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, Pierre-Alain Joye, Dmitry Stogov, Felipe Pena, David Soria Parra");
+ 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, Pierre-Alain Joye, Dmitry Stogov, Felipe Pena, David Soria Parra, Stanislav Malyshev, Julien Pauli, Stephen Zarkos, Anatol Belski, Remi Collet, Ferenc Kovacs");
php_info_print_table_end();
}
@@ -115,7 +115,7 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */
php_info_print_table_start();
php_info_print_table_colspan_header(2, "Websites and Infrastructure team");
/* www., wiki., windows., master., and others, I guess pecl. too? */
- CREDIT_LINE("PHP Websites Team", "Rasmus Lerdorf, Hannes Magnusson, Philip Olson, Lukas Kahwe Smith, Pierre-Alain Joye, Kalle Sommer Nielsen");
+ CREDIT_LINE("PHP Websites Team", "Rasmus Lerdorf, Hannes Magnusson, Philip Olson, Lukas Kahwe Smith, Pierre-Alain Joye, Kalle Sommer Nielsen, Peter Cowburn, Adam Harvey, Ferenc Kovacs, Levi Morrison");
CREDIT_LINE("Event Maintainers", "Damien Seguy, Daniel P. Brown");
/* Mirroring */
CREDIT_LINE("Network Infrastructure", "Daniel P. Brown");
diff --git a/ext/standard/credits_ext.h b/ext/standard/credits_ext.h
index 1d652857eb..f77bbdf157 100644
--- a/ext/standard/credits_ext.h
+++ b/ext/standard/credits_ext.h
@@ -24,7 +24,7 @@ CREDIT_LINE("enchant", "Pierre-Alain Joye, Ilia Alshanetsky");
CREDIT_LINE("ereg", "Rasmus Lerdorf, Jim Winstead, Jaakko Hyvätti");
CREDIT_LINE("EXIF", "Rasmus Lerdorf, Marcus Boerger");
CREDIT_LINE("fileinfo", "Ilia Alshanetsky, Pierre Alain Joye, Scott MacVicar, Derick Rethans");
-CREDIT_LINE("Firebird/InterBase driver for PDO", "Ard Biesheuvel");
+CREDIT_LINE("Firebird 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");
@@ -82,5 +82,5 @@ CREDIT_LINE("XMLReader", "Rob Richards");
CREDIT_LINE("xmlrpc", "Dan Libby");
CREDIT_LINE("XMLWriter", "Rob Richards, Pierre-Alain Joye");
CREDIT_LINE("XSL", "Christian Stocker, Rob Richards");
-CREDIT_LINE("Zip", "Pierre-Alain Joye");
+CREDIT_LINE("Zip", "Pierre-Alain Joye, Remi Collet");
CREDIT_LINE("Zlib", "Rasmus Lerdorf, Stefan Roehrich, Zeev Suraski, Jade Nicoletti, Michael Wallner");
diff --git a/ext/standard/credits_sapi.h b/ext/standard/credits_sapi.h
index d147d8deae..634a370329 100644
--- a/ext/standard/credits_sapi.h
+++ b/ext/standard/credits_sapi.h
@@ -24,6 +24,7 @@ CREDIT_LINE("FastCGI Process Manager", "Andrei Nigmatulin, dreamcat4, Antony Dov
CREDIT_LINE("ISAPI", "Andi Gutmans, Zeev Suraski");
CREDIT_LINE("litespeed", "George Wang");
CREDIT_LINE("NSAPI", "Jayakumar Muthukumarasamy, Uwe Schindler");
+CREDIT_LINE("phpdbg", "Felipe Pena, Joe Watkins, Bob Weinand");
CREDIT_LINE("phttpd", "Thies C. Arntzen");
CREDIT_LINE("pi3web", "Holger Zimmermann");
CREDIT_LINE("Sendmail Milter", "Harald Radi");
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index 40b9e6d3b6..687befbae1 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -271,6 +271,8 @@ PHP_FUNCTION(crypt)
if (salt_in) {
memcpy(salt, salt_in, MIN(PHP_MAX_SALT_LEN, salt_in_len));
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash.");
}
/* The automatic salt generation covers standard DES, md5-crypt and Blowfish (simple) */
diff --git a/ext/standard/crypt_freesec.h b/ext/standard/crypt_freesec.h
index a87663d4fe..860462a2dd 100644
--- a/ext/standard/crypt_freesec.h
+++ b/ext/standard/crypt_freesec.h
@@ -4,26 +4,13 @@
#define _CRYPT_FREESEC_H
#if PHP_WIN32
-# include "win32/php_stdint.h"
# ifndef inline
# define inline __inline
# endif
-#else
-# include "php_config.h"
-# if HAVE_INTTYPES_H
-# include <inttypes.h>
-# elif HAVE_STDINT_H
-# include <stdint.h>
-# endif
-# ifndef HAVE_UINT32_T
-# if SIZEOF_INT == 4
-typedef unsigned int uint32_t;
-# elif SIZEOF_LONG == 4
-typedef unsigned long int uint32_t;
-# endif
-# endif
#endif
+#include "php_stdint.h"
+
#define MD5_HASH_MAX_LEN 120
struct php_crypt_extended_data {
diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c
index d334e3d477..ccfa66bd60 100644
--- a/ext/standard/crypt_sha256.c
+++ b/ext/standard/crypt_sha256.c
@@ -9,15 +9,9 @@
#include <limits.h>
#ifdef PHP_WIN32
-# include "win32/php_stdint.h"
# define __alignof__ __alignof
# define alloca _alloca
#else
-# if HAVE_INTTYPES_H
-# include <inttypes.h>
-# elif HAVE_STDINT_H
-# include <stdint.h>
-# endif
# ifndef HAVE_ALIGNOF
# include <stddef.h>
# define __alignof__(type) offsetof (struct { char c; type member;}, member)
diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c
index 0955532131..ebabed9d24 100644
--- a/ext/standard/crypt_sha512.c
+++ b/ext/standard/crypt_sha512.c
@@ -8,15 +8,9 @@
#include <errno.h>
#include <limits.h>
#ifdef PHP_WIN32
-# include "win32/php_stdint.h"
# define __alignof__ __alignof
# define alloca _alloca
#else
-# if HAVE_INTTYPES_H
-# include <inttypes.h>
-# elif HAVE_STDINT_H
-# include <stdint.h>
-# endif
# ifndef HAVE_ALIGNOF
# include <stddef.h>
# define __alignof__(type) offsetof (struct { char c; type member;}, member)
diff --git a/ext/standard/css.c b/ext/standard/css.c
index 5eaa6ada2f..9ce6138015 100644
--- a/ext/standard/css.c
+++ b/ext/standard/css.c
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Colin Viebrock <colin@easydns.com> |
+ | Authors: Colin Viebrock <colin@viebrock.ca> |
+----------------------------------------------------------------------+
*/
@@ -23,25 +23,24 @@
PHPAPI void php_info_print_css(TSRMLS_D) /* {{{ */
{
- PUTS("body {background-color: #ffffff; color: #000000;}\n");
- PUTS("body, td, th, h1, h2 {font-family: sans-serif;}\n");
- PUTS("pre {margin: 0px; font-family: monospace;}\n");
- PUTS("a:link {color: #000099; text-decoration: none; background-color: #ffffff;}\n");
+ PUTS("body {background-color: #fff; color: #222; font-family: sans-serif;}\n");
+ PUTS("pre {margin: 0; font-family: monospace;}\n");
+ PUTS("a:link {color: #009; text-decoration: none; background-color: #fff;}\n");
PUTS("a:hover {text-decoration: underline;}\n");
- PUTS("table {border-collapse: collapse;}\n");
+ PUTS("table {border-collapse: collapse; border: 0; width: 934px; box-shadow: 1px 2px 3px #ccc;}\n");
PUTS(".center {text-align: center;}\n");
- PUTS(".center table { margin-left: auto; margin-right: auto; text-align: left;}\n");
- PUTS(".center th { text-align: center !important; }\n");
- PUTS("td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}\n");
+ PUTS(".center table {margin: 1em auto; text-align: left;}\n");
+ PUTS(".center th {text-align: center !important;}\n");
+ PUTS("td, th {border: 1px solid #666; font-size: 75%; vertical-align: baseline; padding: 4px 5px;}\n");
PUTS("h1 {font-size: 150%;}\n");
PUTS("h2 {font-size: 125%;}\n");
PUTS(".p {text-align: left;}\n");
- PUTS(".e {background-color: #ccccff; font-weight: bold; color: #000000;}\n");
- PUTS(".h {background-color: #9999cc; font-weight: bold; color: #000000;}\n");
- PUTS(".v {background-color: #cccccc; color: #000000;}\n");
- PUTS(".vr {background-color: #cccccc; text-align: right; color: #000000;}\n");
- PUTS("img {float: right; border: 0px;}\n");
- PUTS("hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}\n");
+ PUTS(".e {background-color: #ccf; width: 300px; font-weight: bold;}\n");
+ PUTS(".h {background-color: #99c; font-weight: bold;}\n");
+ PUTS(".v {background-color: #ddd; max-width: 300px; overflow-x: auto;}\n");
+ PUTS(".v i {color: #999;}\n");
+ PUTS("img {float: right; border: 0;}\n");
+ PUTS("hr {width: 934px; background-color: #ccc; border: 0; height: 1px;}\n");
}
/* }}} */
diff --git a/ext/standard/css.h b/ext/standard/css.h
index 9541a34d2c..b3c79f2429 100644
--- a/ext/standard/css.h
+++ b/ext/standard/css.h
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Colin Viebrock <colin@easydns.com> |
+ | Authors: Colin Viebrock <colin@viebrock.ca> |
+----------------------------------------------------------------------+
*/
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index c64f37c2d6..091ecf03ca 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -515,7 +515,7 @@ no_results:
continue;
}
}
- /* we need to do this everytime since GLOB_ONLYDIR does not guarantee that
+ /* we need to do this every time since GLOB_ONLYDIR does not guarantee that
* all directories will be filtered. GNU libc documentation states the
* following:
* If the information about the type of the file is easily available
diff --git a/ext/standard/file.c b/ext/standard/file.c
index b636b99a5a..a2b4db154a 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -219,14 +219,22 @@ PHP_MINIT_FUNCTION(file)
REGISTER_LONG_CONSTANT("STREAM_CLIENT_ASYNC_CONNECT", PHP_STREAM_CLIENT_ASYNC_CONNECT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("STREAM_CLIENT_CONNECT", PHP_STREAM_CLIENT_CONNECT, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_CLIENT", STREAM_CRYPTO_METHOD_SSLv2_CLIENT, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_CLIENT", STREAM_CRYPTO_METHOD_SSLv3_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_ANY_CLIENT", STREAM_CRYPTO_METHOD_ANY_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_CLIENT", STREAM_CRYPTO_METHOD_SSLv2_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_CLIENT", STREAM_CRYPTO_METHOD_SSLv3_CLIENT, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv23_CLIENT", STREAM_CRYPTO_METHOD_SSLv23_CLIENT, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_CLIENT", STREAM_CRYPTO_METHOD_TLS_CLIENT, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_SERVER", STREAM_CRYPTO_METHOD_SSLv2_SERVER, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_SERVER", STREAM_CRYPTO_METHOD_SSLv3_SERVER, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_CLIENT", STREAM_CRYPTO_METHOD_TLS_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_ANY_SERVER", STREAM_CRYPTO_METHOD_ANY_SERVER, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_SERVER", STREAM_CRYPTO_METHOD_SSLv2_SERVER, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_SERVER", STREAM_CRYPTO_METHOD_SSLv3_SERVER, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv23_SERVER", STREAM_CRYPTO_METHOD_SSLv23_SERVER, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_SERVER", STREAM_CRYPTO_METHOD_TLS_SERVER, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_SERVER", STREAM_CRYPTO_METHOD_TLS_SERVER, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_0_SERVER", STREAM_CRYPTO_METHOD_TLSv1_0_SERVER, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_1_SERVER", STREAM_CRYPTO_METHOD_TLSv1_1_SERVER, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_2_SERVER", STREAM_CRYPTO_METHOD_TLSv1_2_SERVER, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("STREAM_SHUT_RD", STREAM_SHUT_RD, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("STREAM_SHUT_WR", STREAM_SHUT_WR, CONST_CS|CONST_PERSISTENT);
@@ -331,16 +339,16 @@ static int flock_values[] = { LOCK_SH, LOCK_EX, LOCK_UN };
Portable file locking */
PHP_FUNCTION(flock)
{
- zval *arg1, *arg3 = NULL;
+ zval *res, *wouldblock = NULL;
int act;
php_stream *stream;
long operation = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &arg1, &operation, &arg3) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &res, &operation, &wouldblock) == FAILURE) {
return;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
act = operation & 3;
if (act < 1 || act > 3) {
@@ -348,16 +356,16 @@ PHP_FUNCTION(flock)
RETURN_FALSE;
}
- if (arg3 && PZVAL_IS_REF(arg3)) {
- convert_to_long_ex(&arg3);
- Z_LVAL_P(arg3) = 0;
+ if (wouldblock && PZVAL_IS_REF(wouldblock)) {
+ convert_to_long_ex(&wouldblock);
+ Z_LVAL_P(wouldblock) = 0;
}
/* flock_values contains all possible actions if (operation & 4) we won't block on the lock */
act = flock_values[act - 1] | (operation & PHP_LOCK_NB ? LOCK_NB : 0);
if (php_stream_lock(stream, act)) {
- if (operation && errno == EWOULDBLOCK && arg3 && PZVAL_IS_REF(arg3)) {
- Z_LVAL_P(arg3) = 1;
+ if (operation && errno == EWOULDBLOCK && wouldblock && PZVAL_IS_REF(wouldblock)) {
+ Z_LVAL_P(wouldblock) = 1;
}
RETURN_FALSE;
}
@@ -888,14 +896,14 @@ PHP_NAMED_FUNCTION(php_if_fopen)
Close an open file pointer */
PHPAPI PHP_FUNCTION(fclose)
{
- zval *arg1;
+ zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a valid stream resource", stream->rsrc_id);
@@ -960,14 +968,14 @@ PHP_FUNCTION(popen)
Close a file pointer opened by popen() */
PHP_FUNCTION(pclose)
{
- zval *arg1;
+ zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
FG(pclose_wait) = 1;
zend_list_delete(stream->rsrc_id);
@@ -980,14 +988,14 @@ PHP_FUNCTION(pclose)
Test for end-of-file on a file pointer */
PHPAPI PHP_FUNCTION(feof)
{
- zval *arg1;
+ zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
if (php_stream_eof(stream)) {
RETURN_TRUE;
@@ -1001,18 +1009,18 @@ PHPAPI PHP_FUNCTION(feof)
Get a line from file pointer */
PHPAPI PHP_FUNCTION(fgets)
{
- zval *arg1;
+ zval *res;
long len = 1024;
char *buf = NULL;
int argc = ZEND_NUM_ARGS();
size_t line_len = 0;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &len) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
if (argc == 1) {
/* ask streams to give us a buffer of an appropriate size */
@@ -1052,16 +1060,16 @@ exit_failed:
Get a character from file pointer */
PHPAPI PHP_FUNCTION(fgetc)
{
- zval *arg1;
+ zval *res;
char buf[2];
int result;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
result = php_stream_getc(stream);
@@ -1172,35 +1180,31 @@ PHP_FUNCTION(fscanf)
Binary-safe file write */
PHPAPI PHP_FUNCTION(fwrite)
{
- zval *arg1;
- char *arg2;
- int arg2len;
+ zval *res;
+ char *input;
+ int inputlen;
int ret;
int num_bytes;
- long arg3 = 0;
- char *buffer = NULL;
+ long maxlen = 0;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &arg2, &arg2len, &arg3) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 2) {
- num_bytes = arg2len;
+ num_bytes = inputlen;
} else {
- num_bytes = MAX(0, MIN((int)arg3, arg2len));
+ num_bytes = MAX(0, MIN((int) maxlen, inputlen));
}
if (!num_bytes) {
RETURN_LONG(0);
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
- ret = php_stream_write(stream, buffer ? buffer : arg2, num_bytes);
- if (buffer) {
- efree(buffer);
- }
+ ret = php_stream_write(stream, input, num_bytes);
RETURN_LONG(ret);
}
@@ -1210,15 +1214,15 @@ PHPAPI PHP_FUNCTION(fwrite)
Flushes output */
PHPAPI PHP_FUNCTION(fflush)
{
- zval *arg1;
+ zval *res;
int ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
ret = php_stream_flush(stream);
if (ret) {
@@ -1232,14 +1236,14 @@ PHPAPI PHP_FUNCTION(fflush)
Rewind the position of a file pointer */
PHPAPI PHP_FUNCTION(rewind)
{
- zval *arg1;
+ zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
if (-1 == php_stream_rewind(stream)) {
RETURN_FALSE;
@@ -1252,15 +1256,15 @@ PHPAPI PHP_FUNCTION(rewind)
Get file pointer's read/write position */
PHPAPI PHP_FUNCTION(ftell)
{
- zval *arg1;
+ zval *res;
long ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
ret = php_stream_tell(stream);
if (ret == -1) {
@@ -1274,17 +1278,17 @@ PHPAPI PHP_FUNCTION(ftell)
Seek on a file pointer */
PHPAPI PHP_FUNCTION(fseek)
{
- zval *arg1;
- long arg2, whence = SEEK_SET;
+ zval *res;
+ long offset, whence = SEEK_SET;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &arg1, &arg2, &whence) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &res, &offset, &whence) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
- RETURN_LONG(php_stream_seek(stream, arg2, whence));
+ RETURN_LONG(php_stream_seek(stream, offset, whence));
}
/* }}} */
@@ -1292,7 +1296,7 @@ PHPAPI PHP_FUNCTION(fseek)
*/
/* DEPRECATED APIs: Use php_stream_mkdir() instead */
-PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC)
+PHPAPI int php_mkdir_ex(const char *dir, long mode, int options TSRMLS_DC)
{
int ret;
@@ -1307,7 +1311,7 @@ PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC)
return ret;
}
-PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC)
+PHPAPI int php_mkdir(const char *dir, long mode TSRMLS_DC)
{
return php_mkdir_ex(dir, mode, REPORT_ERRORS TSRMLS_CC);
}
@@ -1386,7 +1390,7 @@ PHP_FUNCTION(readfile)
Return or change the umask */
PHP_FUNCTION(umask)
{
- long arg1 = 0;
+ long mask = 0;
int oldumask;
oldumask = umask(077);
@@ -1395,14 +1399,14 @@ PHP_FUNCTION(umask)
BG(umask) = oldumask;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mask) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 0) {
umask(oldumask);
} else {
- umask(arg1);
+ umask(mask);
}
RETURN_LONG(oldumask);
@@ -1413,15 +1417,15 @@ PHP_FUNCTION(umask)
Output all remaining data from a file pointer */
PHPAPI PHP_FUNCTION(fpassthru)
{
- zval *arg1;
+ zval *res;
int size;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
size = php_stream_passthru(stream);
RETURN_LONG(size);
@@ -1631,7 +1635,7 @@ PHP_FUNCTION(copy)
/* {{{ php_copy_file
*/
-PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
+PHPAPI int php_copy_file(const char *src, const char *dest TSRMLS_DC)
{
return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC);
}
@@ -1639,7 +1643,7 @@ PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
/* {{{ php_copy_file_ex
*/
-PHPAPI int php_copy_file_ex(char *src, char *dest, int src_flg TSRMLS_DC)
+PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_flg TSRMLS_DC)
{
return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC);
}
@@ -1647,7 +1651,7 @@ PHPAPI int php_copy_file_ex(char *src, char *dest, int src_flg TSRMLS_DC)
/* {{{ php_copy_file_ctx
*/
-PHPAPI int php_copy_file_ctx(char *src, char *dest, int src_flg, php_stream_context *ctx TSRMLS_DC)
+PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php_stream_context *ctx TSRMLS_DC)
{
php_stream *srcstream = NULL, *deststream = NULL;
int ret = FAILURE;
@@ -1743,15 +1747,15 @@ safe_to_copy:
Binary-safe file read */
PHPAPI PHP_FUNCTION(fread)
{
- zval *arg1;
+ zval *res;
long len;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &len) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, &arg1);
+ PHP_STREAM_TO_ZVAL(stream, &res);
if (len <= 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
diff --git a/ext/standard/file.h b/ext/standard/file.h
index d2b20bf928..9c044aff1e 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -74,11 +74,11 @@ PHP_MINIT_FUNCTION(user_streams);
PHPAPI int php_le_stream_context(TSRMLS_D);
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_copy_file_ctx(char *src, char *dest, int src_chk, php_stream_context *ctx 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 int php_copy_file(const char *src, const char *dest TSRMLS_DC);
+PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_chk TSRMLS_DC);
+PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_chk, php_stream_context *ctx TSRMLS_DC);
+PHPAPI int php_mkdir_ex(const char *dir, long mode, int options TSRMLS_DC);
+PHPAPI int php_mkdir(const char *dir, long mode TSRMLS_DC);
PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC);
PHPAPI int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC);
@@ -121,7 +121,7 @@ typedef struct {
long default_socket_timeout;
char *user_agent; /* for the http wrapper */
char *from_address; /* for the ftp and http wrappers */
- char *user_stream_current_filename; /* for simple recursion protection */
+ const char *user_stream_current_filename; /* for simple recursion protection */
php_stream_context *default_context;
HashTable *stream_wrappers; /* per-request copy of url_stream_wrappers_hash */
HashTable *stream_filters; /* per-request copy of stream_filters_hash */
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 3a95a9f9a4..2ec4ec3808 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -857,7 +857,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
"dev", "ino", "mode", "nlink", "uid", "gid", "rdev",
"size", "atime", "mtime", "ctime", "blksize", "blocks"
};
- char *local;
+ const char *local;
php_stream_wrapper *wrapper;
if (!filename_length) {
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index 27390a10d1..ab75da713c 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -130,8 +130,9 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *
/* {{{ php_ftp_fopen_connect
*/
-static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context,
- php_stream **preuseid, php_url **presource, int *puse_ssl, int *puse_ssl_on_data TSRMLS_DC)
+static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
+ char **opened_path, php_stream_context *context, php_stream **preuseid,
+ php_url **presource, int *puse_ssl, int *puse_ssl_on_data TSRMLS_DC)
{
php_stream *stream = NULL, *reuseid = NULL;
php_url *resource = NULL;
@@ -410,7 +411,8 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_
/* {{{ php_fopen_url_wrap_ftp
*/
-php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode,
+ int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
{
php_stream *stream = NULL, *datastream = NULL;
php_url *resource = NULL;
@@ -642,11 +644,10 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
efree(basename);
/* Trim off trailing whitespace characters */
- tmp_len--;
- while (tmp_len >= 0 &&
- (ent->d_name[tmp_len] == '\n' || ent->d_name[tmp_len] == '\r' ||
- ent->d_name[tmp_len] == '\t' || ent->d_name[tmp_len] == ' ')) {
- ent->d_name[tmp_len--] = '\0';
+ while (tmp_len > 0 &&
+ (ent->d_name[tmp_len - 1] == '\n' || ent->d_name[tmp_len - 1] == '\r' ||
+ ent->d_name[tmp_len - 1] == '\t' || ent->d_name[tmp_len - 1] == ' ')) {
+ ent->d_name[--tmp_len] = '\0';
}
return sizeof(php_stream_dirent);
@@ -691,7 +692,8 @@ static php_stream_ops php_ftp_dirstream_ops = {
/* {{{ php_stream_ftp_opendir
*/
-php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
+ char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
{
php_stream *stream, *reuseid, *datastream = NULL;
php_ftp_dirstream_data *dirsdata;
@@ -780,7 +782,7 @@ opendir_errexit:
/* {{{ php_stream_ftp_url_stat
*/
-static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC)
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -903,7 +905,7 @@ stat_errexit:
/* {{{ php_stream_ftp_unlink
*/
-static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -953,7 +955,7 @@ unlink_errexit:
/* {{{ php_stream_ftp_rename
*/
-static int php_stream_ftp_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC)
{
php_stream *stream = NULL;
php_url *resource_from = NULL, *resource_to = NULL;
@@ -1032,7 +1034,7 @@ rename_errexit:
/* {{{ php_stream_ftp_mkdir
*/
-static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context TSRMLS_DC)
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -1126,7 +1128,7 @@ mkdir_errexit:
/* {{{ php_stream_ftp_rmdir
*/
-static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
{
php_stream *stream = NULL;
php_url *resource = NULL;
diff --git a/ext/standard/html.c b/ext/standard/html.c
index 91fc050add..1d6eaa4c5c 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -84,6 +84,18 @@
#define sjis_lead(c) ((c) != 0x80 && (c) != 0xA0 && (c) < 0xFD)
#define sjis_trail(c) ((c) >= 0x40 && (c) != 0x7F && (c) < 0xFD)
+/* {{{ get_default_charset
+ */
+static char *get_default_charset(TSRMLS_D) {
+ if (PG(internal_encoding) && PG(internal_encoding)[0]) {
+ return PG(internal_encoding);
+ } else if (SG(default_charset) && SG(default_charset)[0] ) {
+ return SG(default_charset);
+ }
+ return NULL;
+}
+/* }}} */
+
/* {{{ get_next_char
*/
static inline unsigned int get_next_char(
@@ -383,7 +395,7 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
if ((len == 4) /* sizeof (none|auto|pass) */ &&
(!memcmp("pass", charset_hint, 4) ||
!memcmp("auto", charset_hint, 4) ||
- !memcmp("auto", charset_hint, 4))) {
+ !memcmp("none", charset_hint, 4))) {
charset_hint = NULL;
len = 0;
} else {
@@ -889,7 +901,7 @@ static inline size_t write_octet_sequence(unsigned char *buf, enum entity_charse
#if 0
return php_mb2_int_to_char(buf, code);
#else
-#ifdef ZEND_DEBUG
+#if ZEND_DEBUG
assert(code <= 0xFFU);
#endif
*buf = code;
@@ -900,7 +912,7 @@ static inline size_t write_octet_sequence(unsigned char *buf, enum entity_charse
#if 0 /* idem */
return php_mb2_int_to_char(buf, code);
#else
-#ifdef ZEND_DEBUG
+#if ZEND_DEBUG
assert(code <= 0xFFU);
#endif
*buf = code;
@@ -1443,7 +1455,11 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
return;
}
+ if (!hint_charset) {
+ hint_charset = get_default_charset(TSRMLS_C);
+ }
replaced = php_escape_html_entities_ex(str, str_len, &new_len, all, (int) flags, hint_charset, double_encode TSRMLS_CC);
+
RETVAL_STRINGL(replaced, (int)new_len, 0);
}
/* }}} */
@@ -1505,7 +1521,7 @@ PHP_FUNCTION(htmlspecialchars_decode)
PHP_FUNCTION(html_entity_decode)
{
char *str, *hint_charset = NULL;
- int str_len, hint_charset_len = 0;
+ int str_len, hint_charset_len;
size_t new_len = 0;
long quote_style = ENT_COMPAT;
char *replaced;
@@ -1515,7 +1531,11 @@ PHP_FUNCTION(html_entity_decode)
return;
}
+ if (!hint_charset) {
+ hint_charset = get_default_charset(TSRMLS_C);
+ }
replaced = php_unescape_html_entities(str, str_len, &new_len, 1 /*all*/, quote_style, hint_charset TSRMLS_CC);
+
if (replaced) {
RETURN_STRINGL(replaced, (int)new_len, 0);
}
diff --git a/ext/standard/html_tables/ents_html401.txt b/ext/standard/html_tables/ents_html401.txt
index 7e1564b229..bd3ded9fde 100644
--- a/ext/standard/html_tables/ents_html401.txt
+++ b/ext/standard/html_tables/ents_html401.txt
@@ -1,4 +1,4 @@
-#039 0027 //artifical; there's no &apos; in HTML 4.01
+#039 0027 //artificial; there's no &apos; in HTML 4.01
nbsp 00A0
iexcl 00A1
cent 00A2
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 13614ae3b7..1c4b17afb1 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -80,6 +80,7 @@
#define HTTP_HEADER_FROM 8
#define HTTP_HEADER_CONTENT_LENGTH 16
#define HTTP_HEADER_TYPE 32
+#define HTTP_HEADER_CONNECTION 64
#define HTTP_WRAPPER_HEADER_INIT 1
#define HTTP_WRAPPER_REDIRECTED 2
@@ -108,7 +109,9 @@ static inline void strip_header(char *header_bag, char *lc_header_bag,
}
}
-php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
+php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
+ const char *path, const char *mode, int options, char **opened_path,
+ php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -117,7 +120,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
char *scratch = NULL;
char *tmp = NULL;
char *ua_str = NULL;
- zval **ua_zval = NULL, **tmpzval = NULL;
+ zval **ua_zval = NULL, **tmpzval = NULL, *ssl_proxy_peer_name = NULL;
int scratch_len = 0;
int body = 0;
char location[HTTP_HEADER_BLOCK_SIZE];
@@ -223,6 +226,13 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
if (stream && use_proxy && use_ssl) {
smart_str header = {0};
+ /* Set peer_name or name verification will try to use the proxy server name */
+ if (!context || php_stream_context_get_option(context, "ssl", "peer_name", &tmpzval) == FAILURE) {
+ MAKE_STD_ZVAL(ssl_proxy_peer_name);
+ ZVAL_STRING(ssl_proxy_peer_name, resource->host, 1);
+ php_stream_context_set_option(stream->context, "ssl", "peer_name", ssl_proxy_peer_name);
+ }
+
smart_str_appendl(&header, "CONNECT ", sizeof("CONNECT ")-1);
smart_str_appends(&header, resource->host);
smart_str_appendc(&header, ':');
@@ -313,7 +323,7 @@ finish:
/* enable SSL transport layer */
if (stream) {
- if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
+ if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_ANY_CLIENT, NULL TSRMLS_CC) < 0 ||
php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot connect to HTTPS server through proxy");
php_stream_close(stream);
@@ -409,8 +419,6 @@ finish:
strlcat(scratch, " HTTP/", scratch_len);
strlcat(scratch, protocol_version, scratch_len);
strlcat(scratch, "\r\n", scratch_len);
- efree(protocol_version);
- protocol_version = NULL;
} else {
strlcat(scratch, " HTTP/1.0\r\n", scratch_len);
}
@@ -490,6 +498,11 @@ finish:
*(s-1) == '\t' || *(s-1) == ' ')) {
have_header |= HTTP_HEADER_TYPE;
}
+ if ((s = strstr(tmp, "connection:")) &&
+ (s == tmp || *(s-1) == '\r' || *(s-1) == '\n' ||
+ *(s-1) == '\t' || *(s-1) == ' ')) {
+ have_header |= HTTP_HEADER_CONNECTION;
+ }
/* remove Proxy-Authorization header */
if (use_proxy && use_ssl && (s = strstr(tmp, "proxy-authorization:")) &&
(s == tmp || *(s-1) == '\r' || *(s-1) == '\n' ||
@@ -563,6 +576,16 @@ finish:
}
}
+ /* Send a Connection: close header when using HTTP 1.1 or later to avoid
+ * hanging when the server interprets the RFC literally and establishes a
+ * keep-alive connection, unless the user specifically requests something
+ * else by specifying a Connection header in the context options. */
+ if (protocol_version &&
+ ((have_header & HTTP_HEADER_CONNECTION) == 0) &&
+ (strncmp(protocol_version, "1.0", MIN(protocol_version_len, 3)) > 0)) {
+ php_stream_write_string(stream, "Connection: close\r\n");
+ }
+
if (context &&
php_stream_context_get_option(context, "http", "user_agent", &ua_zval) == SUCCESS &&
Z_TYPE_PP(ua_zval) == IS_STRING) {
@@ -923,7 +946,7 @@ out:
}
/* }}} */
-php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
{
return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context, PHP_URL_REDIRECT_MAX, HTTP_WRAPPER_HEADER_INIT STREAMS_CC TSRMLS_CC);
}
diff --git a/ext/standard/image.c b/ext/standard/image.c
index f1910d2191..122e06335a 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -460,7 +460,7 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR
snprintf(markername, sizeof(markername), "APP%d", marker - M_APP0);
if (zend_hash_find(Z_ARRVAL_P(info), markername, strlen(markername)+1, (void **) &tmp) == FAILURE) {
- /* XXX we onyl catch the 1st tag of it's kind! */
+ /* XXX we only catch the 1st tag of it's kind! */
add_assoc_stringl(info, markername, buffer, length, 1);
}
@@ -532,7 +532,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
case M_APP14:
case M_APP15:
if (info) {
- if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app markes... */
+ if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app marks... */
return result;
}
} else {
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 076ef0b601..343244c21c 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
@@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
| Authors: Rasmus Lerdorf <rasmus@php.net> |
| Zeev Suraski <zeev@zend.com> |
- | Colin Viebrock <colin@easydns.com> |
+ | Colin Viebrock <colin@viebrock.ca> |
+----------------------------------------------------------------------+
*/
@@ -67,10 +67,10 @@ static int php_info_print_html_esc(const char *str, int len) /* {{{ */
int written;
char *new_str;
TSRMLS_FETCH();
-
+
new_str = php_escape_html_entities((unsigned char *) str, len, &new_len, 0, ENT_QUOTES, "utf-8" TSRMLS_CC);
written = php_output_write(new_str, new_len TSRMLS_CC);
- efree(new_str);
+ str_efree(new_str);
return written;
}
/* }}} */
@@ -81,11 +81,11 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */
int len, written;
va_list argv;
TSRMLS_FETCH();
-
+
va_start(argv, fmt);
len = vspprintf(&buf, 0, fmt, argv);
va_end(argv);
-
+
written = php_output_write(buf, len TSRMLS_CC);
efree(buf);
return written;
@@ -103,7 +103,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
{
char *key;
uint len;
-
+
if (ht) {
if (zend_hash_num_elements(ht)) {
HashPosition pos;
@@ -113,7 +113,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
} else {
php_info_printf("\nRegistered %s => ", name);
}
-
+
zend_hash_internal_pointer_reset_ex(ht, &pos);
while (zend_hash_get_current_key_ex(ht, &key, &len, NULL, 0, &pos) == HASH_KEY_IS_STRING)
{
@@ -129,7 +129,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
break;
}
}
-
+
if (!sapi_module.phpinfo_as_text) {
php_info_print("</td></tr>\n");
}
@@ -164,10 +164,10 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {
}
} else {
if (!sapi_module.phpinfo_as_text) {
- php_info_printf("<tr><td>%s</td></tr>\n", zend_module->name);
+ php_info_printf("<tr><td class=\"v\">%s</td></tr>\n", zend_module->name);
} else {
php_info_printf("%s\n", zend_module->name);
- }
+ }
}
}
/* }}} */
@@ -212,7 +212,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
php_info_print(name);
php_info_print("[\"");
-
+
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) {
@@ -468,7 +468,7 @@ char* php_get_windows_name()
sub = "Web Edition";
else sub = "Standard Edition";
}
- }
+ }
}
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 ) {
@@ -561,7 +561,7 @@ PHPAPI char *php_get_uname(char mode)
DWORD dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
char ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
-
+
GetComputerName(ComputerName, &dwSize);
if (mode == 's') {
@@ -618,7 +618,7 @@ PHPAPI char *php_get_uname(char mode)
if (mode == 's') {
php_uname = buf.sysname;
} else if (mode == 'r') {
- snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d.%d",
+ snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d.%d",
buf.netware_major, buf.netware_minor, buf.netware_revision);
php_uname = tmp_uname;
} else if (mode == 'n') {
@@ -708,7 +708,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
char temp_api[10];
php_uname = php_get_uname('a');
-
+
if (!sapi_module.phpinfo_as_text) {
php_info_print_box_start(1);
}
@@ -732,7 +732,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_printf("<h1 class=\"p\">PHP Version %s</h1>\n", PHP_VERSION);
} else {
php_info_print_table_row(2, "PHP Version", PHP_VERSION);
- }
+ }
php_info_print_box_end();
php_info_print_table_start();
php_info_print_table_row(2, "System", php_uname );
@@ -817,7 +817,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
#else
php_info_print_table_row(2, "DTrace Support", "disabled" );
#endif
-
+
php_info_print_stream_hash("PHP Streams", php_stream_get_url_stream_wrappers_hash() TSRMLS_CC);
php_info_print_stream_hash("Stream Socket Transports", php_stream_xport_get_hash() TSRMLS_CC);
php_info_print_stream_hash("Stream Filters", php_get_stream_filters_hash() TSRMLS_CC);
@@ -849,7 +849,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print("<h1>Configuration</h1>\n");
} else {
SECTION("Configuration");
- }
+ }
if (!(flag & PHP_INFO_MODULES)) {
SECTION("PHP Core");
display_ini_entries(NULL);
@@ -923,7 +923,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
}
- if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) {
+ if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) {
php_info_print_hr();
php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE TSRMLS_CC);
}
@@ -964,24 +964,24 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if (!sapi_module.phpinfo_as_text) {
php_info_print("</div></body></html>");
- }
+ }
}
/* }}} */
PHPAPI void php_info_print_table_start(void) /* {{{ */
{
if (!sapi_module.phpinfo_as_text) {
- php_info_print("<table border=\"0\" cellpadding=\"3\" width=\"600\">\n");
+ php_info_print("<table>\n");
} else {
php_info_print("\n");
- }
+ }
}
/* }}} */
PHPAPI void php_info_print_table_end(void) /* {{{ */
{
if (!sapi_module.phpinfo_as_text) {
- php_info_print("</table><br />\n");
+ php_info_print("</table>\n");
}
}
@@ -999,7 +999,7 @@ PHPAPI void php_info_print_box_start(int flag) /* {{{ */
php_info_print("<tr class=\"v\"><td>\n");
} else {
php_info_print("\n");
- }
+ }
}
}
/* }}} */
@@ -1032,7 +1032,7 @@ PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) /* {
} else {
spaces = (74 - strlen(header));
php_info_printf("%*s%s%*s\n", (int)(spaces/2), " ", header, (int)(spaces/2), " ");
- }
+ }
}
/* }}} */
@@ -1047,7 +1047,7 @@ PHPAPI void php_info_print_table_header(int num_cols, ...)
va_start(row_elements, num_cols);
if (!sapi_module.phpinfo_as_text) {
php_info_print("<tr class=\"h\">");
- }
+ }
for (i=0; i<num_cols; i++) {
row_element = va_arg(row_elements, char *);
if (!row_element || !*row_element) {
@@ -1076,7 +1076,7 @@ PHPAPI void php_info_print_table_header(int num_cols, ...)
/* {{{ php_info_print_table_row_internal
*/
-static void php_info_print_table_row_internal(int num_cols,
+static void php_info_print_table_row_internal(int num_cols,
const char *value_class, va_list row_elements)
{
int i;
@@ -1084,13 +1084,13 @@ static void php_info_print_table_row_internal(int num_cols,
if (!sapi_module.phpinfo_as_text) {
php_info_print("<tr>");
- }
+ }
for (i=0; i<num_cols; i++) {
if (!sapi_module.phpinfo_as_text) {
php_info_printf("<td class=\"%s\">",
(i==0 ? "e" : value_class )
);
- }
+ }
row_element = va_arg(row_elements, char *);
if (!row_element || !*row_element) {
if (!sapi_module.phpinfo_as_text) {
@@ -1105,7 +1105,7 @@ static void php_info_print_table_row_internal(int num_cols,
php_info_print(row_element);
if (i < num_cols-1) {
php_info_print(" => ");
- }
+ }
}
}
if (!sapi_module.phpinfo_as_text) {
@@ -1125,7 +1125,7 @@ static void php_info_print_table_row_internal(int num_cols,
PHPAPI void php_info_print_table_row(int num_cols, ...)
{
va_list row_elements;
-
+
va_start(row_elements, num_cols);
php_info_print_table_row_internal(num_cols, "v", row_elements);
va_end(row_elements);
@@ -1134,11 +1134,11 @@ PHPAPI void php_info_print_table_row(int num_cols, ...)
/* {{{ php_info_print_table_row_ex
*/
-PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class,
+PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class,
...)
{
va_list row_elements;
-
+
va_start(row_elements, value_class);
php_info_print_table_row_internal(num_cols, value_class, row_elements);
va_end(row_elements);
@@ -1266,7 +1266,7 @@ PHP_FUNCTION(php_ini_scanned_files)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
-
+
if (strlen(PHP_CONFIG_FILE_SCAN_DIR) && php_ini_scanned_files) {
RETURN_STRING(php_ini_scanned_files, 1);
} else {
@@ -1282,7 +1282,7 @@ PHP_FUNCTION(php_ini_loaded_file)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
-
+
if (php_ini_opened_path) {
RETURN_STRING(php_ini_opened_path, 1);
} else {
diff --git a/ext/standard/info.h b/ext/standard/info.h
index 631eb049f1..03c652822f 100644
--- a/ext/standard/info.h
+++ b/ext/standard/info.h
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
@@ -14,6 +14,7 @@
+----------------------------------------------------------------------+
| Authors: Rasmus Lerdorf <rasmus@php.net> |
| Zeev Suraski <zeev@zend.com> |
+ | Colin Viebrock <colin@viebrock.ca> |
+----------------------------------------------------------------------+
*/
@@ -22,9 +23,9 @@
#ifndef INFO_H
#define INFO_H
-#define PHP_ENTRY_NAME_COLOR "#ccccff"
-#define PHP_CONTENTS_COLOR "#cccccc"
-#define PHP_HEADER_COLOR "#9999cc"
+#define PHP_ENTRY_NAME_COLOR "#ccf"
+#define PHP_CONTENTS_COLOR "#ccc"
+#define PHP_HEADER_COLOR "#99c"
#define PHP_INFO_GENERAL (1<<0)
#define PHP_INFO_CREDITS (1<<1)
@@ -50,9 +51,9 @@
#endif /* HAVE_CREDITS_DEFS */
-#define PHP_LOGO_DATA_URI "data:image/gif;base64,R0lGODlheABDAOZqAH+CuDk3RyglKszN4qGky9PV57K01ENCWIOGuYKDs1JScpCSwsLE3qqs0ExLY1tcg93e7Ds4PG5xpWptnWFjjXV5sXt+teXm8JmcxoyNwbm62Wtrkk5Oa3F0qXp6o4iLvXJ0o3RzmI6QwVpbfuLj73t9raSl0G1wonJ2rJWWyLu92XR4roWIu5KVw9jZ6pKSxGRmkmtun6WozpSWxS4rL1NRaLO012xqjFxbdoqNv2ZolmhqmpyfyDEuOa6w05yczVVWeJ6hypaZxYGCr2dplz89ULy+2l5giZiZyIyOv4mKuldYfLa319XX6CIeIGxvns7Q5L/A3Hd7tHZ4p19efZmZzG5vmHN3riIeH////5COj1lWV8fGx+7u9dXU1fb2+oKAgayqq3Ryc/Hw8Z6cnePi40tISbm4uWdkZYmJtgD/AEdGX9/g7ZuczGlrnG9zp4yMuri52bi615qbzKeqz9vc65qcyWZkhGhniaeo0m5woIuLucbH4MfJ4WlsnJeYyyH5BAEAAGoALAAAAAB4AEMAAAf/gGqCg4SFhoeIiYqLjI2Oj5CRk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wgCquQcIgxZR9oXekDQk8FF60bqwocupaIoEz6EmaC3C+0Ro6Wgp4eb2tpPJqN+4xXFXQ3TfUfCc5PDNnLZDpLIV1NADKyjZa87mHgmWX57bYdIfIY3pdCGf43xQUXI62kBn3fZxi4SPC8crIjDQ4yzFAaz/XcPJn7xf03VRzIB5Z7qCbBzPQi5jga2E9bCD+ELug8ficEZCk/Cmj8Ro3aLtLxDR1/QffhIHNRTUZCf+S5G7SJBp2b7G31B9+EjcVAFEInZQ2LU7jiN1zf4gu7DR+KwTvkfO9bGx6BNnEQ8XXmN5cT3fEH34SNxwN4A9dgknIEwyWNbeRTwV7WYHBVwFQfbwKb7vOUjiYAiKVT1PczXqCLD/n5UbuLcNxTKoCgExSFNmsFCHI6iJBQFnUbqqbWPHyFceDAOrC/oPpIN+FVaVLrNUa6dLPbvoEQdO4pd1OUylBVkCutsOkqosbNvwcE6qL6g+0hG3MY4ejots1pT3kE4P9QDdfuLKeDfHswD6gu6j2TF2yQcLoqEGurre9EdP1QTfmxJRdn0NlrvD+jmY69Egz+UQvxfgAEALJ4EcRDa/toAAAAASUVORK5CYII="
BEGIN_EXTERN_C()
PHP_FUNCTION(phpversion);
@@ -84,3 +85,4 @@ void register_phpinfo_constants(INIT_FUNC_ARGS);
END_EXTERN_C()
#endif /* INFO_H */
+
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 2be049f200..65702ddf14 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -604,43 +604,7 @@ PHP_FUNCTION(pow)
return;
}
- /* make sure we're dealing with numbers */
- convert_scalar_to_number(zbase TSRMLS_CC);
- convert_scalar_to_number(zexp TSRMLS_CC);
-
- /* if both base and exponent were longs, we'll try to get a long out */
- if (Z_TYPE_P(zbase) == IS_LONG && Z_TYPE_P(zexp) == IS_LONG && Z_LVAL_P(zexp) >= 0) {
- long l1 = 1, l2 = Z_LVAL_P(zbase), i = Z_LVAL_P(zexp);
-
- if (i == 0) {
- RETURN_LONG(1L);
- } else if (l2 == 0) {
- RETURN_LONG(0);
- }
-
- /* calculate pow(long,long) in O(log exp) operations, bail if overflow */
- while (i >= 1) {
- long overflow;
- double dval = 0.0;
-
- if (i % 2) {
- --i;
- ZEND_SIGNED_MULTIPLY_LONG(l1,l2,l1,dval,overflow);
- if (overflow) RETURN_DOUBLE(dval * pow(l2,i));
- } else {
- i /= 2;
- ZEND_SIGNED_MULTIPLY_LONG(l2,l2,l2,dval,overflow);
- if (overflow) RETURN_DOUBLE((double)l1 * pow(dval,i));
- }
- if (i == 0) {
- RETURN_LONG(l1);
- }
- }
- }
- convert_to_double(zbase);
- convert_to_double(zexp);
-
- RETURN_DOUBLE(pow(Z_DVAL_P(zbase), Z_DVAL_P(zexp)));
+ pow_function(return_value, zbase, zexp TSRMLS_CC);
}
/* }}} */
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index 16a30668dc..f42764ba3f 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -82,6 +82,13 @@ static int machine_endian_long_map[4];
static int big_endian_long_map[4];
static int little_endian_long_map[4];
+#if SIZEOF_LONG > 4
+/* Mappings of bytes from quads (64bit) for all endian environments */
+static int machine_endian_longlong_map[8];
+static int big_endian_longlong_map[8];
+static int little_endian_longlong_map[8];
+#endif
+
/* {{{ php_pack
*/
static void php_pack(zval **val, int size, int *map, char *output)
@@ -98,8 +105,8 @@ static void php_pack(zval **val, int size, int *map, char *output)
}
/* }}} */
-/* pack() idea stolen from Perl (implemented formats behave the same as there)
- * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
+/* pack() idea stolen from Perl (implemented formats behave the same as there except J and P)
+ * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, q, Q, J, P, f, d, x, X, @.
*/
/* {{{ proto string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]])
Takes one or more arguments and packs them into a binary string according to the format argument */
@@ -199,6 +206,17 @@ PHP_FUNCTION(pack)
break;
/* Use as many args as specified */
+ case 'q':
+ case 'Q':
+ case 'J':
+ case 'P':
+#if SIZEOF_LONG < 8
+ efree(argv);
+ efree(formatcodes);
+ efree(formatargs);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
+ RETURN_FALSE;
+#endif
case 'c':
case 'C':
case 's':
@@ -283,6 +301,15 @@ PHP_FUNCTION(pack)
INC_OUTPUTPOS(arg,4) /* 32 bit per arg */
break;
+#if SIZEOF_LONG > 4
+ case 'q':
+ case 'Q':
+ case 'J':
+ case 'P':
+ INC_OUTPUTPOS(arg,8) /* 32 bit per arg */
+ break;
+#endif
+
case 'f':
INC_OUTPUTPOS(arg,sizeof(float))
break;
@@ -437,6 +464,27 @@ PHP_FUNCTION(pack)
break;
}
+#if SIZEOF_LONG > 4
+ case 'q':
+ case 'Q':
+ case 'J':
+ case 'P': {
+ int *map = machine_endian_longlong_map;
+
+ if (code == 'J') {
+ map = big_endian_longlong_map;
+ } else if (code == 'P') {
+ map = little_endian_longlong_map;
+ }
+
+ while (arg-- > 0) {
+ php_pack(argv[currentarg++], 8, map, &output[outputpos]);
+ outputpos += 8;
+ }
+ break;
+ }
+#endif
+
case 'f': {
float v;
@@ -522,7 +570,7 @@ static long php_unpack(char *data, int size, int issigned, int *map)
* chars1, chars2, and ints.
* Numeric pack types will return numbers, a and A will return strings,
* f and d will return doubles.
- * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
+ * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, q, Q, J, P, f, d, x, X, @.
*/
/* {{{ proto array unpack(string format, string input)
Unpack binary string into named array elements according to format argument */
@@ -637,6 +685,20 @@ PHP_FUNCTION(unpack)
size = 4;
break;
+ /* Use 8 bytes of input */
+ case 'q':
+ case 'Q':
+ case 'J':
+ case 'P':
+#if SIZEOF_LONG > 4
+ size = 8;
+ break;
+#else
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
+ zval_dtor(return_value);
+ RETURN_FALSE;
+#endif
+
/* Use sizeof(float) bytes of input */
case 'f':
size = sizeof(float);
@@ -860,6 +922,38 @@ PHP_FUNCTION(unpack)
break;
}
+#if SIZEOF_LONG > 4
+ case 'q':
+ case 'Q':
+ case 'J':
+ case 'P': {
+ int issigned = 0;
+ int *map = machine_endian_longlong_map;
+ long v = 0;
+
+ if (type == 'q' || type == 'Q') {
+ issigned = input[inputpos + (machine_little_endian ? 7 : 0)] & 0x80;
+ } else if (type == 'J') {
+ issigned = input[inputpos] & 0x80;
+ map = big_endian_longlong_map;
+ } else if (type == 'P') {
+ issigned = input[inputpos + 7] & 0x80;
+ map = little_endian_longlong_map;
+ }
+
+ v = php_unpack(&input[inputpos], 8, issigned, map);
+
+ if (type == 'q') {
+ v = (signed long int) v;
+ } else {
+ v = (unsigned long int) v;
+ }
+
+ add_assoc_long(return_value, n, v);
+ break;
+ }
+#endif
+
case 'f': {
float v;
@@ -961,6 +1055,33 @@ PHP_MINIT_FUNCTION(pack)
little_endian_long_map[1] = 1;
little_endian_long_map[2] = 2;
little_endian_long_map[3] = 3;
+
+#if SIZEOF_LONG > 4
+ machine_endian_longlong_map[0] = 0;
+ machine_endian_longlong_map[1] = 1;
+ machine_endian_longlong_map[2] = 2;
+ machine_endian_longlong_map[3] = 3;
+ machine_endian_longlong_map[4] = 4;
+ machine_endian_longlong_map[5] = 5;
+ machine_endian_longlong_map[6] = 6;
+ machine_endian_longlong_map[7] = 7;
+ big_endian_longlong_map[0] = 7;
+ big_endian_longlong_map[1] = 6;
+ big_endian_longlong_map[2] = 5;
+ big_endian_longlong_map[3] = 4;
+ big_endian_longlong_map[4] = 3;
+ big_endian_longlong_map[5] = 2;
+ big_endian_longlong_map[6] = 1;
+ big_endian_longlong_map[7] = 0;
+ little_endian_longlong_map[0] = 0;
+ little_endian_longlong_map[1] = 1;
+ little_endian_longlong_map[2] = 2;
+ little_endian_longlong_map[3] = 3;
+ little_endian_longlong_map[4] = 4;
+ little_endian_longlong_map[5] = 5;
+ little_endian_longlong_map[6] = 6;
+ little_endian_longlong_map[7] = 7;
+#endif
}
else {
zval val;
@@ -993,6 +1114,33 @@ PHP_MINIT_FUNCTION(pack)
little_endian_long_map[1] = size - 2;
little_endian_long_map[2] = size - 3;
little_endian_long_map[3] = size - 4;
+
+#if SIZEOF_LONG > 4
+ machine_endian_longlong_map[0] = size - 8;
+ machine_endian_longlong_map[1] = size - 7;
+ machine_endian_longlong_map[2] = size - 6;
+ machine_endian_longlong_map[3] = size - 5;
+ machine_endian_longlong_map[4] = size - 4;
+ machine_endian_longlong_map[5] = size - 3;
+ machine_endian_longlong_map[6] = size - 2;
+ machine_endian_longlong_map[7] = size - 1;
+ big_endian_longlong_map[0] = size - 8;
+ big_endian_longlong_map[1] = size - 7;
+ big_endian_longlong_map[2] = size - 6;
+ big_endian_longlong_map[3] = size - 5;
+ big_endian_longlong_map[4] = size - 4;
+ big_endian_longlong_map[5] = size - 3;
+ big_endian_longlong_map[6] = size - 2;
+ big_endian_longlong_map[7] = size - 1;
+ little_endian_longlong_map[0] = size - 1;
+ little_endian_longlong_map[1] = size - 2;
+ little_endian_longlong_map[2] = size - 3;
+ little_endian_longlong_map[3] = size - 4;
+ little_endian_longlong_map[4] = size - 5;
+ little_endian_longlong_map[5] = size - 6;
+ little_endian_longlong_map[6] = size - 7;
+ little_endian_longlong_map[7] = size - 8;
+#endif
}
return SUCCESS;
diff --git a/ext/standard/password.c b/ext/standard/password.c
index ae405096fa..0da1de66f5 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -183,7 +183,7 @@ PHP_FUNCTION(password_get_info)
return;
}
- if (hash_len < 0 || (size_t) hash_len < 0) {
+ if (hash_len < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied password hash too long to safely identify");
RETURN_FALSE;
}
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h
index e2af3310d0..1b30e34787 100644
--- a/ext/standard/php_array.h
+++ b/ext/standard/php_array.h
@@ -103,10 +103,11 @@ PHP_FUNCTION(array_key_exists);
PHP_FUNCTION(array_chunk);
PHP_FUNCTION(array_combine);
-PHPAPI HashTable* php_splice(HashTable *, int, int, zval ***, int, HashTable **);
+PHPAPI void php_splice(HashTable *ht, zend_uint offset, zend_uint length, zval ***list, zend_uint list_count, HashTable *removed TSRMLS_DC);
PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS_DC);
PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC);
PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC);
+PHPAPI int php_count_recursive(zval *array, long mode TSRMLS_DC);
#define PHP_SORT_REGULAR 0
#define PHP_SORT_NUMERIC 1
@@ -117,6 +118,12 @@ PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC);
#define PHP_SORT_NATURAL 6
#define PHP_SORT_FLAG_CASE 8
+#define COUNT_NORMAL 0
+#define COUNT_RECURSIVE 1
+
+#define ARRAY_FILTER_USE_BOTH 1
+#define ARRAY_FILTER_USE_KEY 2
+
ZEND_BEGIN_MODULE_GLOBALS(array)
int *multisort_flags[2];
int (*compare_func)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 4b4180230e..9628c0d69d 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -63,6 +63,12 @@ php_stream_ops php_stream_output_ops = {
NULL /* set_option */
};
+typedef struct php_stream_input { /* {{{ */
+ php_stream *body;
+ off_t position;
+} php_stream_input_t;
+/* }}} */
+
static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
{
return -1;
@@ -71,42 +77,36 @@ static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t
static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
{
- off_t *position = (off_t*)stream->abstract;
- size_t read_bytes = 0;
-
- if (!stream->eof) {
- if (SG(request_info).raw_post_data) { /* data has already been read by a post handler */
- read_bytes = SG(request_info).raw_post_data_length - *position;
- if (read_bytes <= count) {
- stream->eof = 1;
- } else {
- read_bytes = count;
- }
- if (read_bytes) {
- memcpy(buf, SG(request_info).raw_post_data + *position, read_bytes);
- }
- } else if (sapi_module.read_post) {
- read_bytes = sapi_module.read_post(buf, count TSRMLS_CC);
- if (read_bytes <= 0) {
- stream->eof = 1;
- read_bytes = 0;
- }
- /* Increment SG(read_post_bytes) only when something was actually read. */
- SG(read_post_bytes) += read_bytes;
- } else {
- stream->eof = 1;
+ php_stream_input_t *input = stream->abstract;
+ size_t read;
+
+ if (!SG(post_read) && SG(read_post_bytes) < input->position + count) {
+ /* read requested data from SAPI */
+ int read_bytes = sapi_read_post_block(buf, count TSRMLS_CC);
+
+ if (read_bytes > 0) {
+ php_stream_seek(input->body, 0, SEEK_END);
+ php_stream_write(input->body, buf, read_bytes);
}
}
- *position += read_bytes;
+ php_stream_seek(input->body, input->position, SEEK_SET);
+ read = php_stream_read(input->body, buf, count);
+
+ if (!read || read == (size_t) -1) {
+ stream->eof = 1;
+ } else {
+ input->position += read;
+ }
- return read_bytes;
+ return read;
}
/* }}} */
static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
{
efree(stream->abstract);
+ stream->abstract = NULL;
return 0;
}
@@ -118,13 +118,27 @@ static int php_stream_input_flush(php_stream *stream TSRMLS_DC) /* {{{ */
}
/* }}} */
+static int php_stream_input_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC) /* {{{ */
+{
+ php_stream_input_t *input = stream->abstract;
+
+ if (input->body) {
+ int sought = php_stream_seek(input->body, offset, whence);
+ *newoffset = (input->body)->position;
+ return sought;
+ }
+
+ return -1;
+}
+/* }}} */
+
php_stream_ops php_stream_input_ops = {
php_stream_input_write,
php_stream_input_read,
php_stream_input_close,
php_stream_input_flush,
"Input",
- NULL, /* seek */
+ php_stream_input_seek,
NULL, /* cast */
NULL, /* stat */
NULL /* set_option */
@@ -157,7 +171,8 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i
}
/* }}} */
-php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
+ char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
{
int fd = -1;
int mode_rw = 0;
@@ -203,13 +218,24 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
}
if (!strcasecmp(path, "input")) {
+ php_stream_input_t *input;
+
if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
if (options & REPORT_ERRORS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
}
return NULL;
}
- return php_stream_alloc(&php_stream_input_ops, ecalloc(1, sizeof(off_t)), 0, "rb");
+
+ input = ecalloc(1, sizeof(*input));
+ if ((input->body = SG(request_info).request_body)) {
+ php_stream_rewind(input->body);
+ } else {
+ input->body = php_stream_temp_create_ex(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE, PG(upload_tmp_dir));
+ SG(request_info).request_body = input->body;
+ }
+
+ return php_stream_alloc(&php_stream_input_ops, input, 0, "rb");
}
if (!strcasecmp(path, "stdin")) {
@@ -258,8 +284,8 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
fd = dup(STDERR_FILENO);
}
} else if (!strncasecmp(path, "fd/", 3)) {
- char *start,
- *end;
+ const char *start;
+ char *end;
long fildes_ori;
int dtablesize;
diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h
index 3964310c50..341c7ad829 100644
--- a/ext/standard/php_fopen_wrappers.h
+++ b/ext/standard/php_fopen_wrappers.h
@@ -23,8 +23,8 @@
#ifndef PHP_FOPEN_WRAPPERS_H
#define PHP_FOPEN_WRAPPERS_H
-php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
extern PHPAPI php_stream_wrapper php_stream_http_wrapper;
extern PHPAPI php_stream_wrapper php_stream_ftp_wrapper;
extern php_stream_wrapper php_stream_php_wrapper;
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index f4c3b4738c..50ceb605ed 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -34,6 +34,7 @@
#include "exec.h"
#include "php_globals.h"
#include "SAPI.h"
+#include "main/php_network.h"
#ifdef NETWARE
#include <proc.h>
@@ -556,7 +557,7 @@ PHP_FUNCTION(proc_open)
if (Z_TYPE_PP(descitem) == IS_RESOURCE) {
/* should be a stream - try and dup the descriptor */
php_stream *stream;
- int fd;
+ php_socket_t fd;
php_stream_from_zval(stream, descitem);
@@ -629,7 +630,7 @@ PHP_FUNCTION(proc_open)
} else if (strcmp(Z_STRVAL_PP(ztype), "file") == 0) {
zval **zfile, **zmode;
- int fd;
+ php_socket_t fd;
php_stream *stream;
descriptors[ndesc].mode = DESC_FILE;
diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h
index 9d4acd4a8f..b1f5772e8a 100644
--- a/ext/standard/scanf.h
+++ b/ext/standard/scanf.h
@@ -23,7 +23,7 @@
#define SCAN_MAX_ARGS 0xFF /* Maximum number of variable which can be */
- /* passed to (f|s)scanf. This is an artifical */
+ /* passed to (f|s)scanf. This is an artificial */
/* upper limit to keep resources in check and */
/* minimize the possibility of exploits */
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 6876792d63..8df4be7fac 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -40,6 +40,8 @@ typedef unsigned long long php_timeout_ull;
typedef unsigned __int64 php_timeout_ull;
#endif
+#define GET_CTX_OPT(stream, wrapper, name, val) (stream->context && SUCCESS == php_stream_context_get_option(stream->context, wrapper, name, &val))
+
static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC);
/* Streams based network functions */
@@ -614,10 +616,7 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
zend_hash_get_current_data(Z_ARRVAL_P(stream_array), (void **) &elem) == SUCCESS;
zend_hash_move_forward(Z_ARRVAL_P(stream_array))) {
- /* Temporary int fd is needed for the STREAM data type on windows, passing this_fd directly to php_stream_cast()
- would eventually bring a wrong result on x64. php_stream_cast() casts to int internally, and this will leave
- the higher bits of a SOCKET variable uninitialized on systems with little endian. */
- int tmp_fd;
+ php_socket_t this_fd;
php_stream_from_zval_no_verify(stream, elem);
if (stream == NULL) {
@@ -628,9 +627,7 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
* when casting. It is only used here so that the buffered data warning
* is not displayed.
* */
- if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&tmp_fd, 1) && tmp_fd != -1) {
-
- php_socket_t this_fd = (php_socket_t)tmp_fd;
+ if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd != -1) {
PHP_SAFE_FD_SET(this_fd, fds);
@@ -664,10 +661,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
char *key;
uint key_len;
ulong num_ind;
- /* Temporary int fd is needed for the STREAM data type on windows, passing this_fd directly to php_stream_cast()
- would eventually bring a wrong result on x64. php_stream_cast() casts to int internally, and this will leave
- the higher bits of a SOCKET variable uninitialized on systems with little endian. */
- int tmp_fd;
+ php_socket_t this_fd;
type = zend_hash_get_current_key_ex(Z_ARRVAL_P(stream_array),
@@ -686,10 +680,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
* when casting. It is only used here so that the buffered data warning
* is not displayed.
*/
- if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&tmp_fd, 1) && tmp_fd != -1) {
-
- php_socket_t this_fd = (php_socket_t)tmp_fd;
-
+ if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd != SOCK_ERR) {
if (PHP_SAFE_FD_ISSET(this_fd, fds)) {
if (type == HASH_KEY_IS_LONG) {
zend_hash_index_update(new_hash, num_ind, (void *)elem, sizeof(zval *), (void **)&dest_elem);
@@ -1506,16 +1497,27 @@ PHP_FUNCTION(stream_socket_enable_crypto)
long cryptokind = 0;
zval *zstream, *zsessstream = NULL;
php_stream *stream, *sessstream = NULL;
- zend_bool enable;
+ zend_bool enable, cryptokindnull;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|lr", &zstream, &enable, &cryptokind, &zsessstream) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|l!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, &zstream);
- if (ZEND_NUM_ARGS() >= 3) {
+ if (enable) {
+ if (ZEND_NUM_ARGS() < 3 || cryptokindnull) {
+ zval **val;
+
+ if (!GET_CTX_OPT(stream, "ssl", "crypto_method", val)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "When enabling encryption you must specify the crypto type");
+ RETURN_FALSE;
+ }
+
+ cryptokind = Z_LVAL_PP(val);
+ }
+
if (zsessstream) {
php_stream_from_zval(sessstream, &zsessstream);
}
@@ -1523,9 +1525,6 @@ PHP_FUNCTION(stream_socket_enable_crypto)
if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream TSRMLS_CC) < 0) {
RETURN_FALSE;
}
- } else if (enable) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "When enabling encryption you must specify the crypto type");
- RETURN_FALSE;
}
ret = php_stream_xport_crypto_enable(stream, enable TSRMLS_CC);
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 3581e7c6c5..0977ff97cf 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -13,7 +13,7 @@
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Rasmus Lerdorf <rasmus@php.net> |
- | Stig Sæther Bakken <ssb@php.net> |
+ | Stig S�ther Bakken <ssb@php.net> |
| Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
@@ -23,11 +23,6 @@
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
#include <stdio.h>
-#ifdef PHP_WIN32
-# include "win32/php_stdint.h"
-#else
-# include <stdint.h>
-#endif
#include "php.h"
#include "php_rand.h"
#include "php_string.h"
diff --git a/ext/standard/tests/array/array_fill.phpt b/ext/standard/tests/array/array_fill.phpt
index 1de7c31420..c6c7e1e457 100644
--- a/ext/standard/tests/array/array_fill.phpt
+++ b/ext/standard/tests/array/array_fill.phpt
@@ -23,34 +23,28 @@ echo '== Done ==';
--EXPECTF--
===========================
start: 0 num: 0 value: 1
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 0 num: 0 value:
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 0 num: 0 value:
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 0 num: 0 value: d
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 0 num: 0 value: e
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 0 num: 0 value: f
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 0 num: 1 value: 1
array(1) {
@@ -137,34 +131,28 @@ array(2) {
}
===========================
start: 1 num: 0 value: 1
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 1 num: 0 value:
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 1 num: 0 value:
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 1 num: 0 value: d
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 1 num: 0 value: e
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 1 num: 0 value: f
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 1 num: 1 value: 1
array(1) {
@@ -251,34 +239,28 @@ array(2) {
}
===========================
start: 2.5 num: 0 value: 1
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 2.5 num: 0 value:
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 2.5 num: 0 value:
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 2.5 num: 0 value: d
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 2.5 num: 0 value: e
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 2.5 num: 0 value: f
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
===========================
start: 2.5 num: 1 value: 1
array(1) {
diff --git a/ext/standard/tests/array/array_fill_error.phpt b/ext/standard/tests/array/array_fill_error.phpt
index 167163228d..33ee2b3858 100644
--- a/ext/standard/tests/array/array_fill_error.phpt
+++ b/ext/standard/tests/array/array_fill_error.phpt
@@ -32,10 +32,6 @@ var_dump( array_fill($start_key,$num) );
$num = -1;
var_dump( array_fill($start_key,$num,$val) );
-//callin array_fill with 'num' equal to zero value
-$num = 0;
-var_dump( array_fill($start_key,$num,$val) );
-
echo "Done";
?>
--EXPECTF--
@@ -53,9 +49,6 @@ NULL
Warning: array_fill() expects exactly 3 parameters, 2 given in %s on line %d
NULL
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
+Warning: array_fill(): Number of elements can't be negative in %s on line %d
bool(false)
Done
diff --git a/ext/standard/tests/array/array_fill_variation2.phpt b/ext/standard/tests/array/array_fill_variation2.phpt
index 9e9df29b0b..ecf4ef435e 100644
--- a/ext/standard/tests/array/array_fill_variation2.phpt
+++ b/ext/standard/tests/array/array_fill_variation2.phpt
@@ -106,7 +106,7 @@ array(2) {
}
-- Iteration 2 --
-Warning: array_fill(): Number of elements must be positive in %s on line %d
+Warning: array_fill(): Number of elements can't be negative in %s on line %d
bool(false)
-- Iteration 3 --
array(5) {
@@ -122,13 +122,11 @@ array(5) {
int(100)
}
-- Iteration 4 --
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
-- Iteration 5 --
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
-- Iteration 6 --
Warning: array_fill() expects parameter 2 to be long, array given in %s on line %d
@@ -150,31 +148,27 @@ NULL
Warning: array_fill() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 11 --
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
-- Iteration 12 --
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
-- Iteration 13 --
array(1) {
[0]=>
int(100)
}
-- Iteration 14 --
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
-- Iteration 15 --
array(1) {
[0]=>
int(100)
}
-- Iteration 16 --
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
-- Iteration 17 --
Warning: array_fill() expects parameter 2 to be long, string given in %s on line %d
@@ -196,11 +190,9 @@ NULL
Warning: array_fill() expects parameter 2 to be long, object given in %s on line %d
NULL
-- Iteration 22 --
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
-- Iteration 23 --
-
-Warning: array_fill(): Number of elements must be positive in %s on line %d
-bool(false)
+array(0) {
+}
Done
diff --git a/ext/standard/tests/array/array_filter_error.phpt b/ext/standard/tests/array/array_filter_error.phpt
index 20e89aa4b7..3f8f51bc14 100644
--- a/ext/standard/tests/array/array_filter_error.phpt
+++ b/ext/standard/tests/array/array_filter_error.phpt
@@ -28,7 +28,7 @@ $extra_arg = 10;
// with one more than the expected number of arguments
echo "-- Testing array_filter() function with more than expected no. of arguments --";
-var_dump( array_filter($input, "odd", $extra_arg) );
+var_dump( array_filter($input, "odd", $extra_arg, $extra_arg) );
// with incorrect callback function
echo "-- Testing array_filter() function with incorrect callback --";
@@ -42,7 +42,7 @@ echo "Done"
Warning: array_filter() expects at least 1 parameter, 0 given in %s on line %d
NULL
-- Testing array_filter() function with more than expected no. of arguments --
-Warning: array_filter() expects at most 2 parameters, 3 given in %s on line %d
+Warning: array_filter() expects at most 3 parameters, 4 given in %s on line %d
NULL
-- Testing array_filter() function with incorrect callback --
Warning: array_filter() expects parameter 2 to be a valid callback, function 'even' not found or invalid function name in %s on line %d
diff --git a/ext/standard/tests/array/array_filter_variation10.phpt b/ext/standard/tests/array/array_filter_variation10.phpt
new file mode 100644
index 0000000000..f0a6115f79
--- /dev/null
+++ b/ext/standard/tests/array/array_filter_variation10.phpt
@@ -0,0 +1,103 @@
+--TEST--
+Test array_filter() function : usage variations - using the array keys inside 'callback'
+--FILE--
+<?php
+/* Prototype : array array_filter(array $input [, callback $callback [, bool $use_type = ARRAY_FILTER_USE_VALUE]])
+ * Description: Filters elements from the array via the callback.
+ * Source code: ext/standard/array.c
+*/
+
+/*
+* Using array keys as an argument to the 'callback'
+*/
+
+echo "*** Testing array_filter() : usage variations - using array keys in 'callback' ***\n";
+
+$input = array(0, 1, -1, 10, 100, 1000, 'Hello', null);
+$small = array(123);
+
+function dump($value, $key)
+{
+ echo "$key = $value\n";
+}
+
+var_dump( array_filter($input, 'dump', true) );
+
+echo "*** Testing array_filter() : usage variations - 'callback' filters based on key value ***\n";
+
+function dump2($value, $key)
+{
+ return $key > 4;
+}
+
+var_dump( array_filter($input, 'dump2', true) );
+
+echo "*** Testing array_filter() : usage variations - 'callback' expecting second argument ***\n";
+
+var_dump( array_filter($small, 'dump', false) );
+
+echo "*** Testing array_filter() with various use types ***\n";
+
+$mixed = array(1 => 'a', 2 => 'b', 'a' => 1, 'b' => 2);
+
+var_dump(array_filter($mixed, 'is_numeric', ARRAY_FILTER_USE_KEY));
+
+var_dump(array_filter($mixed, 'is_numeric', 0));
+
+var_dump(array_filter($mixed, 'is_numeric', ARRAY_FILTER_USE_BOTH));
+
+echo "Done"
+?>
+--EXPECTF--
+*** Testing array_filter() : usage variations - using array keys in 'callback' ***
+0 = 0
+1 = 1
+2 = -1
+3 = 10
+4 = 100
+5 = 1000
+6 = Hello
+7 =
+array(0) {
+}
+*** Testing array_filter() : usage variations - 'callback' filters based on key value ***
+array(3) {
+ [5]=>
+ int(1000)
+ [6]=>
+ string(5) "Hello"
+ [7]=>
+ NULL
+}
+*** Testing array_filter() : usage variations - 'callback' expecting second argument ***
+
+Warning: Missing argument 2 for dump() in %s on line %d
+
+Notice: Undefined variable: key in %s on line %d
+ = 123
+array(0) {
+}
+*** Testing array_filter() with various use types ***
+array(2) {
+ [1]=>
+ string(1) "a"
+ [2]=>
+ string(1) "b"
+}
+array(2) {
+ ["a"]=>
+ int(1)
+ ["b"]=>
+ int(2)
+}
+
+Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 44
+
+Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 44
+
+Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 44
+
+Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 44
+array(0) {
+}
+Done
diff --git a/ext/standard/tests/dir/chdir_basic.phpt b/ext/standard/tests/dir/chdir_basic.phpt
index 5fc0e5b886..81d3c7c9d1 100644
--- a/ext/standard/tests/dir/chdir_basic.phpt
+++ b/ext/standard/tests/dir/chdir_basic.phpt
@@ -14,40 +14,40 @@ Test chdir() function : basic functionality
echo "*** Testing chdir() : basic functionality ***\n";
$base_dir_path = dirname(__FILE__);
-$level_one_dir_name = "level_one";
-$level_one_dir_path = "$base_dir_path/$level_one_dir_name";
+$level1_one_dir_name = "level1_one";
+$level1_one_dir_path = "$base_dir_path/$level1_one_dir_name";
-$level_two_dir_name = "level_two";
-$level_two_dir_path = "$base_dir_path/$level_one_dir_name/$level_two_dir_name";
+$level1_two_dir_name = "level1_two";
+$level1_two_dir_path = "$base_dir_path/$level1_one_dir_name/$level1_two_dir_name";
// create directories
-mkdir($level_one_dir_path);
-mkdir($level_two_dir_path);
+mkdir($level1_one_dir_path);
+mkdir($level1_two_dir_path);
echo "\n-- Testing chdir() with absolute path: --\n";
chdir($base_dir_path);
-var_dump(chdir($level_one_dir_path));
+var_dump(chdir($level1_one_dir_path));
var_dump(getcwd());
echo "\n-- Testing chdir() with relative paths: --\n";
-var_dump(chdir($level_two_dir_name));
+var_dump(chdir($level1_two_dir_name));
var_dump(getcwd());
?>
===DONE===
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-rmdir("$file_path/level_one/level_two");
-rmdir("$file_path/level_one");
+rmdir("$file_path/level1_one/level1_two");
+rmdir("$file_path/level1_one");
?>
--EXPECTF--
*** Testing chdir() : basic functionality ***
-- Testing chdir() with absolute path: --
bool(true)
-string(%d) "%slevel_one"
+string(%d) "%slevel1_one"
-- Testing chdir() with relative paths: --
bool(true)
-string(%d) "%slevel_one%elevel_two"
+string(%d) "%slevel1_one%elevel1_two"
===DONE===
diff --git a/ext/standard/tests/dir/chdir_variation2.phpt b/ext/standard/tests/dir/chdir_variation2.phpt
index fa70f9e104..9ca6a97748 100644
--- a/ext/standard/tests/dir/chdir_variation2.phpt
+++ b/ext/standard/tests/dir/chdir_variation2.phpt
@@ -15,32 +15,32 @@ echo "*** Testing chdir() : usage variations ***\n";
$base_dir_path = dirname(__FILE__);
-$level_one_dir_name = "level_one";
-$level_one_dir_path = "$base_dir_path/$level_one_dir_name";
+$level2_one_dir_name = "level2_one";
+$level2_one_dir_path = "$base_dir_path/$level2_one_dir_name";
-$level_two_dir_name = "level_two";
-$level_two_dir_path = "$base_dir_path/$level_one_dir_name/$level_two_dir_name";
+$level2_two_dir_name = "level2_two";
+$level2_two_dir_path = "$base_dir_path/$level2_one_dir_name/$level2_two_dir_name";
// create directories
-mkdir($level_one_dir_path);
-mkdir($level_two_dir_path);
+mkdir($level2_one_dir_path);
+mkdir($level2_two_dir_path);
-echo "\n-- \$directory = './level_one': --\n";
+echo "\n-- \$directory = './level2_one': --\n";
var_dump(chdir($base_dir_path));
-var_dump(chdir("./$level_one_dir_name"));
+var_dump(chdir("./$level2_one_dir_name"));
var_dump(getcwd());
-echo "\n-- \$directory = 'level_one/level_two': --\n";
+echo "\n-- \$directory = 'level2_one/level2_two': --\n";
var_dump(chdir($base_dir_path));
-var_dump(chdir("$level_one_dir_name/$level_two_dir_name"));
+var_dump(chdir("$level2_one_dir_name/$level2_two_dir_name"));
var_dump(getcwd());
echo "\n-- \$directory = '..': --\n";
var_dump(chdir('..'));
var_dump(getcwd());
-echo "\n-- \$directory = 'level_two', '.': --\n";
-var_dump(chdir($level_two_dir_path));
+echo "\n-- \$directory = 'level2_two', '.': --\n";
+var_dump(chdir($level2_two_dir_path));
var_dump(chdir('.'));
var_dump(getcwd());
@@ -49,13 +49,13 @@ var_dump(chdir('../'));
var_dump(getcwd());
echo "\n-- \$directory = './': --\n";
-var_dump(chdir($level_two_dir_path));
+var_dump(chdir($level2_two_dir_path));
var_dump(chdir('./'));
var_dump(getcwd());
-echo "\n-- \$directory = '../../'level_one': --\n";
-var_dump(chdir($level_two_dir_path));
-var_dump(chdir("../../$level_one_dir_name"));
+echo "\n-- \$directory = '../../'level2_one': --\n";
+var_dump(chdir($level2_two_dir_path));
+var_dump(chdir("../../$level2_one_dir_name"));
var_dump(getcwd());
?>
@@ -63,42 +63,42 @@ var_dump(getcwd());
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-rmdir("$file_path/level_one/level_two");
-rmdir("$file_path/level_one");
+rmdir("$file_path/level2_one/level2_two");
+rmdir("$file_path/level2_one");
?>
--EXPECTF--
*** Testing chdir() : usage variations ***
--- $directory = './level_one': --
+-- $directory = './level2_one': --
bool(true)
bool(true)
-string(%d) "%slevel_one"
+string(%d) "%slevel2_one"
--- $directory = 'level_one/level_two': --
+-- $directory = 'level2_one/level2_two': --
bool(true)
bool(true)
-string(%d) "%slevel_one%elevel_two"
+string(%d) "%slevel2_one%elevel2_two"
-- $directory = '..': --
bool(true)
-string(%d) "%slevel_one"
+string(%d) "%slevel2_one"
--- $directory = 'level_two', '.': --
+-- $directory = 'level2_two', '.': --
bool(true)
bool(true)
-string(%d) "%slevel_one%elevel_two"
+string(%d) "%slevel2_one%elevel2_two"
-- $directory = '../': --
bool(true)
-string(%d) "%slevel_one"
+string(%d) "%slevel2_one"
-- $directory = './': --
bool(true)
bool(true)
-string(%d) "%slevel_one%elevel_two"
+string(%d) "%slevel2_one%elevel2_two"
--- $directory = '../../'level_one': --
+-- $directory = '../../'level2_one': --
bool(true)
bool(true)
-string(%d) "%slevel_one"
+string(%d) "%slevel2_one"
===DONE===
diff --git a/ext/standard/tests/file/bug41655_2.phpt b/ext/standard/tests/file/bug41655_2.phpt
index d406f1ba04..96f5cc86f0 100644
--- a/ext/standard/tests/file/bug41655_2.phpt
+++ b/ext/standard/tests/file/bug41655_2.phpt
@@ -5,11 +5,13 @@ open_basedir=/
--FILE--
<?php
$dir = dirname(__FILE__);
- $a=glob($dir . "/test.*");
+ $a=glob($dir . "/test*csv");
print_r($a);
?>
--EXPECTF--
Array
(
[0] => %stest.csv
+ [1] => %stest2.csv
+ [2] => %stest3.csv
)
diff --git a/ext/standard/tests/file/copy_variation16-win32.phpt b/ext/standard/tests/file/copy_variation16-win32.phpt
index 7688f5eeab..d95d24adac 100644
--- a/ext/standard/tests/file/copy_variation16-win32.phpt
+++ b/ext/standard/tests/file/copy_variation16-win32.phpt
@@ -22,7 +22,7 @@ mkdir($base_dir);
$sub_dir = $base_dir."/copy_variation16_sub";
mkdir($sub_dir);
-$dirname_with_blank = $sub_dir."/copy variation6";
+$dirname_with_blank = $sub_dir."/copy variation16";
mkdir($dirname_with_blank);
$src_file_name = dirname(__FILE__)."/copy_variation16.tmp";
@@ -139,6 +139,6 @@ Existence of destination file => bool(false)
Size of source file => int(3500)
Copy operation => bool(true)
Existence of destination file => bool(true)
-Destination file name is => %s/copy_variation16/copy_variation16_sub/copy variation6/copy_copy_variation16.tmp
+Destination file name is => %s/copy_variation16/copy_variation16_sub/copy variation16/copy_copy_variation16.tmp
Size of destination file => int(3500)
*** Done ***
diff --git a/ext/standard/tests/file/copy_variation16.phpt b/ext/standard/tests/file/copy_variation16.phpt
index 9ad834bdb4..e36fee1d66 100644
--- a/ext/standard/tests/file/copy_variation16.phpt
+++ b/ext/standard/tests/file/copy_variation16.phpt
@@ -22,7 +22,7 @@ mkdir($base_dir);
$sub_dir = $base_dir."/copy_variation16_sub";
mkdir($sub_dir);
-$dirname_with_blank = $sub_dir."/copy variation6";
+$dirname_with_blank = $sub_dir."/copy variation16";
mkdir($dirname_with_blank);
$src_file_name = dirname(__FILE__)."/copy_variation16.tmp";
@@ -138,6 +138,6 @@ Size of destination file => int(3500)
Size of source file => int(3500)
Copy operation => bool(true)
Existence of destination file => bool(true)
-Destination file name is => %s/copy_variation16/copy_variation16_sub/copy variation6/copy_copy_variation16.tmp
+Destination file name is => %s/copy_variation16/copy_variation16_sub/copy variation16/copy_copy_variation16.tmp
Size of destination file => int(3500)
*** Done ***
diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt
index 200e92ab43..2904ff9a5b 100644
--- a/ext/standard/tests/file/disk_free_space_basic.phpt
+++ b/ext/standard/tests/file/disk_free_space_basic.phpt
@@ -29,7 +29,7 @@ $space1 = disk_free_space($file_path.$dir);
var_dump( $space1 );
$fh = fopen($file_path.$dir."/disk_free_space.tmp", "a");
-$data = str_repeat("x", 4096);
+$data = str_repeat("x", 0xffff);
fwrite($fh, (binary)$data);
fclose($fh);
@@ -39,8 +39,10 @@ var_dump( $space2 );
if($space1 > $space2 )
echo "\n Free Space Value Is Correct\n";
-else
+else {
echo "\n Free Space Value Is Incorrect\n";
+ var_dump($space1, $space2);
+}
echo "*** Testing with Binary Input ***\n";
var_dump( disk_free_space(b"$file_path") );
diff --git a/ext/standard/tests/file/fopen_include_path.inc b/ext/standard/tests/file/fopen_include_path.inc
index 7d6723a815..5bc9b6ce3b 100644
--- a/ext/standard/tests/file/fopen_include_path.inc
+++ b/ext/standard/tests/file/fopen_include_path.inc
@@ -1,6 +1,6 @@
<?php
$pwd = getcwd();
-$f = basename(__FILE__);
+$f = basename(current(get_included_files()), ".php");
$dir1 = $pwd."/".$f.".dir1";
$dir2 = $pwd."/".$f.".dir2";
$dir3 = $pwd."/".$f.".dir3";
diff --git a/ext/standard/tests/file/fopen_variation16.phpt b/ext/standard/tests/file/fopen_variation16.phpt
index 3f220aa7c0..e14f2e1c16 100644
--- a/ext/standard/tests/file/fopen_variation16.phpt
+++ b/ext/standard/tests/file/fopen_variation16.phpt
@@ -32,7 +32,7 @@ rmdir($thisTestDir);
function runtest() {
global $dir1;
- $extraDir = "extraDir";
+ $extraDir = "extraDir16";
mkdir($dir1.'/'.$extraDir);
mkdir($extraDir);
diff --git a/ext/standard/tests/file/fopen_variation17.phpt b/ext/standard/tests/file/fopen_variation17.phpt
index bc75c11c90..8abae0fbe5 100644
--- a/ext/standard/tests/file/fopen_variation17.phpt
+++ b/ext/standard/tests/file/fopen_variation17.phpt
@@ -32,7 +32,7 @@ rmdir($thisTestDir);
function runtest() {
global $dir1;
- $extraDir = "extraDir";
+ $extraDir = "extraDir17";
mkdir($dir1.'/'.$extraDir);
mkdir($extraDir);
diff --git a/ext/standard/tests/file/fscanf_variation53.phpt b/ext/standard/tests/file/fscanf_variation53.phpt
index b65bccf8fd..a553a96693 100644
--- a/ext/standard/tests/file/fscanf_variation53.phpt
+++ b/ext/standard/tests/file/fscanf_variation53.phpt
@@ -30,7 +30,7 @@ $counter = 1;
foreach($modes as $mode) {
// create an empty file
- $filename = "$file_path/fscanf_variation52.tmp";
+ $filename = "$file_path/fscanf_variation53.tmp";
$file_handle = fopen($filename, "w");
if($file_handle == false)
exit("Error:failed to open file $filename");
diff --git a/ext/standard/tests/file/glob_variation3.phpt b/ext/standard/tests/file/glob_variation3.phpt
index 257b5c365e..c50f8a81b8 100644
--- a/ext/standard/tests/file/glob_variation3.phpt
+++ b/ext/standard/tests/file/glob_variation3.phpt
@@ -13,8 +13,7 @@ var_dump(glob("$path/*/nothere"));
var_dump(glob("$path/[aoeu]*.none"));
var_dump(glob("$path/directly_not_exists"));
-$b = ini_get('open_basedir');
-var_dump(empty($b));
+var_dump(empty(ini_get('open_basedir')));
?>
==DONE==
--EXPECT--
diff --git a/ext/standard/tests/file/rename_variation1.phpt b/ext/standard/tests/file/rename_variation1.phpt
index 0f7321e205..54338d7460 100644
--- a/ext/standard/tests/file/rename_variation1.phpt
+++ b/ext/standard/tests/file/rename_variation1.phpt
@@ -16,16 +16,16 @@ $file_path = dirname(__FILE__);
echo "\n*** Testing rename() : renaming directory across directories ***\n";
$src_dirs = array (
/* Testing simple directory tree */
- "$file_path/rename_variation/",
+ "$file_path/rename_variation1/",
/* Testing a dir with trailing slash */
- "$file_path/rename_variation/",
+ "$file_path/rename_variation1/",
/* Testing dir with double trailing slashes */
- "$file_path//rename_variation//",
+ "$file_path//rename_variation1//",
);
-$dest_dir = "$file_path/rename_variation_dir";
+$dest_dir = "$file_path/rename_variation1_dir";
// create the $dest_dir
mkdir($dest_dir);
@@ -35,7 +35,7 @@ foreach($src_dirs as $src_dir) {
echo "-- Iteration $counter --\n";
// create the src dir
- mkdir("$file_path/rename_variation/");
+ mkdir("$file_path/rename_variation1/");
// rename the src dir to a new dir in dest dir
var_dump( rename($src_dir, $dest_dir."/new_dir") );
// ensure that dir was renamed
@@ -52,7 +52,7 @@ echo "Done\n";
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-rmdir($file_path."/rename_variation_dir");
+rmdir($file_path."/rename_variation1_dir");
?>
--EXPECTF--
*** Testing rename() : renaming directory across directories ***
diff --git a/ext/standard/tests/file/rename_variation2-win32.phpt b/ext/standard/tests/file/rename_variation2-win32.phpt
index 87f4e7ddb1..9627a9fa53 100644
--- a/ext/standard/tests/file/rename_variation2-win32.phpt
+++ b/ext/standard/tests/file/rename_variation2-win32.phpt
@@ -15,27 +15,27 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
require dirname(__FILE__).'/file.inc';
$file_path = dirname(__FILE__);
-mkdir("$file_path/rename_variation_dir");
+mkdir("$file_path/rename_variation2_dir");
/* Renaming a file and directory to numeric name */
echo "\n*** Testing rename() by renaming a file and directory to numeric name ***\n";
-$fp = fopen($file_path."/rename_variation.tmp", "w");
+$fp = fopen($file_path."/rename_variation2.tmp", "w");
fclose($fp);
// renaming existing file to numeric name
-var_dump( rename($file_path."/rename_variation.tmp", $file_path."/12345") );
+var_dump( rename($file_path."/rename_variation2.tmp", $file_path."/12345") );
// ensure that rename worked fine
-var_dump( file_exists($file_path."/rename_variation.tmp" ) ); // expecting false
+var_dump( file_exists($file_path."/rename_variation2.tmp" ) ); // expecting false
var_dump( file_exists($file_path."/12345" ) ); // expecting true
unlink($file_path."/12345");
// renaming a directory to numeric name
-var_dump( rename($file_path."/rename_variation_dir/", $file_path."/12345") );
+var_dump( rename($file_path."/rename_variation2_dir/", $file_path."/12345") );
// ensure that rename worked fine
-var_dump( file_exists($file_path."/rename_variation_dir" ) ); // expecting false
+var_dump( file_exists($file_path."/rename_variation2_dir" ) ); // expecting false
var_dump( file_exists($file_path."/12345" ) ); // expecting true
rmdir($file_path."/12345");
@@ -45,9 +45,9 @@ echo "Done\n";
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-unlink($file_path."/rename_variation_link.tmp");
-unlink($file_path."/rename_variation.tmp");
-rmdir($file_path."/rename_variation_dir");
+unlink($file_path."/rename_variation2_link.tmp");
+unlink($file_path."/rename_variation2.tmp");
+rmdir($file_path."/rename_variation2_dir");
?>
--EXPECTF--
*** Testing rename() by renaming a file and directory to numeric name ***
diff --git a/ext/standard/tests/file/rename_variation2.phpt b/ext/standard/tests/file/rename_variation2.phpt
index fa3ee1e017..1e0a5d9edd 100644
--- a/ext/standard/tests/file/rename_variation2.phpt
+++ b/ext/standard/tests/file/rename_variation2.phpt
@@ -11,7 +11,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
$file_path = dirname(__FILE__);
-$dest_dir = "$file_path/rename_variation_dir";
+$dest_dir = "$file_path/rename_variation2_dir";
// create the $dest_dir
mkdir($dest_dir);
@@ -23,11 +23,11 @@ $filename = $file_path."/rename_variation2.tmp";
var_dump(touch($filename));
// create the soft links to the file
-$linkname = $file_path."/rename_variation_soft_link1.tmp";
+$linkname = $file_path."/rename_variation2_soft_link1.tmp";
var_dump(symlink($filename, $linkname));
//rename the link to a new name in the same dir
-$dest_linkname = $file_path."/rename_variation_soft_link2.tmp";
+$dest_linkname = $file_path."/rename_variation2_soft_link2.tmp";
var_dump( rename( $linkname, $dest_linkname) );
//ensure that link was renamed
clearstatcache();
@@ -35,14 +35,14 @@ var_dump( file_exists($linkname) ); // expecting false
var_dump( file_exists($dest_linkname) ); // expecting true
// rename a link across dir
-var_dump( rename($dest_linkname, $dest_dir."/rename_variation_soft_link2.tmp"));
+var_dump( rename($dest_linkname, $dest_dir."/rename_variation2_soft_link2.tmp"));
//ensure that link got renamed
clearstatcache();
var_dump( file_exists($dest_linkname) ); // expecting false
-var_dump( file_exists($dest_dir."/rename_variation_soft_link2.tmp") ); // expecting true
+var_dump( file_exists($dest_dir."/rename_variation2_soft_link2.tmp") ); // expecting true
// delete the link file now
-unlink($dest_dir."/rename_variation_soft_link2.tmp");
+unlink($dest_dir."/rename_variation2_soft_link2.tmp");
echo "Done\n";
?>
@@ -50,7 +50,7 @@ echo "Done\n";
<?php
$file_path = dirname(__FILE__);
unlink($file_path."/rename_variation2.tmp");
-rmdir($file_path."/rename_variation_dir");
+rmdir($file_path."/rename_variation2_dir");
?>
--EXPECTF--
*** Testing rename() on soft links ***
diff --git a/ext/standard/tests/file/rename_variation3.phpt b/ext/standard/tests/file/rename_variation3.phpt
index ce8921630b..7c47040729 100644
--- a/ext/standard/tests/file/rename_variation3.phpt
+++ b/ext/standard/tests/file/rename_variation3.phpt
@@ -11,41 +11,41 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
$file_path = dirname(__FILE__);
-$dest_dir = "$file_path/rename_variation_dir";
+$dest_dir = "$file_path/rename_variation3_dir";
// create the $dest_dir
mkdir($dest_dir);
echo "\n*** Testing rename() on hard links ***\n";
-$filename = $file_path."/rename_variation1.tmp";
+$filename = $file_path."/rename_variation31.tmp";
@unlink($filename);
var_dump(touch($filename));
-$linkname = $file_path."/rename_variation_hard_link1.tmp";
+$linkname = $file_path."/rename_variation3_hard_link1.tmp";
var_dump(link($filename, $linkname));
//rename the link to a new name in the same dir
-$dest_linkname = $file_path."/rename_variation_hard_link2.tmp";
+$dest_linkname = $file_path."/rename_variation3_hard_link2.tmp";
var_dump( rename( $filename, $dest_linkname) );
//ensure that link was renamed
var_dump( file_exists($filename) ); // expecting false
var_dump( file_exists($dest_linkname) ); // expecting true
// rename a hard link across dir
-var_dump( rename($dest_linkname, $dest_dir."/rename_variation_hard_link2.tmp") );
+var_dump( rename($dest_linkname, $dest_dir."/rename_variation3_hard_link2.tmp") );
//ensure that link got renamed
var_dump( file_exists($dest_linkname) ); // expecting false
-var_dump( file_exists($dest_dir."/rename_variation_hard_link2.tmp") ); // expecting true
+var_dump( file_exists($dest_dir."/rename_variation3_hard_link2.tmp") ); // expecting true
// delete the link file now
-unlink($dest_dir."/rename_variation_hard_link2.tmp");
+unlink($dest_dir."/rename_variation3_hard_link2.tmp");
echo "Done\n";
?>
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-unlink($file_path."/rename_variation_hard_link1.tmp");
-rmdir($file_path."/rename_variation_dir");
+unlink($file_path."/rename_variation3_hard_link1.tmp");
+rmdir($file_path."/rename_variation3_dir");
?>
--EXPECTF--
*** Testing rename() on hard links ***
diff --git a/ext/standard/tests/file/rename_variation4.phpt b/ext/standard/tests/file/rename_variation4.phpt
index 2965f7534a..69753bc322 100644
--- a/ext/standard/tests/file/rename_variation4.phpt
+++ b/ext/standard/tests/file/rename_variation4.phpt
@@ -15,22 +15,22 @@ require dirname(__FILE__).'/file.inc';
/* Renaming a file, link and directory to numeric name */
echo "\n*** Testing rename() by renaming a file, link and directory to numeric name ***\n";
-$fp = fopen($file_path."/rename_variation.tmp", "w");
+$fp = fopen($file_path."/rename_variation4.tmp", "w");
fclose($fp);
// renaming existing file to numeric name
-var_dump( rename($file_path."/rename_variation.tmp", $file_path."/12345") );
+var_dump( rename($file_path."/rename_variation4.tmp", $file_path."/12345") );
// ensure that rename worked fine
-var_dump( file_exists($file_path."/rename_variation.tmp" ) ); // expecting false
+var_dump( file_exists($file_path."/rename_variation4.tmp" ) ); // expecting false
var_dump( file_exists($file_path."/12345" ) ); // expecting true
// remove the file
unlink($file_path."/12345");
-mkdir($file_path."/rename_variation_dir");
+mkdir($file_path."/rename_variation4_dir");
// renaming a directory to numeric name
-var_dump( rename($file_path."/rename_variation_dir/", $file_path."/12345") );
+var_dump( rename($file_path."/rename_variation4_dir/", $file_path."/12345") );
// ensure that rename worked fine
-var_dump( file_exists($file_path."/rename_variation_dir" ) ); // expecting false
+var_dump( file_exists($file_path."/rename_variation4_dir" ) ); // expecting false
var_dump( file_exists($file_path."/12345" ) ); // expecting true
echo "Done\n";
diff --git a/ext/standard/tests/file/rename_variation5.phpt b/ext/standard/tests/file/rename_variation5.phpt
index bf43e49510..2518cf48ea 100644
--- a/ext/standard/tests/file/rename_variation5.phpt
+++ b/ext/standard/tests/file/rename_variation5.phpt
@@ -13,14 +13,14 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
and one another */
// create a dir
$file_path = dirname(__FILE__);
-$dirname = "$file_path/rename_variation_dir";
+$dirname = "$file_path/rename_variation5_dir";
mkdir($dirname);
//create a file
-$filename = "$file_path/rename_variation.tmp";
+$filename = "$file_path/rename_variation5.tmp";
$fp = fopen($filename, "w");
fclose($fp);
// create a link
-$linkname = "$file_path/rename_variation_link.tmp";
+$linkname = "$file_path/rename_variation5_link.tmp";
symlink($filename, $linkname);
echo "\n-- Renaming link to same link name --\n";
@@ -54,9 +54,9 @@ echo "Done\n";
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-unlink($file_path."/rename_variation_link.tmp");
-unlink($file_path."/rename_variation.tmp");
-rmdir($file_path."/rename_variation_dir");
+unlink($file_path."/rename_variation5_link.tmp");
+unlink($file_path."/rename_variation5.tmp");
+rmdir($file_path."/rename_variation5_dir");
?>
--EXPECTF--
-- Renaming link to same link name --
diff --git a/ext/standard/tests/general_functions/parse_ini_string_003.phpt b/ext/standard/tests/general_functions/parse_ini_string_003.phpt
new file mode 100644
index 0000000000..570570dbfe
--- /dev/null
+++ b/ext/standard/tests/general_functions/parse_ini_string_003.phpt
@@ -0,0 +1,40 @@
+--TEST--
+parse_ini_string() typed scanner mode
+--FILE--
+<?php
+
+$contents = <<<EOS
+foo = 1
+bar = 1.3
+baz = null
+qux[] = false
+qux[] = off
+qux[] = something
+qux[] = "something else"
+EOS;
+
+var_dump(parse_ini_string($contents, false, INI_SCANNER_TYPED));
+
+?>
+Done
+--EXPECTF--
+array(4) {
+ ["foo"]=>
+ int(1)
+ ["bar"]=>
+ float(1.3)
+ ["baz"]=>
+ NULL
+ ["qux"]=>
+ array(4) {
+ [0]=>
+ bool(false)
+ [1]=>
+ bool(false)
+ [2]=>
+ string(9) "something"
+ [3]=>
+ string(14) "something else"
+ }
+}
+Done
diff --git a/ext/standard/tests/http/bug65634.phpt b/ext/standard/tests/http/bug65634.phpt
new file mode 100644
index 0000000000..8f358cc6cf
--- /dev/null
+++ b/ext/standard/tests/http/bug65634.phpt
@@ -0,0 +1,81 @@
+--TEST--
+Bug #65634 (HTTP wrapper is very slow with protocol_version 1.1)
+--INI--
+allow_url_fopen=1
+--SKIPIF--
+<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
+--FILE--
+<?php
+require 'server.inc';
+
+function do_test($version, $connection) {
+ $options = [
+ 'http' => [
+ 'protocol_version' => $version,
+ ],
+ ];
+
+ if ($connection) {
+ $options['http']['header'] = "Connection: $connection";
+ }
+
+ $ctx = stream_context_create($options);
+
+ $responses = ["data://text/plain,HTTP/$version 204 No Content\r\n\r\n"];
+ $pid = http_server('tcp://127.0.0.1:12342', $responses, $output);
+
+ $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $ctx);
+ fseek($output, 0, SEEK_SET);
+ echo stream_get_contents($output);
+
+ http_server_kill($pid);
+}
+
+echo "HTTP/1.0, default behaviour:\n";
+do_test('1.0', null);
+
+echo "HTTP/1.0, connection: close:\n";
+do_test('1.0', 'close');
+
+echo "HTTP/1.0, connection: keep-alive:\n";
+do_test('1.0', 'keep-alive');
+
+echo "HTTP/1.1, default behaviour:\n";
+do_test('1.1', null);
+
+echo "HTTP/1.1, connection: close:\n";
+do_test('1.1', 'close');
+
+echo "HTTP/1.1, connection: keep-alive:\n";
+do_test('1.1', 'keep-alive');
+?>
+--EXPECT--
+HTTP/1.0, default behaviour:
+GET / HTTP/1.0
+Host: 127.0.0.1:12342
+
+HTTP/1.0, connection: close:
+GET / HTTP/1.0
+Host: 127.0.0.1:12342
+Connection: close
+
+HTTP/1.0, connection: keep-alive:
+GET / HTTP/1.0
+Host: 127.0.0.1:12342
+Connection: keep-alive
+
+HTTP/1.1, default behaviour:
+GET / HTTP/1.1
+Host: 127.0.0.1:12342
+Connection: close
+
+HTTP/1.1, connection: close:
+GET / HTTP/1.1
+Host: 127.0.0.1:12342
+Connection: close
+
+HTTP/1.1, connection: keep-alive:
+GET / HTTP/1.1
+Host: 127.0.0.1:12342
+Connection: keep-alive
+
diff --git a/ext/standard/tests/math/bug45712.phpt b/ext/standard/tests/math/bug45712.phpt
index e10d0e7ec3..2aa4386587 100644
--- a/ext/standard/tests/math/bug45712.phpt
+++ b/ext/standard/tests/math/bug45712.phpt
@@ -1,7 +1,5 @@
--TEST--
Bug #45712 (NaN/INF comparison)
---XFAIL--
-Bug 45712 not fixed yet.
--FILE--
<?php
@@ -66,7 +64,7 @@ bool(false)
bool(false)
bool(false)
bool(false)
-bool(false)
+bool(true)
bool(false)
bool(false)
bool(false)
diff --git a/ext/standard/tests/math/pow-operator.phpt b/ext/standard/tests/math/pow-operator.phpt
new file mode 100644
index 0000000000..f80cae1962
--- /dev/null
+++ b/ext/standard/tests/math/pow-operator.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Various pow() tests
+--FILE--
+<?php // $Id$
+
+$x = 2;
+$x **= 3;
+
+$tests = <<<TESTS
+ -3 ** 2 === -9
+ (-3) **2 === 9
+ 2 ** 3 ** 2 === 512
+ (2 ** 3) ** 2 === 64
+ $x === 8
+TESTS;
+
+ echo "On failure, please mail result to php-dev@lists.php.net\n";
+ include(dirname(__FILE__) . '/../../../../tests/quicktester.inc');
+
+--EXPECT--
+On failure, please mail result to php-dev@lists.php.net
+OK
diff --git a/ext/standard/tests/math/pow_variation1.phpt b/ext/standard/tests/math/pow_variation1.phpt
index df511906b0..5576e5b493 100644
--- a/ext/standard/tests/math/pow_variation1.phpt
+++ b/ext/standard/tests/math/pow_variation1.phpt
@@ -149,7 +149,7 @@ int(0)
int(0)
-- Iteration 19 --
-float(0)
+int(0)
-- Iteration 20 --
int(0)
diff --git a/ext/standard/tests/math/pow_variation1_64bit.phpt b/ext/standard/tests/math/pow_variation1_64bit.phpt
index 24b482680b..e1986ba858 100644
--- a/ext/standard/tests/math/pow_variation1_64bit.phpt
+++ b/ext/standard/tests/math/pow_variation1_64bit.phpt
@@ -149,7 +149,7 @@ int(0)
int(0)
-- Iteration 19 --
-float(0)
+int(0)
-- Iteration 20 --
int(0)
@@ -173,4 +173,4 @@ int(0)
-- Iteration 26 --
%s
-===Done=== \ No newline at end of file
+===Done===
diff --git a/ext/standard/tests/math/pow_variation2.phpt b/ext/standard/tests/math/pow_variation2.phpt
index b1800bb15f..f571936727 100644
--- a/ext/standard/tests/math/pow_variation2.phpt
+++ b/ext/standard/tests/math/pow_variation2.phpt
@@ -145,7 +145,7 @@ float(1)
float(1)
-- Iteration 19 --
-float(1)
+int(1)
-- Iteration 20 --
float(1)
@@ -169,4 +169,4 @@ float(1)
-- Iteration 26 --
%s
-===Done=== \ No newline at end of file
+===Done===
diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt
index 07d47bd8c7..2df270154d 100644
--- a/ext/standard/tests/serialize/005.phpt
+++ b/ext/standard/tests/serialize/005.phpt
@@ -156,9 +156,11 @@ object(TestNAOld)#%d (0) {
}
===NANew===
unserializer(TestNANew)
-TestNew::__wakeup()
-object(TestNANew)#1 (0) {
-}
+
+Warning: Erroneous data format for unserializing 'TestNANew' in %s005.php on line %d
+
+Notice: unserialize(): Error at offset 19 of 20 bytes in %s005.php on line %d
+bool(false)
===NANew2===
unserializer(TestNANew2)
TestNew::unserialize()
diff --git a/ext/standard/tests/serialize/bug67072_2.phpt b/ext/standard/tests/serialize/bug67072_2.phpt
deleted file mode 100644
index 09eadb9ee1..0000000000
--- a/ext/standard/tests/serialize/bug67072_2.phpt
+++ /dev/null
@@ -1,84 +0,0 @@
---TEST--
-Bug #67072 Echoing unserialized "SplFileObject" crash - BC break fixes
---FILE--
-<?php
-class MySplFileObject extends SplFileObject {}
-class MyArrayObject extends ArrayObject{ var $a = 1; }
-echo unserialize('O:15:"MySplFileObject":1:{s:9:"*filename";s:15:"/home/flag/flag";}');
-
-function testClass($className)
-{
- // simulate phpunit
- $object = unserialize(sprintf('O:%d:"%s":0:{}', strlen($className), $className));
- return $object;
-}
-
-class MyClass {}
-class MyClassSer implements Serializable {
- function serialize() { return "";}
- function unserialize($data) { }
-}
-class MyClassSer2 extends MyClassSer {
-}
-
-$classes = array('stdClass', 'MyClass', 'MyClassSer', 'MyClassSer2', 'SplFileObject', 'MySplFileObject',
- 'SplObjectStorage', 'FooBar', 'Closure', 'ArrayObject', 'MyArrayObject',
- 'Directory'
- );
-foreach($classes as $cl) {
- var_dump(testClass($cl));
-}
-
-?>
-===DONE==
---EXPECTF--
-Warning: Erroneous data format for unserializing 'MySplFileObject' in %s on line 4
-
-Notice: unserialize(): Error at offset 26 of 66 bytes in %s on line 4
-object(stdClass)#%d (0) {
-}
-object(MyClass)#%d (0) {
-}
-object(MyClassSer)#%d (0) {
-}
-object(MyClassSer2)#%d (0) {
-}
-
-Warning: Erroneous data format for unserializing 'SplFileObject' in %s on line 9
-
-Notice: unserialize(): Error at offset 24 of 25 bytes in %s on line 9
-bool(false)
-
-Warning: Erroneous data format for unserializing 'MySplFileObject' in %s on line 9
-
-Notice: unserialize(): Error at offset 26 of 27 bytes in %s on line 9
-bool(false)
-object(SplObjectStorage)#%d (1) {
- ["storage":"SplObjectStorage":private]=>
- array(0) {
- }
-}
-object(__PHP_Incomplete_Class)#%d (1) {
- ["__PHP_Incomplete_Class_Name"]=>
- string(6) "FooBar"
-}
-
-Warning: Erroneous data format for unserializing 'Closure' in %s on line 9
-
-Notice: unserialize(): Error at offset 17 of 18 bytes in %s on line 9
-bool(false)
-object(ArrayObject)#%d (1) {
- ["storage":"ArrayObject":private]=>
- array(0) {
- }
-}
-object(MyArrayObject)#1 (2) {
- ["a"]=>
- int(1)
- ["storage":"ArrayObject":private]=>
- array(0) {
- }
-}
-object(Directory)#1 (0) {
-}
-===DONE==
diff --git a/ext/standard/tests/streams/stream_get_meta_data_socket_basic.phpt b/ext/standard/tests/streams/stream_get_meta_data_socket_basic.phpt
index 86056114b8..86c9cd77c8 100644
--- a/ext/standard/tests/streams/stream_get_meta_data_socket_basic.phpt
+++ b/ext/standard/tests/streams/stream_get_meta_data_socket_basic.phpt
@@ -3,7 +3,7 @@ stream_get_meta_data() on a udp socket
--FILE--
<?php
-$tcp_socket = stream_socket_server('tcp://127.0.0.1:31337');
+$tcp_socket = stream_socket_server('tcp://127.0.0.1:31330');
var_dump(stream_get_meta_data($tcp_socket));
fclose($tcp_socket);
diff --git a/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt b/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt
index 16b38d9a1b..88d354b378 100644
--- a/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt
+++ b/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt
@@ -4,10 +4,10 @@ Testing stream_get_meta_data() "unread_bytes" field on a udp socket
<?php
/* Setup socket server */
-$server = stream_socket_server('tcp://127.0.0.1:31337');
+$server = stream_socket_server('tcp://127.0.0.1:31331');
/* Connect to it */
-$client = fsockopen('tcp://127.0.0.1:31337');
+$client = fsockopen('tcp://127.0.0.1:31331');
if (!$client) {
die("Unable to create socket");
}
diff --git a/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt b/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt
index d30fec7056..e8e39209c9 100644
--- a/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt
+++ b/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt
@@ -4,10 +4,10 @@ Testing stream_get_meta_data() "timed_out" field on a udp socket
<?php
/* Setup socket server */
-$server = stream_socket_server('tcp://127.0.0.1:31337');
+$server = stream_socket_server('tcp://127.0.0.1:31332');
/* Connect to it */
-$client = fsockopen('tcp://127.0.0.1:31337');
+$client = fsockopen('tcp://127.0.0.1:31332');
if (!$client) {
die("Unable to create socket");
}
diff --git a/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt b/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt
index 0b079ccf7c..5b68eba25d 100644
--- a/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt
+++ b/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt
@@ -4,10 +4,10 @@ Testing stream_get_meta_data() "blocked" field on a udp socket
<?php
/* Setup socket server */
-$server = stream_socket_server('tcp://127.0.0.1:31337');
+$server = stream_socket_server('tcp://127.0.0.1:31333');
/* Connect to it */
-$client = fsockopen('tcp://127.0.0.1:31337');
+$client = fsockopen('tcp://127.0.0.1:31333');
if (!$client) {
die("Unable to create socket");
}
diff --git a/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt b/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt
index f9ef747987..e3f59d10dc 100644
--- a/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt
+++ b/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt
@@ -4,10 +4,10 @@ Testing stream_get_meta_data() "eof" field on a udp socket
<?php
/* Setup socket server */
-$server = stream_socket_server('tcp://127.0.0.1:31337');
+$server = stream_socket_server('tcp://127.0.0.1:31334');
/* Connect to it */
-$client = fsockopen('tcp://127.0.0.1:31337');
+$client = fsockopen('tcp://127.0.0.1:31334');
if (!$client) {
die("Unable to create socket");
}
diff --git a/ext/standard/tests/strings/addcslashes_005.phpt b/ext/standard/tests/strings/addcslashes_005.phpt
new file mode 100644
index 0000000000..f0b2fbcecb
--- /dev/null
+++ b/ext/standard/tests/strings/addcslashes_005.phpt
@@ -0,0 +1,12 @@
+--TEST--
+addcslashes(); function test with warning
+--CREDITS--
+ marcosptf - <marcosptf@yahoo.com.br>
+#phptestfest PHPSP on Google - Sao Paulo - Brazil - 2014-06-05
+--FILE--
+<?php
+echo addcslashes("zoo['.']","z..A");
+?>
+--EXPECTF--
+Warning: addcslashes(): Invalid '..'-range, '..'-range needs to be incrementing in %s on line %d
+\zoo['\.']
diff --git a/ext/standard/tests/strings/bin2hex_001.phpt b/ext/standard/tests/strings/bin2hex_001.phpt
new file mode 100644
index 0000000000..e73500a30e
--- /dev/null
+++ b/ext/standard/tests/strings/bin2hex_001.phpt
@@ -0,0 +1,11 @@
+--TEST--
+bin2hex(); function test
+--CREDITS--
+marcosptf - <marcosptf@yahoo.com.br>
+#phptestfest PHPSP on Google - Sao Paulo - Brazil - 2014-06-05
+--FILE--
+<?php
+echo bin2hex("123456");
+?>
+--EXPECT--
+313233343536
diff --git a/ext/standard/tests/strings/crypt.phpt b/ext/standard/tests/strings/crypt.phpt
index ce178f684e..3dcff2eaf2 100644
--- a/ext/standard/tests/strings/crypt.phpt
+++ b/ext/standard/tests/strings/crypt.phpt
@@ -34,6 +34,8 @@ STD
EXT
MD5
BLO
+
+Notice: crypt(): No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash. in %s on line %d
string(%d) "%s"
Warning: crypt() expects at least 1 parameter, 0 given in %s on line %d
diff --git a/ext/standard/tests/strings/default_charset.phpt b/ext/standard/tests/strings/default_charset.phpt
new file mode 100644
index 0000000000..3665132413
--- /dev/null
+++ b/ext/standard/tests/strings/default_charset.phpt
@@ -0,0 +1,104 @@
+--TEST--
+default_charset and htmlentities/htmlspecialchars/html_entity_decode
+--INI--
+default_charset=UTF-8
+internal_encoding=
+input_encoding=
+output_encoding=
+--FILE--
+<?php
+echo "*** Default php.ini value ***\n";
+var_dump(ini_get('default_charset'),
+ ini_get('internal_encoding'),
+ ini_get('input_encoding'),
+ ini_get('output_encoding')
+ );
+
+
+echo "*** Runtime change of default_charset ***\n";
+var_dump(ini_set('default_charset', 'cp1252'));
+
+echo "*** Test with updated default_charset ***\n";
+var_dump(ini_get('default_charset'),
+ ini_get('internal_encoding'),
+ ini_get('input_encoding'),
+ ini_get('output_encoding')
+ );
+
+var_dump(htmlentities("\xA3", ENT_HTML5));
+var_dump(htmlentities("\xA3", ENT_HTML5, 'cp1252'));
+
+var_dump(bin2hex(html_entity_decode("&pound;", ENT_HTML5)));
+var_dump(bin2hex(html_entity_decode("&pound;", ENT_HTML5, 'cp1252')));
+
+// Set internal_encoding to empty and try again
+echo "*** Change internal_encoding to empty ***\n";
+var_dump(ini_set('internal_encoding', ''));
+var_dump(ini_get('default_charset'),
+ ini_get('internal_encoding'),
+ ini_get('input_encoding'),
+ ini_get('output_encoding')
+ );
+
+var_dump(htmlentities("\xA3", ENT_HTML5));
+var_dump(htmlentities("\xA3", ENT_HTML5, 'cp1252'));
+var_dump(bin2hex(html_entity_decode("&pound;", ENT_HTML5)));
+var_dump(bin2hex(html_entity_decode("&pound;", ENT_HTML5, 'cp1252')));
+
+echo "*** Update input/output_encoding ***\n";
+var_dump(ini_set('input_encoding', 'ISO-8859-1'));
+var_dump(ini_set('output_encoding', 'ISO-8859-1'));
+var_dump(ini_get('default_charset'),
+ ini_get('internal_encoding'),
+ ini_get('input_encoding'),
+ ini_get('output_encoding')
+ );
+
+// Should not be affected
+var_dump(htmlentities("\xA3", ENT_HTML5));
+var_dump(htmlentities("\xA3", ENT_HTML5, 'cp1252'));
+var_dump(bin2hex(html_entity_decode("&pound;", ENT_HTML5)));
+var_dump(bin2hex(html_entity_decode("&pound;", ENT_HTML5, 'cp1252')));
+
+echo "Done\n";
+
+?>
+--EXPECT--
+*** Default php.ini value ***
+string(5) "UTF-8"
+string(0) ""
+string(0) ""
+string(0) ""
+*** Runtime change of default_charset ***
+string(5) "UTF-8"
+*** Test with updated default_charset ***
+string(6) "cp1252"
+string(0) ""
+string(0) ""
+string(0) ""
+string(7) "&pound;"
+string(7) "&pound;"
+string(2) "a3"
+string(2) "a3"
+*** Change internal_encoding to empty ***
+string(0) ""
+string(6) "cp1252"
+string(0) ""
+string(0) ""
+string(0) ""
+string(7) "&pound;"
+string(7) "&pound;"
+string(2) "a3"
+string(2) "a3"
+*** Update input/output_encoding ***
+string(0) ""
+string(0) ""
+string(6) "cp1252"
+string(0) ""
+string(10) "ISO-8859-1"
+string(10) "ISO-8859-1"
+string(7) "&pound;"
+string(7) "&pound;"
+string(2) "a3"
+string(2) "a3"
+Done
diff --git a/ext/standard/tests/strings/pack64.phpt b/ext/standard/tests/strings/pack64.phpt
new file mode 100644
index 0000000000..9bc24928fe
--- /dev/null
+++ b/ext/standard/tests/strings/pack64.phpt
@@ -0,0 +1,115 @@
+--TEST--
+64bit pack()/unpack() tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE < 8) {
+ die("skip 64bit test only");
+}
+?>
+--FILE--
+<?php
+print_r(unpack("Q", pack("Q", 0xfffffffffffe)));
+print_r(unpack("Q", pack("Q", 0)));
+print_r(unpack("Q", pack("Q", 0x8000000000000002)));
+print_r(unpack("Q", pack("Q", -1)));
+print_r(unpack("Q", pack("Q", 0x8000000000000000)));
+
+print_r(unpack("J", pack("J", 0xfffffffffffe)));
+print_r(unpack("J", pack("J", 0)));
+print_r(unpack("J", pack("J", 0x8000000000000002)));
+print_r(unpack("J", pack("J", -1)));
+print_r(unpack("J", pack("J", 0x8000000000000000)));
+
+print_r(unpack("P", pack("P", 0xfffffffffffe)));
+print_r(unpack("P", pack("P", 0)));
+print_r(unpack("P", pack("P", 0x8000000000000002)));
+print_r(unpack("P", pack("P", -1)));
+print_r(unpack("P", pack("P", 0x8000000000000000)));
+
+print_r(unpack("q", pack("q", 0xfffffffffffe)));
+print_r(unpack("q", pack("q", 0)));
+print_r(unpack("q", pack("q", 0x8000000000000002)));
+print_r(unpack("q", pack("q", -1)));
+print_r(unpack("q", pack("q", 0x8000000000000000)));
+?>
+--EXPECTF--
+Array
+(
+ [1] => 281474976710654
+)
+Array
+(
+ [1] => 0
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => -1
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => 281474976710654
+)
+Array
+(
+ [1] => 0
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => -1
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => 281474976710654
+)
+Array
+(
+ [1] => 0
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => -1
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => 281474976710654
+)
+Array
+(
+ [1] => 0
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => -1
+)
+Array
+(
+ [1] => -9223372036854775808
+)
diff --git a/ext/standard/tests/strings/pack64_32.phpt b/ext/standard/tests/strings/pack64_32.phpt
new file mode 100644
index 0000000000..f52de63ca4
--- /dev/null
+++ b/ext/standard/tests/strings/pack64_32.phpt
@@ -0,0 +1,44 @@
+--TEST--
+64bit pack()/unpack() tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE > 4) {
+ die("skip 32bit test only");
+}
+?>
+--FILE--
+<?php
+var_dump(pack("Q", 0));
+var_dump(pack("J", 0));
+var_dump(pack("P", 0));
+var_dump(pack("q", 0));
+
+var_dump(unpack("Q", ''));
+var_dump(unpack("J", ''));
+var_dump(unpack("P", ''));
+var_dump(unpack("q", ''));
+?>
+--EXPECTF--
+Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt
index 038ba58c5e..5ebdfe8d50 100644
--- a/ext/standard/tests/strings/setlocale_variation2.phpt
+++ b/ext/standard/tests/strings/setlocale_variation2.phpt
@@ -18,8 +18,11 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
/* setlocale() to set all available locales in the system and check the success count */
echo "*** Testing setlocale() : usage variations ***\n";
-function good_locale($locale) {
- return $locale !== 'tt_RU@iqtelif.UTF-8';
+function good_locale($locale) {
+ /**
+ * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/971416
+ **/
+ return $locale !== 'tt_RU@iqtelif.UTF-8' && $locale !== 'no_NO.ISO-8859-1';
}
/* Prototype : array list_system_locales( void )
diff --git a/ext/standard/tests/strings/sprintf_variation34.phpt b/ext/standard/tests/strings/sprintf_variation34.phpt
index c6186b6780..8a5cd809d6 100644
--- a/ext/standard/tests/strings/sprintf_variation34.phpt
+++ b/ext/standard/tests/strings/sprintf_variation34.phpt
@@ -29,8 +29,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation40_64bit.phpt b/ext/standard/tests/strings/sprintf_variation40_64bit.phpt
index da6f37ace4..029e94c782 100644
--- a/ext/standard/tests/strings/sprintf_variation40_64bit.phpt
+++ b/ext/standard/tests/strings/sprintf_variation40_64bit.phpt
@@ -25,8 +25,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/var.c b/ext/standard/var.c
index d05f05527c..457f31db33 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -453,7 +453,7 @@ PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC)
break;
case IS_ARRAY:
myht = Z_ARRVAL_PP(struc);
- if(myht && myht->nApplyCount > 0){
+ if (myht->nApplyCount > 0){
smart_str_appendl(buf, "NULL", 4);
zend_error(E_WARNING, "var_export does not handle circular references");
return;
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index f6f31bd3e7..88ba7e5fb8 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -23,7 +23,6 @@
#include "php.h"
#include "ext/standard/php_var.h"
#include "php_incomplete_class.h"
-#include "Zend/zend_interfaces.h"
/* {{{ reference-handling for unserializer: var_* */
#define VAR_ENTRIES_MAX 1024
@@ -233,7 +232,7 @@ static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen
#define YYMARKER marker
-#line 241 "ext/standard/var_unserializer.re"
+#line 240 "ext/standard/var_unserializer.re"
@@ -403,11 +402,7 @@ static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
(*p) += 2;
- /* The internal class check here is a BC fix only, userspace classes implementing the
- Serializable interface have eventually an inconsistent behavior at this place when
- unserialized from a manipulated string. Additionaly the interal classes can possibly
- crash PHP so they're still disabled here. */
- if (ce->serialize == NULL || ce->unserialize == zend_user_unserialize || (ZEND_INTERNAL_CLASS != ce->type && ce->create_object == NULL)) {
+ if (ce->serialize == NULL) {
object_init_ex(*rval, ce);
} else {
/* If this class implements Serializable, it should not land here but in object_custom(). The passed string
@@ -480,7 +475,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
-#line 484 "ext/standard/var_unserializer.c"
+#line 479 "ext/standard/var_unserializer.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -540,9 +535,9 @@ yy2:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy95;
yy3:
-#line 835 "ext/standard/var_unserializer.re"
+#line 830 "ext/standard/var_unserializer.re"
{ return 0; }
-#line 546 "ext/standard/var_unserializer.c"
+#line 541 "ext/standard/var_unserializer.c"
yy4:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy89;
@@ -585,13 +580,13 @@ yy13:
goto yy3;
yy14:
++YYCURSOR;
-#line 829 "ext/standard/var_unserializer.re"
+#line 824 "ext/standard/var_unserializer.re"
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
-#line 595 "ext/standard/var_unserializer.c"
+#line 590 "ext/standard/var_unserializer.c"
yy16:
yych = *++YYCURSOR;
goto yy3;
@@ -621,7 +616,7 @@ yy20:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 683 "ext/standard/var_unserializer.re"
+#line 678 "ext/standard/var_unserializer.re"
{
size_t len, len2, len3, maxlen;
long elements;
@@ -767,7 +762,7 @@ yy20:
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 771 "ext/standard/var_unserializer.c"
+#line 766 "ext/standard/var_unserializer.c"
yy25:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -792,7 +787,7 @@ yy27:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 675 "ext/standard/var_unserializer.re"
+#line 670 "ext/standard/var_unserializer.re"
{
INIT_PZVAL(*rval);
@@ -800,7 +795,7 @@ yy27:
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
-#line 804 "ext/standard/var_unserializer.c"
+#line 799 "ext/standard/var_unserializer.c"
yy32:
yych = *++YYCURSOR;
if (yych == '+') goto yy33;
@@ -821,7 +816,7 @@ yy34:
yych = *++YYCURSOR;
if (yych != '{') goto yy18;
++YYCURSOR;
-#line 655 "ext/standard/var_unserializer.re"
+#line 650 "ext/standard/var_unserializer.re"
{
long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -841,7 +836,7 @@ yy34:
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 845 "ext/standard/var_unserializer.c"
+#line 840 "ext/standard/var_unserializer.c"
yy39:
yych = *++YYCURSOR;
if (yych == '+') goto yy40;
@@ -862,7 +857,7 @@ yy41:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 626 "ext/standard/var_unserializer.re"
+#line 621 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -891,7 +886,7 @@ yy41:
ZVAL_STRINGL(*rval, str, len, 0);
return 1;
}
-#line 895 "ext/standard/var_unserializer.c"
+#line 890 "ext/standard/var_unserializer.c"
yy46:
yych = *++YYCURSOR;
if (yych == '+') goto yy47;
@@ -912,7 +907,7 @@ yy48:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 598 "ext/standard/var_unserializer.re"
+#line 593 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -940,7 +935,7 @@ yy48:
ZVAL_STRINGL(*rval, str, len, 1);
return 1;
}
-#line 944 "ext/standard/var_unserializer.c"
+#line 939 "ext/standard/var_unserializer.c"
yy53:
yych = *++YYCURSOR;
if (yych <= '/') {
@@ -1028,7 +1023,7 @@ yy61:
}
yy63:
++YYCURSOR;
-#line 588 "ext/standard/var_unserializer.re"
+#line 583 "ext/standard/var_unserializer.re"
{
#if SIZEOF_LONG == 4
use_double:
@@ -1038,7 +1033,7 @@ use_double:
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
-#line 1042 "ext/standard/var_unserializer.c"
+#line 1037 "ext/standard/var_unserializer.c"
yy65:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1097,7 +1092,7 @@ yy73:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 573 "ext/standard/var_unserializer.re"
+#line 568 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -1112,7 +1107,7 @@ yy73:
return 1;
}
-#line 1116 "ext/standard/var_unserializer.c"
+#line 1111 "ext/standard/var_unserializer.c"
yy76:
yych = *++YYCURSOR;
if (yych == 'N') goto yy73;
@@ -1139,7 +1134,7 @@ yy79:
if (yych <= '9') goto yy79;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 546 "ext/standard/var_unserializer.re"
+#line 541 "ext/standard/var_unserializer.re"
{
#if SIZEOF_LONG == 4
int digits = YYCURSOR - start - 3;
@@ -1166,7 +1161,7 @@ yy79:
ZVAL_LONG(*rval, parse_iv(start + 2));
return 1;
}
-#line 1170 "ext/standard/var_unserializer.c"
+#line 1165 "ext/standard/var_unserializer.c"
yy83:
yych = *++YYCURSOR;
if (yych <= '/') goto yy18;
@@ -1174,24 +1169,24 @@ yy83:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 539 "ext/standard/var_unserializer.re"
+#line 534 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_BOOL(*rval, parse_iv(start + 2));
return 1;
}
-#line 1185 "ext/standard/var_unserializer.c"
+#line 1180 "ext/standard/var_unserializer.c"
yy87:
++YYCURSOR;
-#line 532 "ext/standard/var_unserializer.re"
+#line 527 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_NULL(*rval);
return 1;
}
-#line 1195 "ext/standard/var_unserializer.c"
+#line 1190 "ext/standard/var_unserializer.c"
yy89:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1214,7 +1209,7 @@ yy91:
if (yych <= '9') goto yy91;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 509 "ext/standard/var_unserializer.re"
+#line 504 "ext/standard/var_unserializer.re"
{
long id;
@@ -1237,7 +1232,7 @@ yy91:
return 1;
}
-#line 1241 "ext/standard/var_unserializer.c"
+#line 1236 "ext/standard/var_unserializer.c"
yy95:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1260,7 +1255,7 @@ yy97:
if (yych <= '9') goto yy97;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 488 "ext/standard/var_unserializer.re"
+#line 483 "ext/standard/var_unserializer.re"
{
long id;
@@ -1281,9 +1276,9 @@ yy97:
return 1;
}
-#line 1285 "ext/standard/var_unserializer.c"
+#line 1280 "ext/standard/var_unserializer.c"
}
-#line 837 "ext/standard/var_unserializer.re"
+#line 832 "ext/standard/var_unserializer.re"
return 0;
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 7afef6a95a..5d9d83b677 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -21,7 +21,6 @@
#include "php.h"
#include "ext/standard/php_var.h"
#include "php_incomplete_class.h"
-#include "Zend/zend_interfaces.h"
/* {{{ reference-handling for unserializer: var_* */
#define VAR_ENTRIES_MAX 1024
@@ -407,11 +406,7 @@ static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
(*p) += 2;
- /* The internal class check here is a BC fix only, userspace classes implementing the
- Serializable interface have eventually an inconsistent behavior at this place when
- unserialized from a manipulated string. Additionaly the interal classes can possibly
- crash PHP so they're still disabled here. */
- if (ce->serialize == NULL || ce->unserialize == zend_user_unserialize || (ZEND_INTERNAL_CLASS != ce->type && ce->create_object == NULL)) {
+ if (ce->serialize == NULL) {
object_init_ex(*rval, ce);
} else {
/* If this class implements Serializable, it should not land here but in object_custom(). The passed string