php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
zend_inheritance.c File Reference
#include "zend.h"
#include "zend_API.h"
#include "zend_compile.h"
#include "zend_execute.h"
#include "zend_inheritance.h"
#include "zend_interfaces.h"
#include "zend_smart_str.h"
#include "zend_operators.h"
#include "zend_exceptions.h"
#include "zend_enum.h"
#include "zend_attributes.h"
#include "zend_constants.h"
#include "zend_observer.h"

Go to the source code of this file.

Data Structures

struct  _zend_abstract_info
 
struct  variance_obligation
 

Macros

#define ZEND_INHERITANCE_LAZY_CHILD_CLONE   (1<<0)
 
#define ZEND_INHERITANCE_CHECK_SILENT   (1<<1) /* don't throw errors */
 
#define ZEND_INHERITANCE_CHECK_PROTO   (1<<2) /* check method prototype (it might be already checked before) */
 
#define ZEND_INHERITANCE_CHECK_VISIBILITY   (1<<3)
 
#define ZEND_INHERITANCE_SET_CHILD_CHANGED   (1<<4)
 
#define ZEND_INHERITANCE_SET_CHILD_PROTO   (1<<5)
 
#define ZEND_INHERITANCE_RESET_CHILD_OVERRIDE   (1<<6)
 
#define SEPARATE_METHOD()
 
#define MAX_ABSTRACT_INFO_CNT   3
 
#define MAX_ABSTRACT_INFO_FMT   "%s%s%s%s"
 
#define DISPLAY_ABSTRACT_FN(idx)
 
#define zend_update_inherited_handler(handler)
 
#define UPDATE_IS_CACHEABLE(ce)
 

Typedefs

typedef zend_inheritance_status inheritance_status
 
typedef struct _zend_abstract_info zend_abstract_info
 

Enumerations

enum  prop_variance { PROP_INVARIANT , PROP_COVARIANT , PROP_CONTRAVARIANT }
 

Functions

char * zend_visibility_string (uint32_t fn_flags)
 
ZEND_API inheritance_status zend_perform_covariant_type_check (zend_class_entry *fe_scope, zend_type fe_type, zend_class_entry *proto_scope, zend_type proto_type)
 
void zend_build_properties_info_table (zend_class_entry *ce)
 
ZEND_API void zend_verify_hooked_property (zend_class_entry *ce, zend_property_info *prop_info, zend_string *prop_name)
 
ZEND_API ZEND_COLD ZEND_NORETURN void zend_hooked_property_variance_error_ex (zend_string *value_param_name, zend_string *class_name, zend_string *prop_name)
 
ZEND_API ZEND_COLD ZEND_NORETURN void zend_hooked_property_variance_error (const zend_property_info *prop_info)
 
ZEND_API inheritance_status zend_verify_property_hook_variance (const zend_property_info *prop_info, const zend_function *func)
 
ZEND_API void zend_do_inheritance_ex (zend_class_entry *ce, zend_class_entry *parent_ce, bool checked)
 
ZEND_API void zend_do_implement_interface (zend_class_entry *ce, zend_class_entry *iface)
 
void zend_inheritance_check_override (zend_class_entry *ce)
 
void zend_verify_abstract_class (zend_class_entry *ce)
 
ZEND_API zend_class_entryzend_do_link_class (zend_class_entry *ce, zend_string *lc_parent_name, zend_string *key)
 
ZEND_API zend_class_entryzend_try_early_bind (zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding)
 

Variables

ZEND_API zend_class_entry *(* zend_inheritance_cache_get )(zend_class_entry *ce, zend_class_entry *parent, zend_class_entry **traits_and_interfaces) = NULL
 
ZEND_API zend_class_entry *(* zend_inheritance_cache_add )(zend_class_entry *ce, zend_class_entry *proto, zend_class_entry *parent, zend_class_entry **traits_and_interfaces, HashTable *dependencies) = NULL
 

Macro Definition Documentation

◆ DISPLAY_ABSTRACT_FN

