Skip to content

Commit 52af261

Browse files
committed
zend_inheritance: Avoid continue in multi-purpose loop
1 parent 97ed27b commit 52af261

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

Zend/zend_inheritance.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,18 +2343,17 @@ void zend_inheritance_check_override(const zend_class_entry *ce)
23432343
ZSTR_VAL(ce->name), zend_get_unmangled_property_name(prop->name));
23442344
}
23452345

2346-
if (!prop->hooks) {
2347-
continue;
2348-
}
2349-
for (uint32_t i = 0; i < ZEND_PROPERTY_HOOK_COUNT; i++) {
2350-
f = prop->hooks[i];
2351-
if (f && f->common.fn_flags & ZEND_ACC_OVERRIDE) {
2352-
ZEND_ASSERT(f->type != ZEND_INTERNAL_FUNCTION);
2353-
2354-
zend_error_at_noreturn(
2355-
E_COMPILE_ERROR, f->op_array.filename, f->op_array.line_start,
2356-
"%s::%s() has #[\\Override] attribute, but no matching parent method exists",
2357-
ZEND_FN_SCOPE_NAME(f), ZSTR_VAL(f->common.function_name));
2346+
if (prop->hooks) {
2347+
for (uint32_t i = 0; i < ZEND_PROPERTY_HOOK_COUNT; i++) {
2348+
f = prop->hooks[i];
2349+
if (f && f->common.fn_flags & ZEND_ACC_OVERRIDE) {
2350+
ZEND_ASSERT(f->type != ZEND_INTERNAL_FUNCTION);
2351+
2352+
zend_error_at_noreturn(
2353+
E_COMPILE_ERROR, f->op_array.filename, f->op_array.line_start,
2354+
"%s::%s() has #[\\Override] attribute, but no matching parent method exists",
2355+
ZEND_FN_SCOPE_NAME(f), ZSTR_VAL(f->common.function_name));
2356+
}
23582357
}
23592358
}
23602359
} ZEND_HASH_FOREACH_END();

0 commit comments

Comments
 (0)