@@ -3787,9 +3787,8 @@ static zend_class_entry *preload_fetch_resolved_ce(zend_string *name) {
3787
3787
return ce ;
3788
3788
}
3789
3789
3790
- static bool preload_try_resolve_property_types (zend_class_entry * ce )
3790
+ static void preload_try_resolve_property_types (zend_class_entry * ce )
3791
3791
{
3792
- bool ok = 1 ;
3793
3792
if (ce -> ce_flags & ZEND_ACC_HAS_TYPE_HINTS ) {
3794
3793
zend_property_info * prop ;
3795
3794
ZEND_HASH_FOREACH_PTR (& ce -> properties_info , prop ) {
@@ -3798,20 +3797,13 @@ static bool preload_try_resolve_property_types(zend_class_entry *ce)
3798
3797
if (ZEND_TYPE_HAS_NAME (* single_type )) {
3799
3798
zend_class_entry * p =
3800
3799
preload_fetch_resolved_ce (ZEND_TYPE_NAME (* single_type ));
3801
- if (!p ) {
3802
- ok = 0 ;
3803
- continue ;
3800
+ if (p ) {
3801
+ ZEND_TYPE_SET_CE (* single_type , p );
3804
3802
}
3805
- ZEND_TYPE_SET_CE (* single_type , p );
3806
3803
}
3807
3804
} ZEND_TYPE_FOREACH_END ();
3808
3805
} ZEND_HASH_FOREACH_END ();
3809
- if (ok ) {
3810
- ce -> ce_flags |= ZEND_ACC_PROPERTY_TYPES_RESOLVED ;
3811
- }
3812
3806
}
3813
-
3814
- return ok ;
3815
3807
}
3816
3808
3817
3809
static bool preload_is_class_type_known (zend_class_entry * ce , zend_string * name ) {
@@ -4009,10 +4001,8 @@ static void preload_link(void)
4009
4001
if (ce -> type == ZEND_INTERNAL_CLASS ) {
4010
4002
break ;
4011
4003
}
4012
- if (!(ce -> ce_flags & ZEND_ACC_PROPERTY_TYPES_RESOLVED )) {
4013
- if (!(ce -> ce_flags & ZEND_ACC_TRAIT )) {
4014
- preload_try_resolve_property_types (ce );
4015
- }
4004
+ if (!(ce -> ce_flags & ZEND_ACC_TRAIT )) {
4005
+ preload_try_resolve_property_types (ce );
4016
4006
}
4017
4007
} ZEND_HASH_FOREACH_END ();
4018
4008
@@ -4156,18 +4146,6 @@ static inline int preload_update_class_constants(zend_class_entry *ce) {
4156
4146
return result ;
4157
4147
}
4158
4148
4159
- static zend_class_entry * preload_load_prop_type (zend_property_info * prop , zend_string * name ) {
4160
- zend_class_entry * ce ;
4161
- if (zend_string_equals_literal_ci (name , "self" )) {
4162
- ce = prop -> ce ;
4163
- } else if (zend_string_equals_literal_ci (name , "parent" )) {
4164
- ce = prop -> ce -> parent ;
4165
- } else {
4166
- ce = zend_lookup_class (name );
4167
- }
4168
- return ce ;
4169
- }
4170
-
4171
4149
static void preload_ensure_classes_loadable (void ) {
4172
4150
/* Run this in a loop, because additional classes may be loaded while updating constants etc. */
4173
4151
uint32_t checked_classes_idx = 0 ;
@@ -4192,25 +4170,6 @@ static void preload_ensure_classes_loadable(void) {
4192
4170
if (!(ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
4193
4171
preload_update_class_constants (ce );
4194
4172
}
4195
-
4196
- if (!(ce -> ce_flags & ZEND_ACC_PROPERTY_TYPES_RESOLVED )) {
4197
- if (ce -> ce_flags & ZEND_ACC_HAS_TYPE_HINTS ) {
4198
- zend_property_info * prop ;
4199
- ZEND_HASH_FOREACH_PTR (& ce -> properties_info , prop ) {
4200
- zend_type * single_type ;
4201
- ZEND_TYPE_FOREACH (prop -> type , single_type ) {
4202
- if (ZEND_TYPE_HAS_NAME (* single_type )) {
4203
- zend_class_entry * ce = preload_load_prop_type (
4204
- prop , ZEND_TYPE_NAME (* single_type ));
4205
- if (ce ) {
4206
- ZEND_TYPE_SET_CE (* single_type , ce );
4207
- }
4208
- }
4209
- } ZEND_TYPE_FOREACH_END ();
4210
- } ZEND_HASH_FOREACH_END ();
4211
- }
4212
- ce -> ce_flags |= ZEND_ACC_PROPERTY_TYPES_RESOLVED ;
4213
- }
4214
4173
} ZEND_HASH_FOREACH_END ();
4215
4174
checked_classes_idx = num_classes ;
4216
4175
}
0 commit comments