diff --git a/Zend/tests/closure_033.phpt b/Zend/tests/closure_033.phpt index 720497bd2de1c..46517326d8043 100644 --- a/Zend/tests/closure_033.phpt +++ b/Zend/tests/closure_033.phpt @@ -23,7 +23,7 @@ $o->func(); ?> ===DONE=== --EXPECTF-- -{closure}() +Test::{closure}() Fatal error: Uncaught Error: Call to private method Test::func() from global scope in %s:%d Stack trace: diff --git a/Zend/tests/nested_method_and_function.phpt b/Zend/tests/nested_method_and_function.phpt index 5965a9274c3ce..2389e7b735cd4 100644 --- a/Zend/tests/nested_method_and_function.phpt +++ b/Zend/tests/nested_method_and_function.phpt @@ -35,5 +35,5 @@ string(3) "bar" string(12) "Baz\Foo::bar" string(7) "Baz\Foo" string(13) "Baz\{closure}" -string(13) "Baz\{closure}" +string(22) "Baz\Foo::Baz\{closure}" string(7) "Baz\Foo" diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 0774fb6d19a25..0344e02d740ef 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7215,6 +7215,7 @@ static void zend_compile_func_decl(znode *result, zend_ast *ast, bool toplevel) if (decl->kind == ZEND_AST_CLOSURE || decl->kind == ZEND_AST_ARROW_FUNC) { op_array->fn_flags |= ZEND_ACC_CLOSURE; + op_array->scope = CG(active_class_entry); } if (is_method) {