Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions | Variables
zend_object_handlers.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _zend_object_handlers

Defines

#define IS_ZEND_STD_OBJECT(z)   (Z_TYPE(z) == IS_OBJECT && (Z_OBJ_HT((z))->get_class_entry != NULL))
#define HAS_CLASS_ENTRY(z)   (Z_OBJ_HT(z)->get_class_entry != NULL)

Typedefs

typedef zval *(* zend_object_read_property_t )(zval *object, zval *member, int type TSRMLS_DC)
typedef zval *(* zend_object_read_dimension_t )(zval *object, zval *offset, int type TSRMLS_DC)
typedef void(* zend_object_write_property_t )(zval *object, zval *member, zval *value TSRMLS_DC)
typedef void(* zend_object_write_dimension_t )(zval *object, zval *offset, zval *value TSRMLS_DC)
typedef zval **(* zend_object_get_property_ptr_ptr_t )(zval *object, zval *member TSRMLS_DC)
typedef void(* zend_object_set_t )(zval **object, zval *value TSRMLS_DC)
typedef zval *(* zend_object_get_t )(zval *object TSRMLS_DC)
typedef int(* zend_object_has_property_t )(zval *object, zval *member, int has_set_exists TSRMLS_DC)
typedef int(* zend_object_has_dimension_t )(zval *object, zval *member, int check_empty TSRMLS_DC)
typedef void(* zend_object_unset_property_t )(zval *object, zval *member TSRMLS_DC)
typedef void(* zend_object_unset_dimension_t )(zval *object, zval *offset TSRMLS_DC)
typedef HashTable *(* zend_object_get_properties_t )(zval *object TSRMLS_DC)
typedef HashTable *(* zend_object_get_debug_info_t )(zval *object, int *is_temp TSRMLS_DC)
typedef int(* zend_object_call_method_t )(char *method, INTERNAL_FUNCTION_PARAMETERS)
typedef union _zend_function *(* zend_object_get_method_t )(zval **object_ptr, char *method, int method_len TSRMLS_DC)
typedef union _zend_function *(* zend_object_get_constructor_t )(zval *object TSRMLS_DC)
typedef void(* zend_object_add_ref_t )(zval *object TSRMLS_DC)
typedef void(* zend_object_del_ref_t )(zval *object TSRMLS_DC)
typedef void(* zend_object_delete_obj_t )(zval *object TSRMLS_DC)
typedef zend_object_value(* zend_object_clone_obj_t )(zval *object TSRMLS_DC)
typedef zend_class_entry *(* zend_object_get_class_entry_t )(const zval *object TSRMLS_DC)
typedef int(* zend_object_get_class_name_t )(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
typedef int(* zend_object_compare_t )(zval *object1, zval *object2 TSRMLS_DC)
typedef int(* zend_object_cast_t )(zval *readobj, zval *retval, int type TSRMLS_DC)
typedef int(* zend_object_count_elements_t )(zval *object, long *count TSRMLS_DC)
typedef int(* zend_object_get_closure_t )(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC)

Functions

ZEND_API union _zend_functionzend_std_get_static_method (zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC)
ZEND_API zval ** zend_std_get_static_property (zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent TSRMLS_DC)
ZEND_API zend_bool zend_std_unset_static_property (zend_class_entry *ce, char *property_name, int property_name_len TSRMLS_DC)
ZEND_API union _zend_functionzend_std_get_constructor (zval *object TSRMLS_DC)
ZEND_API struct
_zend_property_info
zend_get_property_info (zend_class_entry *ce, zval *member, int silent TSRMLS_DC)
ZEND_API HashTablezend_std_get_properties (zval *object TSRMLS_DC)
ZEND_API HashTablezend_std_get_debug_info (zval *object, int *is_temp TSRMLS_DC)
ZEND_API int zend_std_cast_object_tostring (zval *readobj, zval *writeobj, int type TSRMLS_DC)
ZEND_API int zend_check_private (union _zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC)
ZEND_API int zend_check_protected (zend_class_entry *ce, zend_class_entry *scope)
ZEND_API int zend_check_property_access (zend_object *zobj, char *prop_info_name, int prop_info_name_len TSRMLS_DC)
ZEND_API void zend_std_call_user_call (INTERNAL_FUNCTION_PARAMETERS)

Variables

ZEND_API zend_object_handlers std_object_handlers

Class Documentation

struct _zend_object_handlers

Definition at line 113 of file zend_object_handlers.h.

Collaboration diagram for _zend_object_handlers:
Class Members
zend_object_add_ref_t add_ref
zend_object_call_method_t call_method
zend_object_cast_t cast_object
zend_object_clone_obj_t clone_obj
zend_object_compare_t compare_objects
zend_object_count_elements_t count_elements
zend_object_del_ref_t del_ref
zend_object_get_t get
zend_object_get_class_entry_t get_class_entry
zend_object_get_class_name_t get_class_name
zend_object_get_closure_t get_closure
zend_object_get_constructor_t get_constructor
zend_object_get_debug_info_t get_debug_info
zend_object_get_method_t get_method
zend_object_get_properties_t get_properties
zend_object_get_property_ptr_ptr_t get_property_ptr_ptr
zend_object_has_dimension_t has_dimension
zend_object_has_property_t has_property
zend_object_read_dimension_t read_dimension
zend_object_read_property_t read_property
zend_object_set_t set
zend_object_unset_dimension_t unset_dimension
zend_object_unset_property_t unset_property
zend_object_write_dimension_t write_dimension
zend_object_write_property_t write_property

Define Documentation

#define HAS_CLASS_ENTRY (   z)    (Z_OBJ_HT(z)->get_class_entry != NULL)

Definition at line 157 of file zend_object_handlers.h.

#define IS_ZEND_STD_OBJECT (   z)    (Z_TYPE(z) == IS_OBJECT && (Z_OBJ_HT((z))->get_class_entry != NULL))

Definition at line 156 of file zend_object_handlers.h.


Typedef Documentation

typedef void(* zend_object_add_ref_t)(zval *object TSRMLS_DC)

Definition at line 94 of file zend_object_handlers.h.

Definition at line 89 of file zend_object_handlers.h.

typedef int(* zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC)

Definition at line 105 of file zend_object_handlers.h.

Definition at line 97 of file zend_object_handlers.h.

typedef int(* zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC)

Definition at line 101 of file zend_object_handlers.h.

typedef int(* zend_object_count_elements_t)(zval *object, long *count TSRMLS_DC)

Definition at line 109 of file zend_object_handlers.h.

typedef void(* zend_object_del_ref_t)(zval *object TSRMLS_DC)

Definition at line 95 of file zend_object_handlers.h.

typedef void(* zend_object_delete_obj_t)(zval *object TSRMLS_DC)

Definition at line 96 of file zend_object_handlers.h.

typedef zend_class_entry*(* zend_object_get_class_entry_t)(const zval *object TSRMLS_DC)

Definition at line 99 of file zend_object_handlers.h.

typedef int(* zend_object_get_class_name_t)(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)

Definition at line 100 of file zend_object_handlers.h.

typedef int(* zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC)

Definition at line 111 of file zend_object_handlers.h.

typedef union _zend_function*(* zend_object_get_constructor_t)(zval *object TSRMLS_DC)

Definition at line 91 of file zend_object_handlers.h.

typedef HashTable*(* zend_object_get_debug_info_t)(zval *object, int *is_temp TSRMLS_DC)

Definition at line 83 of file zend_object_handlers.h.

typedef union _zend_function*(* zend_object_get_method_t)(zval **object_ptr, char *method, int method_len TSRMLS_DC)

Definition at line 90 of file zend_object_handlers.h.

Definition at line 81 of file zend_object_handlers.h.

typedef zval**(* zend_object_get_property_ptr_ptr_t)(zval *object, zval *member TSRMLS_DC)

Definition at line 52 of file zend_object_handlers.h.

typedef zval*(* zend_object_get_t)(zval *object TSRMLS_DC)

Definition at line 61 of file zend_object_handlers.h.

typedef int(* zend_object_has_dimension_t)(zval *object, zval *member, int check_empty TSRMLS_DC)

Definition at line 72 of file zend_object_handlers.h.

typedef int(* zend_object_has_property_t)(zval *object, zval *member, int has_set_exists TSRMLS_DC)

Definition at line 69 of file zend_object_handlers.h.

typedef zval*(* zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC)

Definition at line 36 of file zend_object_handlers.h.

typedef zval*(* zend_object_read_property_t)(zval *object, zval *member, int type TSRMLS_DC)

Definition at line 33 of file zend_object_handlers.h.

typedef void(* zend_object_set_t)(zval **object, zval *value TSRMLS_DC)

Definition at line 56 of file zend_object_handlers.h.

typedef void(* zend_object_unset_dimension_t)(zval *object, zval *offset TSRMLS_DC)

Definition at line 78 of file zend_object_handlers.h.

typedef void(* zend_object_unset_property_t)(zval *object, zval *member TSRMLS_DC)

Definition at line 75 of file zend_object_handlers.h.

typedef void(* zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC)

Definition at line 48 of file zend_object_handlers.h.

typedef void(* zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC)

Definition at line 45 of file zend_object_handlers.h.


Function Documentation

ZEND_API int zend_check_private ( union _zend_function fbc,
zend_class_entry *  ce,
char *  function_name_strval,
int function_name_strlen  TSRMLS_DC 
)

Definition at line 775 of file zend_object_handlers.c.

{
       return zend_check_private_int(fbc, ce, function_name_strval, function_name_strlen TSRMLS_CC) != NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API int zend_check_property_access ( zend_object zobj,
char *  prop_info_name,
int prop_info_name_len  TSRMLS_DC 
)

Definition at line 264 of file zend_object_handlers.c.

{
       zend_property_info *property_info;
       char *class_name, *prop_name;
       zval member;

       zend_unmangle_property_name(prop_info_name, prop_info_name_len, &class_name, &prop_name);
       ZVAL_STRING(&member, prop_name, 0);
       property_info = zend_get_property_info(zobj->ce, &member, 1 TSRMLS_CC);
       if (!property_info) {
              return FAILURE;
       }
       if (class_name && class_name[0] != '*') {
              if (!(property_info->flags & ZEND_ACC_PRIVATE)) {
                     /* we we're looking for a private prop but found a non private one of the same name */
                     return FAILURE;
              } else if (strcmp(prop_info_name+1, property_info->name+1)) {
                     /* we we're looking for a private prop but found a private one of the same name but another class */
                     return FAILURE;
              }
       }
       return zend_verify_property_access(property_info, zobj->ce TSRMLS_CC) ? SUCCESS : FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API int zend_check_protected ( zend_class_entry *  ce,
zend_class_entry *  scope 
)

Definition at line 783 of file zend_object_handlers.c.

{
       zend_class_entry *fbc_scope = ce;

       /* Is the context that's calling the function, the same as one of
        * the function's parents?
        */
       while (fbc_scope) {
              if (fbc_scope==scope) {
                     return 1;
              }
              fbc_scope = fbc_scope->parent;
       }

       /* Is the function's scope the same as our current object context,
        * or any of the parents of our context?
        */
       while (scope) {
              if (scope==ce) {
                     return 1;
              }
              scope = scope->parent;
       }
       return 0;
}

Here is the caller graph for this function:

ZEND_API struct _zend_property_info* zend_get_property_info ( zend_class_entry *  ce,
zval *  member,
int silent  TSRMLS_DC 
) [read]

Definition at line 194 of file zend_object_handlers.c.

{
       zend_property_info *property_info = NULL;
       zend_property_info *scope_property_info;
       zend_bool denied_access = 0;
       ulong h;

       if (Z_STRVAL_P(member)[0] == '\0') {
              if (!silent) {
                     if (Z_STRLEN_P(member) == 0) {
                            zend_error(E_ERROR, "Cannot access empty property");
                     } else {
                            zend_error(E_ERROR, "Cannot access property started with '\\0'");
                     }
              }
              return NULL;
       }
       h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
       if (zend_hash_quick_find(&ce->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &property_info)==SUCCESS) {
              if(property_info->flags & ZEND_ACC_SHADOW) {
                     /* if it's a shadow - go to access it's private */
                     property_info = NULL;
              } else {
                     if (zend_verify_property_access(property_info, ce TSRMLS_CC)) {
                            if (property_info->flags & ZEND_ACC_CHANGED
                                   && !(property_info->flags & ZEND_ACC_PRIVATE)) {
                                   /* We still need to make sure that we're not in a context
                                    * where the right property is a different 'statically linked' private
                                    * continue checking below...
                                    */
                            } else {
                                   if (!silent && (property_info->flags & ZEND_ACC_STATIC)) {
                                          zend_error(E_STRICT, "Accessing static property %s::$%s as non static", ce->name, Z_STRVAL_P(member));
                                   }
                                   return property_info;
                            }
                     } else {
                            /* Try to look in the scope instead */
                            denied_access = 1;
                     }
              }
       }
       if (EG(scope) != ce
              && is_derived_class(ce, EG(scope))
              && EG(scope)
              && zend_hash_quick_find(&EG(scope)->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &scope_property_info)==SUCCESS
              && scope_property_info->flags & ZEND_ACC_PRIVATE) {
              return scope_property_info;
       } else if (property_info) {
              if (denied_access) {
                     /* Information was available, but we were denied access.  Error out. */
                     if (silent) {
                            return NULL;
                     }
                     zend_error(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ce->name, Z_STRVAL_P(member));
              } else {
                     /* fall through, return property_info... */
              }
       } else {
              EG(std_property_info).flags = ZEND_ACC_PUBLIC;
              EG(std_property_info).name = Z_STRVAL_P(member);
              EG(std_property_info).name_length = Z_STRLEN_P(member);
              EG(std_property_info).h = h;
              EG(std_property_info).ce = ce;
              property_info = &EG(std_property_info);
       }
       return property_info;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 691 of file zend_object_handlers.c.

{
       zend_internal_function *func = (zend_internal_function *)EG(current_execute_data)->function_state.function;
       zval *method_name_ptr, *method_args_ptr;
       zval *method_result_ptr = NULL;
       zend_class_entry *ce = Z_OBJCE_P(this_ptr);

       ALLOC_ZVAL(method_args_ptr);
       INIT_PZVAL(method_args_ptr);
       array_init_size(method_args_ptr, ZEND_NUM_ARGS());

       if (zend_copy_parameters_array(ZEND_NUM_ARGS(), method_args_ptr TSRMLS_CC) == FAILURE) {
              zval_dtor(method_args_ptr);
              zend_error(E_ERROR, "Cannot get arguments for __call");
              RETURN_FALSE;
       }

       ALLOC_ZVAL(method_name_ptr);
       INIT_PZVAL(method_name_ptr);
       ZVAL_STRING(method_name_ptr, func->function_name, 0); /* no dup - it's a copy */

       /* __call handler is called with two arguments:
          method name
          array of method parameters

       */
       zend_call_method_with_2_params(&this_ptr, ce, &ce->__call, ZEND_CALL_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr);

       if (method_result_ptr) {
              if (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) {
                     RETVAL_ZVAL(method_result_ptr, 1, 1);
              } else {
                     RETVAL_ZVAL(method_result_ptr, 0, 1);
              }
       }

       /* now destruct all auxiliaries */
       zval_ptr_dtor(&method_args_ptr);
       zval_ptr_dtor(&method_name_ptr);

       /* destruct the function also, then - we have allocated it in get_method */
       efree(func);
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API int zend_std_cast_object_tostring ( zval *  readobj,
zval *  writeobj,
int type  TSRMLS_DC 
)

Definition at line 1261 of file zend_object_handlers.c.

{
       zval *retval;
       zend_class_entry *ce;

       switch (type) {
              case IS_STRING:
                     ce = Z_OBJCE_P(readobj);
                     if (ce->__tostring &&
                            (zend_call_method_with_0_params(&readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) {
                            if (EG(exception)) {
                                   if (retval) {
                                          zval_ptr_dtor(&retval);
                                   }
                                   zend_error(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name);
                                   return FAILURE;
                            }
                            if (Z_TYPE_P(retval) == IS_STRING) {
                                   INIT_PZVAL(writeobj);
                                   if (readobj == writeobj) {
                                          zval_dtor(readobj);
                                   }
                                   ZVAL_ZVAL(writeobj, retval, 1, 1);
                                   if (Z_TYPE_P(writeobj) != type) {
                                          convert_to_explicit_type(writeobj, type);
                                   }
                                   return SUCCESS;
                            } else {
                                   zval_ptr_dtor(&retval);
                                   INIT_PZVAL(writeobj);
                                   if (readobj == writeobj) {
                                          zval_dtor(readobj);
                                   }
                                   ZVAL_EMPTY_STRING(writeobj);
                                   zend_error(E_RECOVERABLE_ERROR, "Method %s::__toString() must return a string value", ce->name);
                                   return SUCCESS;
                            }
                     }
                     return FAILURE;
              case IS_BOOL:
                     INIT_PZVAL(writeobj);
                     ZVAL_BOOL(writeobj, 1);
                     return SUCCESS;
              case IS_LONG:
                     ce = Z_OBJCE_P(readobj);
                     zend_error(E_NOTICE, "Object of class %s could not be converted to int", ce->name);
                     INIT_PZVAL(writeobj);
                     if (readobj == writeobj) {
                            zval_dtor(readobj);
                     }
                     ZVAL_LONG(writeobj, 1);
                     return SUCCESS;
              case IS_DOUBLE:
                     ce = Z_OBJCE_P(readobj);
                     zend_error(E_NOTICE, "Object of class %s could not be converted to double", ce->name);
                     INIT_PZVAL(writeobj);
                     if (readobj == writeobj) {
                            zval_dtor(readobj);
                     }
                     ZVAL_DOUBLE(writeobj, 1);
                     return SUCCESS;
              default:
                     INIT_PZVAL(writeobj);
                     Z_TYPE_P(writeobj) = IS_NULL;
                     break;
       }
       return FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API union _zend_function* zend_std_get_constructor ( zval *object  TSRMLS_DC) [write]

Definition at line 1092 of file zend_object_handlers.c.

{
       zend_object *zobj = Z_OBJ_P(object);
       zend_function *constructor = zobj->ce->constructor;

       if (constructor) {
              if (constructor->op_array.fn_flags & ZEND_ACC_PUBLIC) {
                     /* No further checks necessary */
              } else if (constructor->op_array.fn_flags & ZEND_ACC_PRIVATE) {
                     /* Ensure that if we're calling a private function, we're allowed to do so.
                      */
                     if (constructor->common.scope != EG(scope)) {
                            if (EG(scope)) {
                                   zend_error(E_ERROR, "Call to private %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope)->name);
                            } else {
                                   zend_error(E_ERROR, "Call to private %s::%s() from invalid context", constructor->common.scope->name, constructor->common.function_name);
                            }
                     }
              } else if ((constructor->common.fn_flags & ZEND_ACC_PROTECTED)) {
                     /* Ensure that if we're calling a protected function, we're allowed to do so.
                      * Constructors only have prototype if they are defined by an interface but
                      * it is the compilers responsibility to take care of the prototype.
                      */
                     if (!zend_check_protected(zend_get_function_root_class(constructor), EG(scope))) {
                            if (EG(scope)) {
                                   zend_error(E_ERROR, "Call to protected %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope)->name);
                            } else {
                                   zend_error(E_ERROR, "Call to protected %s::%s() from invalid context", constructor->common.scope->name, constructor->common.function_name);
                            }
                     }
              }
       }

       return constructor;
}

Here is the call graph for this function:

ZEND_API HashTable* zend_std_get_debug_info ( zval *  object,
int *is_temp  TSRMLS_DC 
)

Definition at line 62 of file zend_object_handlers.c.

{
       *is_temp = 0;
       return zend_std_get_properties(object TSRMLS_CC);
}

Here is the call graph for this function:

ZEND_API HashTable* zend_std_get_properties ( zval *object  TSRMLS_DC)

Definition at line 54 of file zend_object_handlers.c.

{
       zend_object *zobj;
       zobj = Z_OBJ_P(object);
       return zobj->properties;
}

Here is the caller graph for this function:

ZEND_API union _zend_function* zend_std_get_static_method ( zend_class_entry *  ce,
char *  function_name_strval,
int function_name_strlen  TSRMLS_DC 
) [write]

Definition at line 971 of file zend_object_handlers.c.

{
       zend_function *fbc = NULL;
       char *lc_class_name, *lc_function_name = NULL;
       
       lc_function_name = zend_str_tolower_dup(function_name_strval, function_name_strlen);

       if (function_name_strlen == ce->name_length && ce->constructor) {
              lc_class_name = zend_str_tolower_dup(ce->name, ce->name_length);
              /* Only change the method to the constructor if the constructor isn't called __construct
               * we check for __ so we can be binary safe for lowering, we should use ZEND_CONSTRUCTOR_FUNC_NAME
               */
              if (!memcmp(lc_class_name, lc_function_name, function_name_strlen) && memcmp(ce->constructor->common.function_name, "__", sizeof("__") - 1)) {
                     fbc = ce->constructor;
              }
              efree(lc_class_name);
       }
       if (!fbc && zend_hash_find(&ce->function_table, lc_function_name, function_name_strlen+1, (void **) &fbc)==FAILURE) {
              efree(lc_function_name);

              if (ce->__call &&
                  EG(This) &&
                  Z_OBJ_HT_P(EG(This))->get_class_entry &&
                  instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
                     return zend_get_user_call_function(ce, function_name_strval, function_name_strlen);
              } else if (ce->__callstatic) {
                     return zend_get_user_callstatic_function(ce, function_name_strval, function_name_strlen);
              } else {
                     return NULL;
              }
       }
       efree(lc_function_name);

#if MBO_0
       /* right now this function is used for non static method lookup too */
       /* Is the function static */
       if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
              zend_error(E_ERROR, "Cannot call non static method %s::%s() without object", ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name);
       }
#endif 
       if (fbc->op_array.fn_flags & ZEND_ACC_PUBLIC) {
              /* No further checks necessary, most common case */
       } else if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) {
              zend_function *updated_fbc;

              /* Ensure that if we're calling a private function, we're allowed to do so.
               */
              updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC);
              if (updated_fbc) {
                     fbc = updated_fbc;
              } else {
                     if (ce->__callstatic) {
                            return zend_get_user_callstatic_function(ce, function_name_strval, function_name_strlen);
                     }
                     zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : "");
              }
       } else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) {
              /* Ensure that if we're calling a protected function, we're allowed to do so.
               */
              if (!zend_check_protected(zend_get_function_root_class(fbc), EG(scope))) {
                     if (ce->__callstatic) {
                            return zend_get_user_callstatic_function(ce, function_name_strval, function_name_strlen);
                     }
                     zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : "");
              }
       }

       return fbc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API zval** zend_std_get_static_property ( zend_class_entry *  ce,
char *  property_name,
int  property_name_len,
zend_bool silent  TSRMLS_DC 
)

Definition at line 1042 of file zend_object_handlers.c.

{
       zval **retval = NULL;
       zend_class_entry *tmp_ce = ce;
       zend_property_info *property_info;
       zend_property_info std_property_info;

       if (zend_hash_find(&ce->properties_info, property_name, property_name_len+1, (void **) &property_info)==FAILURE) {
              std_property_info.flags = ZEND_ACC_PUBLIC;
              std_property_info.name = property_name;
              std_property_info.name_length = property_name_len;
              std_property_info.h = zend_get_hash_value(std_property_info.name, std_property_info.name_length+1);
              std_property_info.ce = ce;
              property_info = &std_property_info;
       }

#if DEBUG_OBJECT_HANDLERS
       zend_printf("Access type for %s::%s is %s\n", ce->name, property_name, zend_visibility_string(property_info->flags));
#endif

       if (!zend_verify_property_access(property_info, ce TSRMLS_CC)) {
              if (!silent) {
                     zend_error(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ce->name, property_name);
              }
              return NULL;
       }

       zend_update_class_constants(tmp_ce TSRMLS_CC);

       zend_hash_quick_find(CE_STATIC_MEMBERS(tmp_ce), property_info->name, property_info->name_length+1, property_info->h, (void **) &retval);

       if (!retval) {
              if (silent) {
                     return NULL;
              } else {
                     zend_error(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name);
              }
       }

       return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API zend_bool zend_std_unset_static_property ( zend_class_entry *  ce,
char *  property_name,
int property_name_len  TSRMLS_DC 
)

Definition at line 1085 of file zend_object_handlers.c.

{
       zend_error(E_ERROR, "Attempt to unset static property %s::$%s", ce->name, property_name);
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

ZEND_API zend_object_handlers std_object_handlers

Definition at line 1358 of file zend_object_handlers.c.