72static bool zend_valid_closure_binding(
83 if (is_fake_closure &&
func->common.scope &&
84 !instanceof_function(
Z_OBJCE_P(newthis),
func->common.scope)) {
92 }
else if (is_fake_closure &&
func->common.scope
109 if (is_fake_closure &&
scope !=
func->common.scope) {
125 zval *newthis, closure_result;
143 newclass = newobj->
ce;
145 if (!zend_valid_closure_binding(closure, newthis, newclass)) {
152 fci.
size =
sizeof(fci);
155 fci.
retval = &closure_result;
172 memset(&fake_closure->
std, 0,
sizeof(fake_closure->
std));
177 my_function = &fake_closure->
func;
214 zend_unwrap_reference(&closure_result);
228 }
else if (scope_str) {
229 if (zend_string_equals(scope_str,
ZSTR_KNOWN(ZEND_STR_STATIC))) {
239 if (!zend_valid_closure_binding(closure, newthis, ce)) {
255 zval *zclosure, *newthis;
266 do_closure_bind(
return_value, zclosure, newthis, scope_obj, scope_str);
304 zval *named_param_zval;
365 call.handler = zend_closure_call_magic;
424static int zend_closure_compare(
zval *o1,
zval *o2)
467 const uint32_t keep_flags =
495 return &closure->
func;
516static void zend_closure_free_storage(
zend_object *
object)
567 *fptr_ptr = &closure->
func;
711 closure_handlers.free_obj = zend_closure_free_storage;
712 closure_handlers.get_constructor = zend_closure_get_constructor;
713 closure_handlers.get_method = zend_closure_get_method;
714 closure_handlers.compare = zend_closure_compare;
715 closure_handlers.clone_obj = zend_closure_clone;
716 closure_handlers.get_debug_info = zend_closure_get_debug_info;
717 closure_handlers.get_closure = zend_closure_get_closure;
718 closure_handlers.get_gc = zend_closure_get_gc;
765 }
else if (
func->op_array.static_variables) {
815 if (!
func->common.scope) {
838 zend_create_closure_ex(
res,
func,
scope, called_scope, this_ptr,
846 zend_create_closure_ex(
res,
func,
scope, called_scope, this_ptr,
true);
876 trampoline.
handler = zend_closure_call_magic;
881 trampoline.
arg_info = trampoline_arg_info;
copy(string $from, string $to, $context=null)
memset(ptr, 0, type->size)
foreach($dp as $el) foreach( $dp as $el) if( $pass2< 2) echo ""
unsigned char key[REFLECTION_KEY_LEN]
zend_function * __callstatic
zend_class_entry * called_scope
zif_handler orig_internal_handler
zend_function * function_handler
zend_class_entry * called_scope
zend_string * function_name
struct _zend_module_entry * module
zend_internal_arg_info * arg_info
zend_string * doc_comment
HashTable * static_variables
zend_string * function_name
union _zend_refcounted_h::@314043213170051131205344315207200231050160043145 u
uint32_t required_num_args
zend_string * function_name
struct _zend_function::@236135173067030250234125302313220025134003177336 common
zend_internal_function internal_function
ZEND_API zend_string * zend_strpprintf(size_t max_len, const char *format,...)
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
ZEND_API ZEND_COLD void zend_type_error(const char *format,...)
ZEND_API ZEND_COLD void zend_error(int type, const char *format,...)
#define INTERNAL_FUNCTION_PARAM_PASSTHRU
ZEND_API zend_result zend_copy_parameters_array(uint32_t param_count, zval *argument_array)
ZEND_API zend_result object_init_ex(zval *arg, zend_class_entry *class_type)
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error)
struct _zend_fcall_info_cache zend_fcall_info_cache
#define ZEND_PARSE_PARAMETERS_END()
#define call_user_function_named(function_table, object, function_name, retval_ptr, param_count, params, named_params)
#define Z_PARAM_OBJECT(dest)
#define array_init_size(arg, size)
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
#define RETVAL_OBJ_COPY(r)
#define RETURN_OBJ_COPY(r)
struct _zend_fcall_info zend_fcall_info
#define ZEND_METHOD(classname, name)
#define ZEND_ARG_VARIADIC_TYPE_INFO(pass_by_ref, name, type_hint, allow_null)
#define ZEND_NAMED_FUNCTION(name)
#define Z_PARAM_OBJECT_OF_CLASS(dest, _ce)
#define Z_PARAM_OBJ_OR_STR_OR_NULL(destination_object, destination_string)
#define Z_PARAM_ZVAL(dest)
ZEND_API zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache)
#define Z_PARAM_OBJECT_OR_NULL(dest)
#define Z_PARAM_VARIADIC_WITH_NAMED(dest, dest_num, dest_named)
#define efree_size(ptr, size)
void zend_register_closure_ce(void)
ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr)
ZEND_API const zend_function * zend_get_closure_method_def(zend_object *obj)
ZEND_PARSE_PARAMETERS_END()
ZEND_API zend_class_entry * zend_ce_closure
struct _zend_closure zend_closure
ZEND_API zval * zend_get_closure_this_ptr(zval *obj)
zend_string_release_ex(func->internal_function.function_name, 0)
ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr)
void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val)
void zend_closure_from_frame(zval *return_value, zend_execute_data *call)
void zend_closure_bind_var(zval *closure_zv, zend_string *var_name, zval *var)
ZEND_API zend_function * zend_get_closure_invoke_method(zend_object *object)
#define ZEND_CLOSURE_OBJECT(op_array)
#define ZEND_ACC_USES_THIS
#define ZEND_CALL_CLOSURE
#define ZEND_USER_CODE(type)
#define ZEND_ACC_FAKE_CLOSURE
#define ZEND_ACC_IMMUTABLE
ZEND_API void destroy_op_array(zend_op_array *op_array)
#define ZEND_INTERNAL_FUNCTION
#define ZEND_ARG_SEND_MODE(arg_info)
#define ZEND_ACC_USER_ARG_INFO
#define ZEND_USER_FUNCTION
#define ZEND_ACC_CALL_VIA_TRAMPOLINE
#define ZEND_ACC_GENERATOR
struct _zend_op_array zend_op_array
#define ZEND_CALL_HAS_THIS
#define ZEND_CALL_HAS_EXTRA_NAMED_PARAMS
ZEND_API void zend_destroy_static_vars(zend_op_array *op_array)
#define ZEND_ACC_CALL_VIA_HANDLER
struct _zend_internal_arg_info zend_internal_arg_info
#define ZEND_CALL_INFO(call)
#define ZEND_ACC_HAS_RETURN_TYPE
#define ZEND_ACC_HEAP_RT_CACHE
#define ZEND_ACC_VARIADIC
#define ZEND_ADD_CALL_FLAG(call, flag)
#define ZEND_INTERNAL_CLASS
struct _zend_internal_function zend_internal_function
#define ZEND_ACC_DEPRECATED
#define ZEND_CALL_RELEASE_THIS
#define ZEND_INVOKE_FUNC_NAME
#define ZEND_ACC_RETURN_REFERENCE
void(ZEND_FASTCALL * zif_handler)(INTERNAL_FUNCTION_PARAMETERS)
ZEND_API zend_class_entry * zend_get_called_scope(zend_execute_data *ex)
ZEND_API zend_class_entry * zend_lookup_class(zend_string *name)
union _zend_function zend_function
ZEND_API zval *ZEND_FASTCALL zend_hash_add_new(HashTable *ht, zend_string *key, zval *pData)
ZEND_API zval *ZEND_FASTCALL zend_hash_str_update(HashTable *ht, const char *str, size_t len, zval *pData)
ZEND_API HashTable *ZEND_FASTCALL zend_array_dup(HashTable *source)
ZEND_API zval *ZEND_FASTCALL zend_hash_update(HashTable *ht, zend_string *key, zval *pData)
ZEND_API void ZEND_FASTCALL zend_hash_real_init_mixed(HashTable *ht)
#define zend_new_array(size)
#define ZEND_HASH_FOREACH_END()
#define ZVAL_EMPTY_ARRAY(z)
#define ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(ht, _key, _val)
struct _zend_string zend_string
#define ZEND_MAP_PTR_INIT(ptr, val)
#define ZEND_MAP_PTR_GET(ptr)
#define ZEND_MAP_PTR(ptr)
#define ZEND_MAP_PTR_SET(ptr, val)
ZEND_API zend_function * zend_std_get_method(zend_object **obj_ptr, zend_string *method_name, const zval *key)
ZEND_API const zend_object_handlers std_object_handlers
#define ZEND_COMPARE_OBJECTS_FALLBACK(op1, op2)
#define zend_free_trampoline(func)
ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce)
ZEND_API void zend_object_std_dtor(zend_object *object)
#define ZEND_UNCOMPARABLE
#define XtOffsetOf(s_type, field)
#define UNEXPECTED(condition)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
ZEND_API zend_string * zend_string_concat3(const char *str1, size_t str1_len, const char *str2, size_t str2_len, const char *str3, size_t str3_len)
#define zend_string_equals_literal_ci(str, c)
#define Z_ISREF_P(zval_p)
#define Z_TRY_ADDREF_P(pz)
#define Z_REFVAL_P(zval_p)
#define ZVAL_STR_COPY(z, s)
struct _zend_array HashTable
#define Z_OBJCE_P(zval_p)
#define ZVAL_NEW_STR(z, s)
#define ZVAL_OBJ_COPY(z, o)
ZEND_RESULT_CODE zend_result
struct _zend_object_handlers zend_object_handlers
struct _zend_execute_data zend_execute_data
#define ZVAL_COPY_VALUE(z, v)
ZEND_API void zval_ptr_dtor(zval *zval_ptr)