diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 1490c43e5b77..ff016ad8ff12 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -592,7 +592,7 @@ static zend_class_entry* zend_get_known_class(const zend_op_array *op_array, con ZEND_ASSERT((op.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT); ce = op_array->scope; if (ce) { - if (ce->parent) { + if ((ce->ce_flags & ZEND_ACC_LINKED) && ce->parent) { ce = ce->parent; if (ce->type == ZEND_INTERNAL_CLASS || ce->info.user.filename != op_array->filename) { ce = NULL; diff --git a/ext/opcache/tests/jit/gh25253.inc b/ext/opcache/tests/jit/gh25253.inc new file mode 100644 index 000000000000..64db08b7513d --- /dev/null +++ b/ext/opcache/tests/jit/gh25253.inc @@ -0,0 +1,10 @@ +m0(), $c->m5(), "\n"; + +?> +--EXPECT-- +m0m5