#define DISPLAY_ABSTRACT_FN ( idx)
Value:
ai.afn[idx] ? ZEND_FN_SCOPE_NAME(ai.afn[idx]) : "", \
ai.afn[idx] ? "::" : "", \
ai.afn[idx] ? ZSTR_VAL(ai.afn[idx]->common.function_name) : "", \
ai.afn[idx] && ai.afn[idx + 1] ? ", " : (ai.afn[idx] && ai.cnt > MAX_ABSTRACT_INFO_CNT ? ", ..." : "")
#define ZEND_FN_SCOPE_NAME(function)
#define MAX_ABSTRACT_INFO_CNT
#define ZSTR_VAL(zstr)
Definition zend_string.h:68

Definition at line 3015 of file zend_inheritance.c.

◆ MAX_ABSTRACT_INFO_CNT

#define MAX_ABSTRACT_INFO_CNT   3

Definition at line 3013 of file zend_inheritance.c.

◆ MAX_ABSTRACT_INFO_FMT

#define MAX_ABSTRACT_INFO_FMT   "%s%s%s%s"

Definition at line 3014 of file zend_inheritance.c.

◆ SEPARATE_METHOD

#define SEPARATE_METHOD ( )
Value:
do { \
&& child_scope != ce && child->type == ZEND_USER_FUNCTION) { \
/* op_array wasn't duplicated yet */ \
zend_function *new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); \
memcpy(new_function, child, sizeof(zend_op_array)); \
Z_PTR_P(child_zv) = child = new_function; \
} \
} while(0)
char * arena
Definition php_bcmath.h:37
#define ZEND_USER_FUNCTION
struct _zend_op_array zend_op_array
union _zend_function zend_function
#define CG(v)
#define ZEND_INHERITANCE_LAZY_CHILD_CLONE

◆ UPDATE_IS_CACHEABLE

#define UPDATE_IS_CACHEABLE ( ce)
Value:
do { \
if ((ce)->type == ZEND_USER_CLASS) { \
is_cacheable &= (ce)->ce_flags; \
} \
} while (0)
zend_ffi_type * type
Definition ffi.c:3812
#define ZEND_USER_CLASS

Definition at line 3465 of file zend_inheritance.c.

◆ ZEND_INHERITANCE_CHECK_PROTO

#define ZEND_INHERITANCE_CHECK_PROTO   (1<<2) /* check method prototype (it might be already checked before) */

Definition at line 1098 of file zend_inheritance.c.

◆ ZEND_INHERITANCE_CHECK_SILENT

#define ZEND_INHERITANCE_CHECK_SILENT   (1<<1) /* don't throw errors */

Definition at line 1097 of file zend_inheritance.c.

◆ ZEND_INHERITANCE_CHECK_VISIBILITY

#define ZEND_INHERITANCE_CHECK_VISIBILITY   (1<<3)

Definition at line 1099 of file zend_inheritance.c.

◆ ZEND_INHERITANCE_LAZY_CHILD_CLONE

#define ZEND_INHERITANCE_LAZY_CHILD_CLONE   (1<<0)

Definition at line 1096 of file zend_inheritance.c.

◆ ZEND_INHERITANCE_RESET_CHILD_OVERRIDE

#define ZEND_INHERITANCE_RESET_CHILD_OVERRIDE   (1<<6)

Definition at line 1102 of file zend_inheritance.c.

◆ ZEND_INHERITANCE_SET_CHILD_CHANGED

#define ZEND_INHERITANCE_SET_CHILD_CHANGED   (1<<4)

Definition at line 1100 of file zend_inheritance.c.

◆ ZEND_INHERITANCE_SET_CHILD_PROTO

#define ZEND_INHERITANCE_SET_CHILD_PROTO   (1<<5)

Definition at line 1101 of file zend_inheritance.c.

◆ zend_update_inherited_handler

#define zend_update_inherited_handler ( handler)
Value:
do { \
if (ce->handler == (zend_function*)op_array) { \
ce->handler = (zend_function*)new_op_array; \
} \
} while (0)
new_op_array

Definition at line 3316 of file zend_inheritance.c.

Typedef Documentation

◆ inheritance_status

Definition at line 40 of file zend_inheritance.c.

