@@ -68,20 +68,14 @@ zend_object_handlers* phongo_get_std_object_handlers(void);
68
68
69
69
#define PHONGO_GET_PROPERTY_HASH_INIT_PROPS (is_temp , intern , props , size ) \
70
70
do { \
71
- if (!(intern)->php_properties) { \
72
- ALLOC_HASHTABLE((intern)->php_properties); \
73
- zend_hash_init((intern)->php_properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
74
- GC_ADDREF((intern)->php_properties); \
75
- } \
76
71
if (is_temp) { \
77
- (props) = zend_array_dup((intern)->php_properties); \
72
+ ALLOC_HASHTABLE(props); \
73
+ zend_hash_init((props), (size), NULL, ZVAL_PTR_DTOR, 0); \
74
+ } else if ((intern)->properties) { \
75
+ (props) = (intern)->properties; \
78
76
} else { \
79
- (props) = zend_array_dup((intern)->php_properties); \
80
- if ((intern)->properties) { \
81
- HashTable *__tmp = (intern)->properties; \
82
- (intern)->properties = NULL; \
83
- zend_hash_release(__tmp); \
84
- } \
77
+ ALLOC_HASHTABLE(props); \
78
+ zend_hash_init((props), (size), NULL, ZVAL_PTR_DTOR, 0); \
85
79
(intern)->properties = (props); \
86
80
} \
87
81
} while (0)
@@ -102,7 +96,11 @@ zend_object_handlers* phongo_get_std_object_handlers(void);
102
96
zend_hash_init(props, 0, NULL, ZVAL_PTR_DTOR, 0); \
103
97
_intern_extractor(zobj)->php_properties = props; \
104
98
} \
105
- return zend_hash_find(props, member); \
99
+ zval *ret = zend_hash_find(props, member); \
100
+ if (ret) { \
101
+ return ret; \
102
+ } \
103
+ return &EG(uninitialized_zval); \
106
104
} \
107
105
\
108
106
static zval *php_phongo_##_name##_write_property(zend_object *zobj, zend_string *name, zval *value, void **cache_slot) \
0 commit comments