@@ -1231,7 +1231,9 @@ PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object)
1231
1231
{
1232
1232
reflection_object * intern ;
1233
1233
1234
- reflection_instantiate (reflection_class_ptr , object );
1234
+ zend_class_entry * reflection_ce =
1235
+ ce -> ce_flags & ZEND_ACC_ENUM ? reflection_enum_ptr : reflection_class_ptr ;
1236
+ reflection_instantiate (reflection_ce , object );
1235
1237
intern = Z_REFLECTION_P (object );
1236
1238
intern -> ptr = ce ;
1237
1239
intern -> ref_type = REF_TYPE_OTHER ;
@@ -1240,18 +1242,6 @@ PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object)
1240
1242
}
1241
1243
/* }}} */
1242
1244
1243
- static void zend_reflection_enum_factory (zend_class_entry * ce , zval * object )
1244
- {
1245
- reflection_object * intern ;
1246
-
1247
- reflection_instantiate (reflection_enum_ptr , object );
1248
- intern = Z_REFLECTION_P (object );
1249
- intern -> ptr = ce ;
1250
- intern -> ref_type = REF_TYPE_OTHER ;
1251
- intern -> ce = ce ;
1252
- ZVAL_STR_COPY (reflection_prop_name (object ), ce -> name );
1253
- }
1254
-
1255
1245
/* {{{ reflection_extension_factory */
1256
1246
static void reflection_extension_factory (zval * object , const char * name_str )
1257
1247
{
@@ -6849,7 +6839,7 @@ ZEND_METHOD(ReflectionEnumUnitCase, getEnum)
6849
6839
}
6850
6840
GET_REFLECTION_OBJECT_PTR (ref );
6851
6841
6852
- zend_reflection_enum_factory (ref -> ce , return_value );
6842
+ zend_reflection_class_factory (ref -> ce , return_value );
6853
6843
}
6854
6844
6855
6845
ZEND_METHOD (ReflectionEnumBackedCase , __construct )
0 commit comments