@@ -190,7 +190,8 @@ typedef enum {
190
190
REF_TYPE_OTHER , /* Must be 0 */
191
191
REF_TYPE_FUNCTION ,
192
192
REF_TYPE_PARAMETER ,
193
- REF_TYPE_PROPERTY
193
+ REF_TYPE_PROPERTY ,
194
+ REF_TYPE_DYNAMIC_PROPERTY
194
195
} reflection_type_t ;
195
196
196
197
/* Struct for reflection objects */
@@ -272,6 +273,7 @@ static void reflection_free_objects_storage(void *object TSRMLS_DC)
272
273
{
273
274
reflection_object * intern = (reflection_object * ) object ;
274
275
parameter_reference * reference ;
276
+ property_reference * prop_reference ;
275
277
276
278
if (intern -> ptr ) {
277
279
switch (intern -> ref_type ) {
@@ -286,6 +288,11 @@ static void reflection_free_objects_storage(void *object TSRMLS_DC)
286
288
case REF_TYPE_PROPERTY :
287
289
efree (intern -> ptr );
288
290
break ;
291
+ case REF_TYPE_DYNAMIC_PROPERTY :
292
+ prop_reference = (property_reference * )intern -> ptr ;
293
+ efree (prop_reference -> prop .name );
294
+ efree (intern -> ptr );
295
+ break ;
289
296
case REF_TYPE_OTHER :
290
297
break ;
291
298
}
@@ -3583,13 +3590,15 @@ ZEND_METHOD(reflection_class, getProperty)
3583
3590
if (zend_hash_exists (Z_OBJ_HT_P (intern -> obj )-> get_properties (intern -> obj TSRMLS_CC ), name , name_len + 1 )) {
3584
3591
zend_property_info property_info_tmp ;
3585
3592
property_info_tmp .flags = ZEND_ACC_IMPLICIT_PUBLIC ;
3586
- property_info_tmp .name = name ;
3593
+ property_info_tmp .name = estrndup ( name , name_len ) ;
3587
3594
property_info_tmp .name_length = name_len ;
3588
3595
property_info_tmp .h = zend_get_hash_value (name , name_len + 1 );
3589
3596
property_info_tmp .doc_comment = NULL ;
3590
3597
property_info_tmp .ce = ce ;
3591
3598
3592
3599
reflection_property_factory (ce , & property_info_tmp , return_value TSRMLS_CC );
3600
+ intern = (reflection_object * ) zend_object_store_get_object (return_value TSRMLS_CC );
3601
+ intern -> ref_type = REF_TYPE_DYNAMIC_PROPERTY ;
3593
3602
return ;
3594
3603
}
3595
3604
}
0 commit comments