Skip to content

Commit 0544a48

Browse files
committed
- Add ReflectionFunctionAbstract::getClosureThis()
1 parent ffb2f1f commit 0544a48

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

ext/reflection/php_reflection.c

+25-11
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,19 @@ ZEND_METHOD(reflection_function, isClosure)
15851585
}
15861586
/* }}} */
15871587

1588+
/* {{{ proto public bool ReflectionFunction::getClosureThis() U
1589+
Returns this pointer bound to closure */
1590+
ZEND_METHOD(reflection_function, getClosureThis)
1591+
{
1592+
reflection_object *intern;
1593+
zend_function *fptr;
1594+
1595+
METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
1596+
GET_REFLECTION_OBJECT_PTR(fptr);
1597+
RETURN_ZVAL(intern->obj, 1, 0);
1598+
}
1599+
/* }}} */
1600+
15881601
/* {{{ proto public bool ReflectionFunction::isInternal() U
15891602
Returns whether this is an internal function */
15901603
ZEND_METHOD(reflection_function, isInternal)
@@ -5106,25 +5119,26 @@ ZEND_END_ARG_INFO()
51065119
static const zend_function_entry reflection_function_abstract_functions[] = {
51075120
ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
51085121
PHP_ABSTRACT_ME(reflection_function, __toString, NULL)
5122+
ZEND_ME(reflection_function, inNamespace, NULL, 0)
51095123
ZEND_ME(reflection_function, isClosure, NULL, 0)
5124+
ZEND_ME(reflection_function, isDeprecated, NULL, 0)
51105125
ZEND_ME(reflection_function, isInternal, NULL, 0)
51115126
ZEND_ME(reflection_function, isUserDefined, NULL, 0)
5112-
ZEND_ME(reflection_function, getName, NULL, 0)
5113-
ZEND_ME(reflection_function, getFileName, NULL, 0)
5114-
ZEND_ME(reflection_function, getStartLine, NULL, 0)
5115-
ZEND_ME(reflection_function, getEndLine, NULL, 0)
5127+
ZEND_ME(reflection_function, getClosureThis, NULL, 0)
51165128
ZEND_ME(reflection_function, getDocComment, NULL, 0)
5117-
ZEND_ME(reflection_function, getStaticVariables, NULL, 0)
5118-
ZEND_ME(reflection_function, returnsReference, NULL, 0)
5119-
ZEND_ME(reflection_function, getParameters, NULL, 0)
5120-
ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0)
5121-
ZEND_ME(reflection_function, getNumberOfRequiredParameters, NULL, 0)
5129+
ZEND_ME(reflection_function, getEndLine, NULL, 0)
51225130
ZEND_ME(reflection_function, getExtension, NULL, 0)
51235131
ZEND_ME(reflection_function, getExtensionName, NULL, 0)
5124-
ZEND_ME(reflection_function, isDeprecated, NULL, 0)
5125-
ZEND_ME(reflection_function, inNamespace, NULL, 0)
5132+
ZEND_ME(reflection_function, getFileName, NULL, 0)
5133+
ZEND_ME(reflection_function, getName, NULL, 0)
51265134
ZEND_ME(reflection_function, getNamespaceName, NULL, 0)
5135+
ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0)
5136+
ZEND_ME(reflection_function, getNumberOfRequiredParameters, NULL, 0)
5137+
ZEND_ME(reflection_function, getParameters, NULL, 0)
51275138
ZEND_ME(reflection_function, getShortName, NULL, 0)
5139+
ZEND_ME(reflection_function, getStartLine, NULL, 0)
5140+
ZEND_ME(reflection_function, getStaticVariables, NULL, 0)
5141+
ZEND_ME(reflection_function, returnsReference, NULL, 0)
51285142
{NULL, NULL, NULL}
51295143
};
51305144

0 commit comments

Comments
 (0)