◆ zend_abstract_info

Enumeration Type Documentation

◆ prop_variance

Enumerator
PROP_INVARIANT 
PROP_COVARIANT 
PROP_CONTRAVARIANT 

Definition at line 42 of file zend_inheritance.c.

Function Documentation

◆ zend_build_properties_info_table()

void zend_build_properties_info_table ( zend_class_entry * ce)

Definition at line 1658 of file zend_inheritance.c.

◆ zend_do_implement_interface()

ZEND_API void zend_do_implement_interface ( zend_class_entry * ce,
zend_class_entry * iface )

Definition at line 2164 of file zend_inheritance.c.

◆ zend_do_inheritance_ex()

ZEND_API void zend_do_inheritance_ex ( zend_class_entry * ce,
zend_class_entry * parent_ce,
bool checked )

Definition at line 1802 of file zend_inheritance.c.

◆ zend_do_link_class()

ZEND_API zend_class_entry * zend_do_link_class ( zend_class_entry * ce,
zend_string * lc_parent_name,
zend_string * key )

Definition at line 3477 of file zend_inheritance.c.

◆ zend_hooked_property_variance_error()

ZEND_API ZEND_COLD ZEND_NORETURN void zend_hooked_property_variance_error ( const zend_property_info * prop_info)

Definition at line 1758 of file zend_inheritance.c.

◆ zend_hooked_property_variance_error_ex()

ZEND_API ZEND_COLD ZEND_NORETURN void zend_hooked_property_variance_error_ex ( zend_string * value_param_name,
zend_string * class_name,
zend_string * prop_name )

Definition at line 1752 of file zend_inheritance.c.

◆ zend_inheritance_check_override()

void zend_inheritance_check_override ( zend_class_entry * ce)

Definition at line 2274 of file zend_inheritance.c.

◆ zend_perform_covariant_type_check()

ZEND_API inheritance_status zend_perform_covariant_type_check ( zend_class_entry * fe_scope,
zend_type fe_type,
zend_class_entry * proto_scope,
zend_type proto_type )

Definition at line 651 of file zend_inheritance.c.

◆ zend_try_early_bind()

ZEND_API zend_class_entry * zend_try_early_bind ( zend_class_entry * ce,
zend_class_entry * parent_ce,
zend_string * lcname,
zval * delayed_early_binding )

Definition at line 3840 of file zend_inheritance.c.

◆ zend_verify_abstract_class()

void zend_verify_abstract_class ( zend_class_entry * ce)

Definition at line 3035 of file zend_inheritance.c.

◆ zend_verify_hooked_property()

ZEND_API void zend_verify_hooked_property ( zend_class_entry * ce,
zend_property_info * prop_info,
zend_string * prop_name )

Definition at line 1699 of file zend_inheritance.c.

◆ zend_verify_property_hook_variance()

ZEND_API inheritance_status zend_verify_property_hook_variance ( const zend_property_info * prop_info,
const zend_function * func )

Definition at line 1764 of file zend_inheritance.c.

◆ zend_visibility_string()

char * zend_visibility_string ( uint32_t fn_flags)

Definition at line 202 of file zend_inheritance.c.

Variable Documentation

◆ zend_inheritance_cache_add

ZEND_API zend_class_entry *(* zend_inheritance_cache_add) (zend_class_entry *ce, zend_class_entry *proto, zend_class_entry *parent, zend_class_entry **traits_and_interfaces, HashTable *dependencies) ( zend_class_entry * ce,
zend_class_entry * proto,
zend_class_entry * parent,
zend_class_entry ** traits_and_interfaces,
HashTable * dependencies ) = NULL

Definition at line 35 of file zend_inheritance.c.

◆ zend_inheritance_cache_get

ZEND_API zend_class_entry *(* zend_inheritance_cache_get) (zend_class_entry *ce, zend_class_entry *parent, zend_class_entry **traits_and_interfaces) ( zend_class_entry * ce,
zend_class_entry * parent,
zend_class_entry ** traits_and_interfaces ) = NULL

Definition at line 34 of file zend_inheritance.c.