Lines Matching refs:ce
77 zend_class_entry *ce = zobj->ce; in rebuild_object_properties() local
80 zend_hash_init(zobj->properties, ce->default_properties_count, NULL, ZVAL_PTR_DTOR, 0); in rebuild_object_properties()
81 if (ce->default_properties_count) { in rebuild_object_properties()
84 ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) { in rebuild_object_properties()
96 while (ce->parent && ce->parent->default_properties_count) { in rebuild_object_properties()
97 ce = ce->parent; in rebuild_object_properties()
98 ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) { in rebuild_object_properties()
99 if (prop_info->ce == ce && in rebuild_object_properties()
144 *n = zobj->ce->default_properties_count; in zend_std_get_gc()
153 zend_class_entry *ce = Z_OBJCE_P(object); in zend_std_get_debug_info() local
157 if (!ce->__debugInfo) { in zend_std_get_debug_info()
164 zend_call_method_with_0_params(object, ce, &ce->__debugInfo, ZEND_DEBUGINFO_FUNC_NAME, &retval); in zend_std_get_debug_info()
193 zend_class_entry *ce = Z_OBJCE_P(object); in zend_std_call_getter() local
203 zend_call_method_with_1_params(object, ce, &ce->__get, ZEND_GET_FUNC_NAME, retval, member); in zend_std_call_getter()
213 zend_class_entry *ce = Z_OBJCE_P(object); in zend_std_call_setter() local
224 zend_call_method_with_2_params(object, ce, &ce->__set, ZEND_SET_FUNC_NAME, &retval, member, value); in zend_std_call_setter()
240 zend_class_entry *ce = Z_OBJCE_P(object); in zend_std_call_unsetter() local
251 zend_call_method_with_1_params(object, ce, &ce->__unset, ZEND_UNSET_FUNC_NAME, NULL, member); in zend_std_call_unsetter()
261 zend_class_entry *ce = Z_OBJCE_P(object); in zend_std_call_issetter() local
274 zend_call_method_with_1_params(object, ce, &ce->__isset, ZEND_ISSET_FUNC_NAME, retval, member); in zend_std_call_issetter()
282 … int zend_verify_property_access(zend_property_info *property_info, zend_class_entry *ce) /* {{{ */ in zend_verify_property_access() argument
294 return (ce == scope || property_info->ce == scope); in zend_verify_property_access()
301 return zend_check_protected(property_info->ce, scope); in zend_verify_property_access()
321 static zend_always_inline uint32_t zend_get_property_offset(zend_class_entry *ce, zend_string *memb… in zend_get_property_offset() argument
328 if (cache_slot && EXPECTED(ce == CACHED_PTR_EX(cache_slot))) { in zend_get_property_offset()
339 if (UNEXPECTED(zend_hash_num_elements(&ce->properties_info) == 0)) { in zend_get_property_offset()
343 zv = zend_hash_find(&ce->properties_info, member); in zend_get_property_offset()
351 if (EXPECTED(zend_verify_property_access(property_info, ce) != 0)) { in zend_get_property_offset()
356 …zend_error(E_NOTICE, "Accessing static property %s::$%s as non static", ZSTR_VAL(ce->name), ZSTR_V… in zend_get_property_offset()
375 if (scope != ce in zend_get_property_offset()
377 && is_derived_class(ce, scope) in zend_get_property_offset()
387 CACHE_POLYMORPHIC_PTR_EX(cache_slot, ce, (void*)(intptr_t)ZEND_DYNAMIC_PROPERTY_OFFSET); in zend_get_property_offset()
393 …annot access %s property %s::$%s", zend_visibility_string(flags), ZSTR_VAL(ce->name), ZSTR_VAL(mem… in zend_get_property_offset()
400 CACHE_POLYMORPHIC_PTR_EX(cache_slot, ce, (void*)(intptr_t)property_info->offset); in zend_get_property_offset()
406 ZEND_API zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int … in zend_get_property_info() argument
420 if (UNEXPECTED(zend_hash_num_elements(&ce->properties_info) == 0)) { in zend_get_property_info()
424 zv = zend_hash_find(&ce->properties_info, member); in zend_get_property_info()
432 if (EXPECTED(zend_verify_property_access(property_info, ce) != 0)) { in zend_get_property_info()
437 …zend_error(E_NOTICE, "Accessing static property %s::$%s as non static", ZSTR_VAL(ce->name), ZSTR_V… in zend_get_property_info()
455 if (scope != ce in zend_get_property_info()
457 && is_derived_class(ce, scope) in zend_get_property_info()
467 …annot access %s property %s::$%s", zend_visibility_string(flags), ZSTR_VAL(ce->name), ZSTR_VAL(mem… in zend_get_property_info()
491 property_info = zend_get_property_info(zobj->ce, member, 1); in zend_check_property_access()
512 return zend_verify_property_access(property_info, zobj->ce) ? SUCCESS : FAILURE; in zend_check_property_access()
531 zv = zobj->properties_table + zobj->ce->default_properties_count; in zend_get_property_guard()
596 …property_offset = zend_get_property_offset(zobj->ce, Z_STR_P(member), (type == BP_VAR_IS) || (zobj… in zend_std_read_property()
616 if ((type == BP_VAR_IS) && zobj->ce->__isset) { in zend_std_read_property()
644 if (zobj->ce->__get) { in zend_std_read_property()
663 …modification of overloaded property %s::$%s has no effect", ZSTR_VAL(zobj->ce->name), Z_STRVAL_P(m… in zend_std_read_property()
682 zend_error(E_NOTICE,"Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), Z_STRVAL_P(member)); in zend_std_read_property()
711 …property_offset = zend_get_property_offset(zobj->ce, Z_STR_P(member), (zobj->ce->__set != NULL), c… in zend_std_write_property()
737 if (zobj->ce->__set) { in zend_std_write_property()
790 zend_class_entry *ce = Z_OBJCE_P(object); in zend_std_read_dimension() local
793 if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) { in zend_std_read_dimension()
804 zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", rv, &tmp_offset); in zend_std_read_dimension()
819 zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", rv, &tmp_offset); in zend_std_read_dimension()
826 …zend_throw_error(NULL, "Undefined offset for object of type %s used as array", ZSTR_VAL(ce->name)); in zend_std_read_dimension()
832 zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name)); in zend_std_read_dimension()
840 zend_class_entry *ce = Z_OBJCE_P(object); in zend_std_write_dimension() local
843 if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) { in zend_std_write_dimension()
851 zend_call_method_with_2_params(&tmp_object, ce, NULL, "offsetset", NULL, &tmp_offset, value); in zend_std_write_dimension()
855 zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name)); in zend_std_write_dimension()
862 zend_class_entry *ce = Z_OBJCE_P(object); in zend_std_has_dimension() local
866 if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) { in zend_std_has_dimension()
870 zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", &retval, &tmp_offset); in zend_std_has_dimension()
875 zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", &retval, &tmp_offset); in zend_std_has_dimension()
887 zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name)); in zend_std_has_dimension()
912 property_offset = zend_get_property_offset(zobj->ce, name, (zobj->ce->__get != NULL), cache_slot); in zend_std_get_property_ptr_ptr()
918 if (EXPECTED(!zobj->ce->__get) || in zend_std_get_property_ptr_ptr()
924 zend_error(E_NOTICE, "Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); in zend_std_get_property_ptr_ptr()
946 if (EXPECTED(!zobj->ce->__get) || in zend_std_get_property_ptr_ptr()
955 zend_error(E_NOTICE, "Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); in zend_std_get_property_ptr_ptr()
983 …property_offset = zend_get_property_offset(zobj->ce, Z_STR_P(member), (zobj->ce->__unset != NULL),… in zend_std_unset_property()
1013 if (zobj->ce->__unset) { in zend_std_unset_property()
1041 zend_class_entry *ce = Z_OBJCE_P(object); in zend_std_unset_dimension() local
1044 if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1)) { in zend_std_unset_dimension()
1048 zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetunset", NULL, &tmp_offset); in zend_std_unset_dimension()
1052 zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name)); in zend_std_unset_dimension()
1061 static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, zend_… in zend_check_private_int() argument
1066 if (!ce) { in zend_check_private_int()
1077 if (fbc->common.scope == ce && scope == ce) { in zend_check_private_int()
1084 ce = ce->parent; in zend_check_private_int()
1085 while (ce) { in zend_check_private_int()
1086 if (ce == scope) { in zend_check_private_int()
1087 if ((func = zend_hash_find(&ce->function_table, function_name))) { in zend_check_private_int()
1096 ce = ce->parent; in zend_check_private_int()
1102 ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, zend_string *function_nam… in zend_check_private() argument
1104 return zend_check_private_int(fbc, ce, function_name) != NULL; in zend_check_private()
1110 ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope) /* {{{ */ in zend_check_protected() argument
1112 zend_class_entry *fbc_scope = ce; in zend_check_protected()
1128 if (scope==ce) { in zend_check_protected()
1137 ZEND_API zend_function *zend_get_call_trampoline_func(zend_class_entry *ce, zend_string *method_nam… in zend_get_call_trampoline_func() argument
1141 zend_function *fbc = is_static ? ce->__callstatic : ce->__call; in zend_get_call_trampoline_func()
1181 static zend_always_inline zend_function *zend_get_user_call_function(zend_class_entry *ce, zend_str… in zend_get_user_call_function() argument
1183 return zend_get_call_trampoline_func(ce, method_name, 0); in zend_get_user_call_function()
1206 if (UNEXPECTED((func = zend_hash_find(&zobj->ce->function_table, lc_method_name)) == NULL)) { in zend_std_get_method()
1210 if (zobj->ce->__call) { in zend_std_get_method()
1211 return zend_get_user_call_function(zobj->ce, method_name); in zend_std_get_method()
1225 updated_fbc = zend_check_private_int(fbc, zobj->ce, lc_method_name); in zend_std_get_method()
1229 if (zobj->ce->__call) { in zend_std_get_method()
1230 fbc = zend_get_user_call_function(zobj->ce, method_name); in zend_std_get_method()
1260 if (zobj->ce->__call) { in zend_std_get_method()
1261 fbc = zend_get_user_call_function(zobj->ce, method_name); in zend_std_get_method()
1277 static zend_always_inline zend_function *zend_get_user_callstatic_function(zend_class_entry *ce, ze… in zend_get_user_callstatic_function() argument
1279 return zend_get_call_trampoline_func(ce, method_name, 1); in zend_get_user_callstatic_function()
1283 ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name… in zend_std_get_static_method() argument
1297 if (ZSTR_LEN(function_name) == ZSTR_LEN(ce->name) && ce->constructor) { in zend_std_get_static_method()
1298 lc_class_name = zend_str_tolower_dup(ZSTR_VAL(ce->name), ZSTR_LEN(ce->name)); in zend_std_get_static_method()
1302 …e, ZSTR_VAL(lc_function_name), ZSTR_LEN(function_name)) && memcmp(ZSTR_VAL(ce->constructor->common… in zend_std_get_static_method()
1303 fbc = ce->constructor; in zend_std_get_static_method()
1309 zval *func = zend_hash_find(&ce->function_table, lc_function_name); in zend_std_get_static_method()
1316 if (ce->__call && in zend_std_get_static_method()
1318 instanceof_function(object->ce, ce)) { in zend_std_get_static_method()
1322 zend_class_entry *call_ce = object->ce; in zend_std_get_static_method()
1328 } else if (ce->__callstatic) { in zend_std_get_static_method()
1329 return zend_get_user_callstatic_function(ce, function_name); in zend_std_get_static_method()
1355 if (ce->__callstatic) { in zend_std_get_static_method()
1356 fbc = zend_get_user_callstatic_function(ce, function_name); in zend_std_get_static_method()
1367 if (ce->__callstatic) { in zend_std_get_static_method()
1368 fbc = zend_get_user_callstatic_function(ce, function_name); in zend_std_get_static_method()
1384 ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_… in zend_std_get_static_property() argument
1386 zend_property_info *property_info = zend_hash_find_ptr(&ce->properties_info, property_name); in zend_std_get_static_property()
1393 if (UNEXPECTED(!zend_verify_property_access(property_info, ce))) { in zend_std_get_static_property()
1395 … property %s::$%s", zend_visibility_string(property_info->flags), ZSTR_VAL(ce->name), ZSTR_VAL(pro… in zend_std_get_static_property()
1404 if (UNEXPECTED(!(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) { in zend_std_get_static_property()
1405 if (UNEXPECTED(zend_update_class_constants(ce)) != SUCCESS) { in zend_std_get_static_property()
1409 ret = CE_STATIC_MEMBERS(ce) + property_info->offset; in zend_std_get_static_property()
1412 if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { in zend_std_get_static_property()
1415 …zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_V… in zend_std_get_static_property()
1424 ZEND_API ZEND_COLD zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *prop… in zend_std_unset_static_property() argument
1426 …zend_throw_error(NULL, "Attempt to unset static property %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(pr… in zend_std_unset_static_property()
1433 zend_function *constructor = zobj->ce->constructor; in zend_std_get_constructor()
1489 if (zobj1->ce != zobj2->ce) { in zend_std_compare_objects()
1495 if (!zobj1->ce->default_properties_count) { in zend_std_compare_objects()
1500 end = p1 + zobj1->ce->default_properties_count; in zend_std_compare_objects()
1565 property_offset = zend_get_property_offset(zobj->ce, Z_STR_P(member), 1, cache_slot); in zend_std_has_property()
1596 if ((has_set_exists != 2) && zobj->ce->__isset) { in zend_std_has_property()
1615 if (EXPECTED(!EG(exception)) && zobj->ce->__get && !((*guard) & IN_GET)) { in zend_std_has_property()
1645 return zend_string_copy(zobj->ce->name); in zend_std_object_get_class_name()
1652 zend_class_entry *ce; in zend_std_cast_object_tostring() local
1656 ce = Z_OBJCE_P(readobj); in zend_std_cast_object_tostring()
1657 if (ce->__tostring && in zend_std_cast_object_tostring()
1658 …(zend_call_method_with_0_params(readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(excepti… in zend_std_cast_object_tostring()
1671 ZSTR_VAL(ce->name), ZSTR_VAL(Z_OBJCE(ex)->name), Z_STRVAL_P(msg)); in zend_std_cast_object_tostring()
1686 …ror(E_RECOVERABLE_ERROR, "Method %s::__toString() must return a string value", ZSTR_VAL(ce->name)); in zend_std_cast_object_tostring()
1695 ce = Z_OBJCE_P(readobj); in zend_std_cast_object_tostring()
1696 zend_error(E_NOTICE, "Object of class %s could not be converted to int", ZSTR_VAL(ce->name)); in zend_std_cast_object_tostring()
1703 ce = Z_OBJCE_P(readobj); in zend_std_cast_object_tostring()
1704 zend_error(E_NOTICE, "Object of class %s could not be converted to float", ZSTR_VAL(ce->name)); in zend_std_cast_object_tostring()
1721 zend_class_entry *ce; in zend_std_get_closure() local
1727 ce = Z_OBJCE_P(obj); in zend_std_get_closure()
1729 …if ((func = zend_hash_find(&ce->function_table, CG(known_strings)[ZEND_STR_MAGIC_INVOKE])) == NULL… in zend_std_get_closure()
1734 *ce_ptr = ce; in zend_std_get_closure()