diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 0fd9c04330b..af137e424d2 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7385,7 +7385,7 @@ void zend_compile_class_decl(znode *result, zend_ast *ast, zend_bool toplevel) / if (toplevel /* We currently don't early-bind classes that implement interfaces or use traits */ && !ce->num_interfaces && !ce->num_traits - && !(CG(compiler_options) & ZEND_COMPILE_PRELOAD)) { + && !(CG(compiler_options) & ZEND_COMPILE_WITHOUT_EXECUTION)) { if (extends_ast) { zend_class_entry *parent_ce = zend_lookup_class_ex( ce->parent_name, NULL, ZEND_FETCH_CLASS_NO_AUTOLOAD); diff --git a/ext/opcache/tests/preload_early_binding.inc b/ext/opcache/tests/preload_early_binding.inc new file mode 100644 index 00000000000..0adcd6b6d7e --- /dev/null +++ b/ext/opcache/tests/preload_early_binding.inc @@ -0,0 +1,3 @@ + +--FILE-- +OK +--EXPECT-- +object(X)#1 (0) { +} +OK