@@ -1567,9 +1567,7 @@ static void do_inherit_property(zend_property_info *parent_info, zend_string *ke
1567
1567
ZSTR_VAL (parent_info -> ce -> name ));
1568
1568
}
1569
1569
1570
- if (child_info -> flags & ZEND_ACC_OVERRIDE ) {
1571
- child_info -> flags &= ~ZEND_ACC_OVERRIDE ;
1572
- }
1570
+ child_info -> flags &= ~ZEND_ACC_OVERRIDE ;
1573
1571
}
1574
1572
} else {
1575
1573
zend_function * * hooks = parent_info -> hooks ;
@@ -2308,7 +2306,7 @@ static void zend_do_implement_interfaces(zend_class_entry *ce, zend_class_entry
2308
2306
void zend_inheritance_check_override (const zend_class_entry * ce )
2309
2307
{
2310
2308
zend_function * f ;
2311
- zend_property_info * p ;
2309
+ zend_property_info * prop ;
2312
2310
2313
2311
if (ce -> ce_flags & ZEND_ACC_TRAIT ) {
2314
2312
return ;
@@ -2325,34 +2323,29 @@ void zend_inheritance_check_override(const zend_class_entry *ce)
2325
2323
}
2326
2324
} ZEND_HASH_FOREACH_END ();
2327
2325
2328
- ZEND_HASH_MAP_FOREACH_PTR (& ce -> properties_info , p ) {
2329
- if (p -> flags & ZEND_ACC_OVERRIDE ) {
2326
+ ZEND_HASH_MAP_FOREACH_PTR (& ce -> properties_info , prop ) {
2327
+ if (prop -> flags & ZEND_ACC_OVERRIDE ) {
2330
2328
zend_error_noreturn (
2331
2329
E_COMPILE_ERROR ,
2332
2330
"%s::$%s has #[\\Override] attribute, but no matching parent property exists" ,
2333
- ZSTR_VAL (ce -> name ), zend_get_unmangled_property_name (p -> name ));
2331
+ ZSTR_VAL (ce -> name ), zend_get_unmangled_property_name (prop -> name ));
2334
2332
}
2335
- } ZEND_HASH_FOREACH_END ();
2336
2333
2337
- if (ce -> num_hooked_props ) {
2338
- zend_property_info * prop ;
2339
- ZEND_HASH_MAP_FOREACH_PTR (& ce -> properties_info , prop ) {
2340
- if (!prop -> hooks ) {
2341
- continue ;
2342
- }
2343
- for (uint32_t i = 0 ; i < ZEND_PROPERTY_HOOK_COUNT ; i ++ ) {
2344
- f = prop -> hooks [i ];
2345
- if (f && f -> common .fn_flags & ZEND_ACC_OVERRIDE ) {
2346
- ZEND_ASSERT (f -> type != ZEND_INTERNAL_FUNCTION );
2334
+ if (!prop -> hooks ) {
2335
+ continue ;
2336
+ }
2337
+ for (uint32_t i = 0 ; i < ZEND_PROPERTY_HOOK_COUNT ; i ++ ) {
2338
+ f = prop -> hooks [i ];
2339
+ if (f && f -> common .fn_flags & ZEND_ACC_OVERRIDE ) {
2340
+ ZEND_ASSERT (f -> type != ZEND_INTERNAL_FUNCTION );
2347
2341
2348
- zend_error_at_noreturn (
2349
- E_COMPILE_ERROR , f -> op_array .filename , f -> op_array .line_start ,
2350
- "%s::%s() has #[\\Override] attribute, but no matching parent method exists" ,
2351
- ZEND_FN_SCOPE_NAME (f ), ZSTR_VAL (f -> common .function_name ));
2352
- }
2342
+ zend_error_at_noreturn (
2343
+ E_COMPILE_ERROR , f -> op_array .filename , f -> op_array .line_start ,
2344
+ "%s::%s() has #[\\Override] attribute, but no matching parent method exists" ,
2345
+ ZEND_FN_SCOPE_NAME (f ), ZSTR_VAL (f -> common .function_name ));
2353
2346
}
2354
- } ZEND_HASH_FOREACH_END ();
2355
- }
2347
+ }
2348
+ } ZEND_HASH_FOREACH_END ();
2356
2349
}
2357
2350
2358
2351
0 commit comments