summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend.c7
-rw-r--r--Zend/zend_API.c1
2 files changed, 7 insertions, 1 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 36972dff06..8c91586510 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -239,7 +239,12 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
if(Z_TYPE_P(z) != IS_OBJECT) {
zend_make_printable_zval(z, expr_copy, use_copy);
- FREE_ZVAL(z);
+ if (*use_copy) {
+ FREE_ZVAL(z);
+ } else {
+ ZVAL_ZVAL(expr_copy, z, 0, 1);
+ *use_copy = 1;
+ }
return;
}
}
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 45462bde3e..b67887de34 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -811,6 +811,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
zend_class_entry *old_scope = *scope;
*scope = class_type;
+ zend_hash_apply_with_argument(&class_type->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
if (!CE_STATIC_MEMBERS(class_type)) {