Skip to content

Commit 9535ca5

Browse files
committed
- Return this pointer and not closure itself
1 parent 0544a48 commit 9535ca5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ext/reflection/php_reflection.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1591,10 +1591,14 @@ ZEND_METHOD(reflection_function, getClosureThis)
15911591
{
15921592
reflection_object *intern;
15931593
zend_function *fptr;
1594+
zval* closure_this;
15941595

15951596
METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
15961597
GET_REFLECTION_OBJECT_PTR(fptr);
1597-
RETURN_ZVAL(intern->obj, 1, 0);
1598+
if (intern->obj) {
1599+
closure_this = zend_get_closure_this_ptr(intern->obj TSRMLS_CC);
1600+
RETURN_ZVAL(closure_this, 1, 0);
1601+
}
15981602
}
15991603
/* }}} */
16001604

0 commit comments

Comments
 (0)