Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Zend/tests/closures/closure_016.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Foo::__invoke
bool(true)
Foo::__invoke
bool(true)
Closure::__invoke
{closure:foo():9}
bool(true)
Closure::__invoke
{closure:foo():9}
bool(true)
Closure::__invoke
bool(true)
Expand Down
9 changes: 3 additions & 6 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -4160,13 +4160,10 @@ ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, zend_object *obj
if (ce == zend_ce_closure) {
const zend_function *fn = zend_get_closure_method_def(Z_OBJ_P(callable));

if (fn->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) {
if (fn->common.scope) {
return zend_create_member_string(fn->common.scope->name, fn->common.function_name);
} else {
return zend_string_copy(fn->common.function_name);
}
if (fn->common.fn_flags & ZEND_ACC_FAKE_CLOSURE && fn->common.scope) {
return zend_create_member_string(fn->common.scope->name, fn->common.function_name);
}
return zend_string_copy(fn->common.function_name);
}

return zend_string_concat2(
Expand Down
6 changes: 3 additions & 3 deletions tests/output/ob_013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ Array
[5] => E::f
[6] => E::g
[7] => E::__invoke
[8] => Closure::__invoke
[8] => {closure:%s:%d}
)
Array
(
[name] => Closure::__invoke
[name] => {closure:%s:%d}
[type] => 1
[flags] => 20593
[level] => 8
Expand Down Expand Up @@ -161,7 +161,7 @@ Array

[8] => Array
(
[name] => Closure::__invoke
[name] => {closure:%s:%d}
[type] => 1
[flags] => 20593
[level] => 8
Expand Down