summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 53f7d48219..2c111e4e50 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1708,11 +1708,12 @@ ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
+ ZVAL_STRINGL(property, zend_strndup(value, len), len, 0);
} else {
ALLOC_ZVAL(property);
+ ZVAL_STRINGL(property, value, len, 1);
}
INIT_PZVAL(property);
- ZVAL_STRINGL(property, zend_strndup(value, len), len, 0);
return zend_declare_property(ce, name, name_length, property, access_type);
}