Skip to content

Commit aa9964e

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Fix GH-21411: opcache_compile_file() fails to early-bind classes without parents (#21412)
2 parents cefdfc9 + 1a79ea4 commit aa9964e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/opcache/zend_accelerator_util_funcs.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ static void zend_accel_do_delayed_early_binding(
347347
: NULL;
348348
if (parent_ce || (orig_ce->ce_flags & ZEND_ACC_LINKED)) {
349349
ce = zend_try_early_bind(orig_ce, parent_ce, early_binding->lcname, zv);
350+
} else if (ZSTR_LEN(early_binding->lc_parent_name) == 0) {
351+
/* Parentless class: use the same binding path as the VM handler */
352+
zval lcname_zv[2];
353+
ZVAL_STR(&lcname_zv[0], early_binding->lcname);
354+
ZVAL_STR(&lcname_zv[1], early_binding->rtd_key);
355+
ce = zend_bind_class_in_slot(zv, lcname_zv, early_binding->lc_parent_name);
350356
}
351357
}
352358
if (ce && early_binding->cache_slot != (uint32_t) -1) {

0 commit comments

Comments
 (0)