1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 19:52:20 +02:00

- Add reflection helpers

This commit is contained in:
Marcus Boerger
2009-01-03 12:19:30 +00:00
parent 50ce72fdf4
commit de5a4f7dfa
2 changed files with 16 additions and 0 deletions

View File

@@ -107,6 +107,20 @@ ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC) /* {
}
/* }}} */
ZEND_API const zend_function *zend_get_closure_method_def(zval *obj TSRMLS_DC)
{
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
return &closure->func;
}
/* }}} */
ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC) /* {{{ */
{
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
return closure->this_ptr;
}
/* }}} */
static zend_function *zend_closure_get_method(zval **object_ptr, zstr method_name, int method_len TSRMLS_DC) /* {{{ */
{
unsigned int lc_name_len;

View File

@@ -33,6 +33,8 @@ extern ZEND_API zend_class_entry *zend_ce_closure;
ZEND_API void zend_create_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zval *this_ptr TSRMLS_DC);
ZEND_API int zend_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC);
ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC);
ZEND_API const zend_function *zend_get_closure_method_def(zval *obj TSRMLS_DC);
ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC);
END_EXTERN_C()