]> granicus.if.org Git - php/commitdiff
zend_get_property_info takes a zend_string* now
authorNikita Popov <nikic@php.net>
Sat, 13 Sep 2014 21:14:04 +0000 (23:14 +0200)
committerNikita Popov <nikic@php.net>
Sun, 14 Sep 2014 14:18:08 +0000 (16:18 +0200)
Zend/zend_API.c
Zend/zend_object_handlers.c
Zend/zend_object_handlers.h
ext/reflection/php_reflection.c
ext/soap/php_encoding.c

index fdbefde86b04e9e8ab3b28e812b97c65f82dcba6..9ddd3d67b6355434c166c5e417bd100e772a0463 100644 (file)
@@ -1268,13 +1268,12 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
 {
        object->properties = properties;
        if (object->ce->default_properties_count) {
-           zval *prop, tmp;
+           zval *prop;
        zend_string *key;
        zend_property_info *property_info;
 
        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);
+                       property_info = zend_get_property_info(object->ce, key, 1 TSRMLS_CC);
                        if (property_info &&
                            (property_info->flags & ZEND_ACC_STATIC) == 0 &&
                            property_info->offset >= 0) {
@@ -1293,8 +1292,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties
        zend_property_info *property_info;
 
        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);
+               property_info = zend_get_property_info(object->ce, key, 1 TSRMLS_CC);
                if (property_info &&
                    (property_info->flags & ZEND_ACC_STATIC) == 0 &&
                    property_info->offset >= 0) {
index ea32244b1bcf71f9f1beae31738cea89e50a81de..956ff588f7b4fe222564394370ff4d8b2b92ebe3 100644 (file)
@@ -385,9 +385,9 @@ static zend_always_inline struct _zend_property_info *zend_get_property_info_qui
 }
 /* }}} */
 
-ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC) /* {{{ */
+ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent TSRMLS_DC) /* {{{ */
 {
-       return zend_get_property_info_quick(ce, Z_STR_P(member), silent, NULL TSRMLS_CC);
+       return zend_get_property_info_quick(ce, member, silent, NULL TSRMLS_CC);
 }
 /* }}} */
 
index ee6c9d9e5bce082cdd10722bb68bab561daa9718..bc8500c3eca33117800e6cbc4a8ef645c25cd63e 100644 (file)
@@ -159,7 +159,7 @@ ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce,
 ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent, void **cache_slot TSRMLS_DC);
 ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name, void **cache_slot TSRMLS_DC);
 ZEND_API union _zend_function *zend_std_get_constructor(zend_object *object TSRMLS_DC);
-ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC);
+ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent TSRMLS_DC);
 ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC);
 ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC);
 ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC);
index 6888a6c5d943995154c47e746af05e2a18b40945..c52f8d155c8e4feb6f8f906e032b113965e81945 100644 (file)
@@ -3906,7 +3906,7 @@ static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args, zend
 {
        zval property;
        zend_class_entry *ce = *va_arg(args, zend_class_entry**);
-       zval *retval = va_arg(args, zval*), member;
+       zval *retval = va_arg(args, zval*);
 
        /* under some circumstances, the properties hash table may contain numeric
         * properties (e.g. when casting from array). This is a WONT FIX bug, at
@@ -3919,8 +3919,7 @@ static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args, zend
                return 0; /* non public cannot be dynamic */
        }
 
-       ZVAL_STR(&member, hash_key->key);
-       if (zend_get_property_info(ce, &member, 1 TSRMLS_CC) == &EG(std_property_info)) {
+       if (zend_get_property_info(ce, hash_key->key, 1 TSRMLS_CC) == &EG(std_property_info)) {
                EG(std_property_info).flags = ZEND_ACC_IMPLICIT_PUBLIC;
                reflection_property_factory(ce, &EG(std_property_info), &property TSRMLS_CC);
                add_next_index_zval(retval, &property);
index 802a0773cbfbe3caa0d55c778bb19ca0a0a8bc1c..6189f172a6728aba359882ba1434eefa9ba53bfa 100644 (file)
@@ -1201,7 +1201,7 @@ static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC)
                        /* Hack for bug #32455 */
                        zend_property_info *property_info;
 
-                       property_info = zend_get_property_info(Z_OBJCE_P(object), &member, 1 TSRMLS_CC);
+                       property_info = zend_get_property_info(Z_OBJCE_P(object), Z_STR(member), 1 TSRMLS_CC);
                        EG(scope) = old_scope;
                        if (property_info && zend_hash_exists(Z_OBJPROP_P(object), property_info->name)) {
                                zval_ptr_dtor(&member);