summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend.c4
-rw-r--r--Zend/zend_API.c10
-rw-r--r--Zend/zend_builtin_functions.c23
-rw-r--r--Zend/zend_constants.c18
-rw-r--r--Zend/zend_execute.c6
-rw-r--r--Zend/zend_hash.h19
-rw-r--r--Zend/zend_list.c2
-rw-r--r--Zend/zend_objects_API.c4
-rw-r--r--Zend/zend_operators.c4
-rw-r--r--Zend/zend_vm_def.h5
-rw-r--r--Zend/zend_vm_execute.h27
-rw-r--r--ext/date/php_date.c4
-rw-r--r--ext/libxml/libxml.c2
-rw-r--r--ext/opcache/Optimizer/compact_literals.c2
-rw-r--r--ext/pcre/php_pcre.c2
-rw-r--r--ext/reflection/php_reflection.c13
-rw-r--r--ext/spl/spl_dllist.c4
-rw-r--r--ext/spl/spl_observer.c5
-rw-r--r--ext/standard/array.c7
-rw-r--r--ext/standard/crc32.c4
20 files changed, 80 insertions, 85 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index a722531283..dc0ae2739b 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -133,7 +133,6 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
{
zval *tmp;
zend_string *string_key;
- HashPosition iterator;
ulong num_key;
int i;
@@ -193,7 +192,6 @@ static void print_flat_hash(HashTable *ht TSRMLS_DC) /* {{{ */
{
zval *tmp;
zend_string *string_key;
- HashPosition iterator;
ulong num_key;
int i = 0;
@@ -1029,7 +1027,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
zval params[5];
zval retval;
const char *error_filename;
- uint error_lineno;
+ uint error_lineno = 0;
zval orig_user_error_handler;
zend_bool in_compilation;
zend_class_entry *saved_class_entry;
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 6cf6cb2157..9212527963 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1222,10 +1222,9 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
if (object->ce->default_properties_count) {
zval *prop, tmp;
zend_string *key;
- ulong num_key;
zend_property_info *property_info;
- ZEND_HASH_FOREACH_KEY_VAL(properties, num_key, key, prop) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
ZVAL_STR(&tmp, key);
property_info = zend_get_property_info(object->ce, &tmp, 1 TSRMLS_CC);
if (property_info &&
@@ -1243,10 +1242,9 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties
{
zval *prop, tmp;
zend_string *key;
- ulong num_key;
zend_property_info *property_info;
- ZEND_HASH_FOREACH_KEY_VAL(properties, num_key, key, prop) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
ZVAL_STR(&tmp, key);
property_info = zend_get_property_info(object->ce, &tmp, 1 TSRMLS_CC);
if (property_info &&
@@ -4000,10 +3998,8 @@ ZEND_API zend_string* zend_find_alias_name(zend_class_entry *ce, zend_string *na
ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_function *f) /* {{{ */
{
zend_function *func;
- HashPosition iterator;
HashTable *function_table;
zend_string *name;
- ulong idx;
if (f->common.type != ZEND_USER_FUNCTION ||
*(f->op_array.refcount) < 2 ||
@@ -4013,7 +4009,7 @@ ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_functi
}
function_table = &ce->function_table;
- ZEND_HASH_FOREACH_KEY_PTR(function_table, idx, name, func) {
+ ZEND_HASH_FOREACH_STR_KEY_PTR(function_table, name, func) {
if (func == f) {
if (!name) {
return f->common.function_name;
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 4664532b8f..22076104f0 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -619,13 +619,10 @@ ZEND_FUNCTION(each)
zend_hash_str_update(Z_ARRVAL_P(return_value), "value", sizeof("value")-1, entry);
/* add the key elements */
- switch (zend_hash_get_current_key(target_hash, &key, &num_key, 0)) {
- case HASH_KEY_IS_STRING:
- inserted_pointer = add_get_index_str(return_value, 0, STR_COPY(key));
- break;
- case HASH_KEY_IS_LONG:
- inserted_pointer = add_get_index_long(return_value, 0, num_key);
- break;
+ if (zend_hash_get_current_key(target_hash, &key, &num_key, 0) == HASH_KEY_IS_STRING) {
+ inserted_pointer = add_get_index_str(return_value, 0, STR_COPY(key));
+ } else {
+ inserted_pointer = add_get_index_long(return_value, 0, num_key);
}
zend_hash_str_update(Z_ARRVAL_P(return_value), "key", sizeof("key")-1, inserted_pointer);
if (Z_REFCOUNTED_P(inserted_pointer)) Z_ADDREF_P(inserted_pointer);
@@ -902,9 +899,8 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
zend_property_info *prop_info;
zval *prop, prop_copy;
zend_string *key;
- ulong num_index;
- ZEND_HASH_FOREACH_KEY_PTR(&ce->properties_info, num_index, key, prop_info) {
+ ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) {
if (((prop_info->flags & ZEND_ACC_SHADOW) &&
prop_info->ce != EG(scope)) ||
((prop_info->flags & ZEND_ACC_PROTECTED) &&
@@ -975,7 +971,6 @@ ZEND_FUNCTION(get_object_vars)
zend_string *key;
const char *prop_name, *class_name;
uint prop_len;
- ulong num_index;
zend_object *zobj;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
@@ -996,7 +991,7 @@ ZEND_FUNCTION(get_object_vars)
array_init(return_value);
- ZEND_HASH_FOREACH_KEY_VAL_IND(properties, num_index, key, value) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL_IND(properties, key, value) {
if (key) {
if (zend_check_property_access(zobj, key TSRMLS_CC) == SUCCESS) {
/* Not separating references */
@@ -1030,7 +1025,6 @@ ZEND_FUNCTION(get_class_methods)
zend_class_entry *ce = NULL;
zend_function *mptr;
zend_string *key;
- ulong num_index;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &klass) == FAILURE) {
return;
@@ -1052,7 +1046,7 @@ ZEND_FUNCTION(get_class_methods)
array_init(return_value);
- ZEND_HASH_FOREACH_KEY_PTR(&ce->function_table, num_index, key, mptr) {
+ ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->function_table, key, mptr) {
if ((mptr->common.fn_flags & ZEND_ACC_PUBLIC)
|| (EG(scope) &&
@@ -1422,14 +1416,13 @@ ZEND_FUNCTION(crash)
ZEND_FUNCTION(get_included_files)
{
zend_string *entry;
- ulong num_idx;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
array_init(return_value);
- ZEND_HASH_FOREACH_KEY(&EG(included_files), num_idx, entry) {
+ ZEND_HASH_FOREACH_STR_KEY(&EG(included_files), entry) {
if (entry) {
add_next_index_str(return_value, STR_COPY(entry));
}
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index 30ae65d267..72fa9cb177 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -309,7 +309,6 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
const char *colon;
zend_class_entry *ce = NULL;
zend_string *class_name;
- zval *ret_constant;
/* Skip leading \\ */
if (name[0] == '\\') {
@@ -317,13 +316,13 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
name_len -= 1;
}
-
if ((colon = zend_memrchr(name, ':', name_len)) &&
colon > name && (*(colon - 1) == ':')) {
int class_name_len = colon - name - 1;
int const_name_len = name_len - class_name_len - 2;
zend_string *constant_name = STR_INIT(colon + 1, const_name_len, 0);
zend_string *lcname;
+ zval *ret_constant = NULL;
class_name = STR_INIT(name, class_name_len, 0);
lcname = STR_ALLOC(class_name_len, 0);
@@ -381,7 +380,11 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
}
STR_FREE(class_name);
STR_FREE(constant_name);
- goto finish;
+ if (retval) {
+ zval_update_constant_ex(ret_constant, (void*)1, ce TSRMLS_CC);
+ ZVAL_DUP(result, ret_constant);
+ }
+ return retval;
}
/* non-class constant */
@@ -425,14 +428,7 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
name_len = const_name_len;
return zend_get_constant(name, name_len, result TSRMLS_CC);
}
- retval = 0;
-finish:
- if (retval) {
- zval_update_constant_ex(ret_constant, (void*)1, ce TSRMLS_CC);
- ZVAL_DUP(result, ret_constant);
- }
-
- return retval;
+ return 0;
}
return zend_get_constant(name, name_len, result TSRMLS_CC);
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 839fc491ef..2866f841d6 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -382,10 +382,10 @@ static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const zend_
return NULL;
break;
case IS_CV:
+ default:
should_free->var = NULL;
return _get_zval_ptr_cv(execute_data, node->var, type TSRMLS_CC);
break;
- EMPTY_SWITCH_DEFAULT_CASE()
}
return NULL;
}
@@ -412,10 +412,10 @@ static inline zval *_get_zval_ptr_deref(int op_type, const znode_op *node, const
return NULL;
break;
case IS_CV:
+ default:
should_free->var = NULL;
return _get_zval_ptr_cv_deref(execute_data, node->var, type TSRMLS_CC);
break;
- EMPTY_SWITCH_DEFAULT_CASE()
}
return NULL;
}
@@ -438,8 +438,6 @@ static zend_always_inline zval *_get_zval_ptr_ptr_var(zend_uint var, const zend_
static inline zval *_get_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
{
- zval *ret;
-
if (op_type == IS_CV) {
should_free->var = NULL;
return _get_zval_ptr_cv(execute_data, node->var, type TSRMLS_CC);
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index cc1dcca0e7..829348d388 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -569,23 +569,42 @@ static inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht, HashPositio
ZEND_HASH_FOREACH(ht, 0); \
_ptr = Z_PTR_P(_z);
+#define ZEND_HASH_FOREACH_STR_KEY(ht, _key) \
+ ZEND_HASH_FOREACH(ht, 0); \
+ _key = _p->key;
+
#define ZEND_HASH_FOREACH_KEY(ht, _h, _key) \
ZEND_HASH_FOREACH(ht, 0); \
_h = _p->h; \
_key = _p->key;
+#define ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val) \
+ ZEND_HASH_FOREACH(ht, 0); \
+ _key = _p->key; \
+ _val = _z;
+
#define ZEND_HASH_FOREACH_KEY_VAL(ht, _h, _key, _val) \
ZEND_HASH_FOREACH(ht, 0); \
_h = _p->h; \
_key = _p->key; \
_val = _z;
+#define ZEND_HASH_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \
+ ZEND_HASH_FOREACH(ht, 1); \
+ _key = _p->key; \
+ _val = _z;
+
#define ZEND_HASH_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \
ZEND_HASH_FOREACH(ht, 1); \
_h = _p->h; \
_key = _p->key; \
_val = _z;
+#define ZEND_HASH_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \
+ ZEND_HASH_FOREACH(ht, 0); \
+ _key = _p->key; \
+ _ptr = Z_PTR_P(_z);
+
#define ZEND_HASH_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \
ZEND_HASH_FOREACH(ht, 0); \
_h = _p->h; \
diff --git a/Zend/zend_list.c b/Zend/zend_list.c
index fa1af76397..c9b9ff66df 100644
--- a/Zend/zend_list.c
+++ b/Zend/zend_list.c
@@ -329,8 +329,6 @@ static void list_destructors_dtor(zval *zv)
int zend_init_rsrc_list_dtors(void)
{
- int retval;
-
zend_hash_init(&list_destructors, 64, NULL, list_destructors_dtor, 1);
list_destructors.nNextFreeElement=1; /* we don't want resource type 0 */
return SUCCESS;
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index 285a752c2b..bd6673c0bb 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -276,12 +276,12 @@ ZEND_API void zend_object_proxy_set(zval *property, zval *value TSRMLS_DC)
}
}
-ZEND_API zval* zend_object_proxy_get(zval *property TSRMLS_DC)
+ZEND_API zval* zend_object_proxy_get(zval *property, zval *rv TSRMLS_DC)
{
zend_proxy_object *probj = (zend_proxy_object*)Z_OBJ_P(property);
if (Z_OBJ_HT(probj->object) && Z_OBJ_HT(probj->object)->read_property) {
- return Z_OBJ_HT(probj->object)->read_property(&probj->object, &probj->property, BP_VAR_R, -1, NULL TSRMLS_CC);
+ return Z_OBJ_HT(probj->object)->read_property(&probj->object, &probj->property, BP_VAR_R, -1, rv TSRMLS_CC);
} else {
zend_error(E_WARNING, "Cannot read property of object - no read handler defined");
}
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index d943ae739a..397f8f60d7 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1807,7 +1807,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
}
/* }}} */
-static int hash_zval_identical_function(const zval *z1, const zval *z2) /* {{{ */
+static int hash_zval_identical_function(zval *z1, zval *z2) /* {{{ */
{
zval result;
TSRMLS_FETCH();
@@ -2406,7 +2406,7 @@ string_cmp:
}
/* }}} */
-static int hash_zval_compare_function(const zval *z1, const zval *z2 TSRMLS_DC) /* {{{ */
+static int hash_zval_compare_function(zval *z1, zval *z2 TSRMLS_DC) /* {{{ */
{
zval result;
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 11fafb53ab..7b65cd6f4a 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -1540,7 +1540,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
{
USE_OPLINE
zend_free_op free_op1, free_op2;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
@@ -3128,11 +3128,10 @@ ZEND_VM_C_LABEL(send_again):
HashTable *ht = Z_ARRVAL_P(args);
zval *arg;
zend_string *name;
- zend_ulong index;
ZEND_VM_STACK_GROW_IF_NEEDED(zend_hash_num_elements(ht));
- ZEND_HASH_FOREACH_KEY_VAL(ht, index, name, arg) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) {
if (name) {
zend_error(E_RECOVERABLE_ERROR, "Cannot unpack array with string keys");
FREE_OP1();
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 6ee7eed781..512267f9e1 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -724,11 +724,10 @@ send_again:
HashTable *ht = Z_ARRVAL_P(args);
zval *arg;
zend_string *name;
- zend_ulong index;
ZEND_VM_STACK_GROW_IF_NEEDED(zend_hash_num_elements(ht));
- ZEND_HASH_FOREACH_KEY_VAL(ht, index, name, arg) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) {
if (name) {
zend_error(E_RECOVERABLE_ERROR, "Cannot unpack array with string keys");
FREE_OP(free_op1);
@@ -14584,7 +14583,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
{
USE_OPLINE
zend_free_op free_op1;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -16747,7 +16746,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_
{
USE_OPLINE
zend_free_op free_op1, free_op2;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -18814,7 +18813,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_
{
USE_OPLINE
zend_free_op free_op1, free_op2;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -22090,7 +22089,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
{
USE_OPLINE
zend_free_op free_op1;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -23732,7 +23731,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OP
{
USE_OPLINE
zend_free_op free_op1;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
@@ -25060,7 +25059,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCO
{
USE_OPLINE
zend_free_op free_op1, free_op2;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
@@ -26301,7 +26300,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCO
{
USE_OPLINE
zend_free_op free_op1, free_op2;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
@@ -28031,7 +28030,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCOD
{
USE_OPLINE
zend_free_op free_op1;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
@@ -31069,7 +31068,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE
{
USE_OPLINE
zend_free_op free_op1;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
@@ -33019,7 +33018,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H
{
USE_OPLINE
zend_free_op free_op1, free_op2;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
@@ -34969,7 +34968,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H
{
USE_OPLINE
zend_free_op free_op1, free_op2;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
@@ -37993,7 +37992,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA
{
USE_OPLINE
zend_free_op free_op1;
- zval *container, *property, *retval_ptr;
+ zval *container, *property;
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 06c131014e..35c018e324 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2503,7 +2503,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
timelib_error_container *err = NULL;
int type = TIMELIB_ZONETYPE_ID, new_dst = 0;
char *new_abbr = NULL;
- timelib_sll new_offset;
+ timelib_sll new_offset = 0;
if (dateobj->time) {
timelib_time_dtor(dateobj->time);
@@ -4016,7 +4016,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, zend_uin
void date_interval_write_property(zval *object, zval *member, zval *value, zend_uint cache_slot TSRMLS_DC)
{
php_interval_obj *obj;
- zval tmp_member, tmp_value;
+ zval tmp_member;
if (Z_TYPE_P(member) != IS_STRING) {
tmp_member = *member;
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index cfa339fe24..8b6af6a52b 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -478,7 +478,7 @@ static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
error_copy.int1 = 0;
error_copy.int2 = 0;
error_copy.ctxt = NULL;
- error_copy.message = xmlStrdup(msg);
+ error_copy.message = (char*)xmlStrdup((xmlChar*)msg);
error_copy.file = NULL;
error_copy.str1 = NULL;
error_copy.str2 = NULL;
diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c
index 59628243f6..04183292d6 100644
--- a/ext/opcache/Optimizer/compact_literals.c
+++ b/ext/opcache/Optimizer/compact_literals.c
@@ -96,7 +96,7 @@ static void optimizer_compact_literals(zend_op_array *op_array TSRMLS_DC)
int l_false = -1;
int l_true = -1;
HashTable hash;
- zend_string *key;
+ zend_string *key = NULL;
if (op_array->last_literal) {
info = (literal_info*)ecalloc(op_array->last_literal, sizeof(literal_info));
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 724b667bde..60769f1314 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1008,7 +1008,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
*match, /* The current match */
*piece, /* The current piece of subject */
*replace_end=NULL, /* End of replacement string */
- *eval_result, /* Result of eval or custom function */
+ *eval_result=NULL, /* Result of eval or custom function */
walk_last; /* Last walked character */
int rc,
result_len; /* Length of result */
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 4940457333..4af0b7383d 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -98,12 +98,15 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
return; \
}
-#define GET_REFLECTION_OBJECT_PTR(target) \
- intern = Z_REFLECTION_P(getThis()); \
+#define GET_REFLECTION_OBJECT() \
+ intern = Z_REFLECTION_P(getThis()); \
if (intern == NULL || intern->ptr == NULL) { \
RETURN_ON_EXCEPTION \
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the reflection object"); \
} \
+
+#define GET_REFLECTION_OBJECT_PTR(target) \
+ GET_REFLECTION_OBJECT() \
target = intern->ptr; \
/* Class constants */
@@ -1679,13 +1682,12 @@ ZEND_METHOD(reflection_function, isClosure)
ZEND_METHOD(reflection_function, getClosureThis)
{
reflection_object *intern;
- zend_function *fptr;
zval* closure_this;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- GET_REFLECTION_OBJECT_PTR(fptr);
+ GET_REFLECTION_OBJECT();
if (!ZVAL_IS_UNDEF(&intern->obj)) {
closure_this = zend_get_closure_this_ptr(&intern->obj TSRMLS_CC);
if (!ZVAL_IS_UNDEF(closure_this)) {
@@ -1700,13 +1702,12 @@ ZEND_METHOD(reflection_function, getClosureThis)
ZEND_METHOD(reflection_function, getClosureScopeClass)
{
reflection_object *intern;
- zend_function *fptr;
const zend_function *closure_func;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- GET_REFLECTION_OBJECT_PTR(fptr);
+ GET_REFLECTION_OBJECT();
if (!ZVAL_IS_UNDEF(&intern->obj)) {
closure_func = zend_get_closure_method_def(&intern->obj TSRMLS_CC);
if (closure_func && closure_func->common.scope) {
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index dc10dde6e9..d2f17452ac 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -326,12 +326,12 @@ static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{
static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC) /* {{{ */
{
spl_ptr_llist_element *current = from->head, *next;
- spl_ptr_llist_ctor_func ctor = from->ctor;
+//??? spl_ptr_llist_ctor_func ctor = from->ctor;
while (current) {
next = current->next;
- /*!! FIXME
+ /*??? FIXME
if (ctor) {
ctor(current TSRMLS_CC);
}
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index 5abedecb7f..35c5353da1 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -200,7 +200,7 @@ spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *int
zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC);
if (!hash) {
- return;
+ return NULL;
}
pelement = spl_object_storage_get(intern, hash TSRMLS_CC);
@@ -419,7 +419,7 @@ static int spl_object_storage_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {
return 1;
}
- return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, spl_object_storage_compare_info, 0 TSRMLS_CC);
+ return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, (compare_func_t)spl_object_storage_compare_info, 0 TSRMLS_CC);
}
/* }}} */
@@ -799,7 +799,6 @@ SPL_METHOD(SplObjectStorage, unserialize)
zval entry, pmembers, pcount, inf;
spl_SplObjectStorageElement *element;
long count;
- HashPosition pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
return;
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 6dada188cf..918d5112e6 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2633,6 +2633,8 @@ PHP_FUNCTION(array_column)
{
zval *zcolumn = NULL, *zkey = NULL, *data;
HashTable *arr_hash;
+ zval *zcolval = NULL, *zkeyval = NULL;
+ HashTable *ht;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "hz!|z!", &arr_hash, &zcolumn, &zkey) == FAILURE) {
return;
@@ -2645,9 +2647,6 @@ PHP_FUNCTION(array_column)
array_init(return_value);
ZEND_HASH_FOREACH_VAL(arr_hash, data) {
- zval *zcolval, *zkeyval = NULL;
- HashTable *ht;
-
if (Z_TYPE_P(data) != IS_ARRAY) {
/* Skip elemens which are not sub-arrays */
continue;
@@ -4506,7 +4505,7 @@ PHP_FUNCTION(array_key_exists)
Split array into chunks */
PHP_FUNCTION(array_chunk)
{
- int argc = ZEND_NUM_ARGS(), key_type, num_in;
+ int argc = ZEND_NUM_ARGS(), num_in;
long size, current = 0;
zend_string *str_key;
ulong num_key;
diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c
index 3ce355a45f..e9176e84da 100644
--- a/ext/standard/crc32.c
+++ b/ext/standard/crc32.c
@@ -27,7 +27,7 @@
PHP_NAMED_FUNCTION(php_if_crc32)
{
char *p;
- int len, nr;
+ int nr;
php_uint32 crcinit = 0;
register php_uint32 crc;
@@ -36,7 +36,7 @@ PHP_NAMED_FUNCTION(php_if_crc32)
}
crc = crcinit^0xFFFFFFFF;
- for (len =+nr; nr--; ++p) {
+ for (; nr--; ++p) {
crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*p)) & 0xFF ];
}
RETVAL_LONG(crc^0xFFFFFFFF);