Skip to content

Commit d9a78a8

Browse files
committed
- MFH Add reflection support helpers
1 parent acd8f00 commit d9a78a8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Zend/zend_closures.c

+14
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@ ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC) /* {
104104
}
105105
/* }}} */
106106

107+
ZEND_API const zend_function *zend_get_closure_method_def(zval *obj TSRMLS_DC) /* {{{ */
108+
{
109+
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
110+
return &closure->func;
111+
}
112+
/* }}} */
113+
114+
ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC) /* {{{ */
115+
{
116+
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
117+
return closure->this_ptr;
118+
}
119+
/* }}} */
120+
107121
static zend_function *zend_closure_get_method(zval **object_ptr, char *method_name, int method_len TSRMLS_DC) /* {{{ */
108122
{
109123
char *lc_name;

Zend/zend_closures.h

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ extern ZEND_API zend_class_entry *zend_ce_closure;
3333
ZEND_API void zend_create_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zval *this_ptr TSRMLS_DC);
3434
ZEND_API int zend_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zval **zobj_ptr, zval ***zobj_ptr_ptr TSRMLS_DC);
3535
ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC);
36+
ZEND_API const zend_function *zend_get_closure_method_def(zval *obj TSRMLS_DC);
37+
ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC);
3638

3739
END_EXTERN_C()
3840

0 commit comments

Comments
 (0)