Lines Matching defs:scope

175 	const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
195 const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
215 const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
234 const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
905 const char *class_name = active_function->common.scope
906 ? ZSTR_VAL(active_function->common.scope->name) : "";
985 const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
1100 * Z_OBJ(EG(This)) to NULL when calling an internal function with common.scope == NULL.
1103 zend_bool is_method = EG(current_execute_data)->func->common.scope != NULL;
2140 ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type) /* {{{ */
2167 if (scope) {
2168 class_name_len = ZSTR_LEN(scope->name);
2169 if ((lc_class_name = zend_memrchr(ZSTR_VAL(scope->name), '\\', class_name_len))) {
2171 class_name_len -= (lc_class_name - ZSTR_VAL(scope->name));
2174 lc_class_name = zend_str_tolower_dup(ZSTR_VAL(scope->name), class_name_len);
2182 internal_function->scope = scope;
2186 if (ptr->flags != ZEND_ACC_DEPRECATED && scope) {
2187 zend_error(error_type, "Invalid access level for %s%s%s() - access must be exactly one of public, protected or private", scope ? ZSTR_VAL(scope->name) : "", scope ? "::" : "", ptr->fname);
2222 if (!scope && (!strcasecmp(type_name, "self") || !strcasecmp(type_name, "parent"))) {
2223 zend_error_noreturn(E_CORE_ERROR, "Cannot declare a return type of %s outside of a class scope", type_name);
2236 if (scope) {
2238 scope->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
2239 if (!(scope->ce_flags & ZEND_ACC_INTERFACE)) {
2243 scope->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
2246 if (ptr->flags & ZEND_ACC_STATIC && (!scope || !(scope->ce_flags & ZEND_ACC_INTERFACE))) {
2247 zend_error(error_type, "Static function %s%s%s() cannot be abstract", scope ? ZSTR_VAL(scope->name) : "", scope ? "::" : "", ptr->fname);
2250 if (scope && (scope->ce_flags & ZEND_ACC_INTERFACE)) {
2252 zend_error(error_type, "Interface %s cannot contain non abstract method %s()", ZSTR_VAL(scope->name), ptr->fname);
2256 if (scope) {
2259 zend_error(error_type, "Method %s%s%s() cannot be a NULL function", scope ? ZSTR_VAL(scope->name) : "", scope ? "::" : "", ptr->fname);
2316 if (scope) {
2334 zend_error(error_type, "Destructor %s::%s() cannot take arguments", ZSTR_VAL(scope->name), ptr->fname);
2346 scope->ce_flags |= ZEND_ACC_USE_GUARDS;
2349 scope->ce_flags |= ZEND_ACC_USE_GUARDS;
2352 scope->ce_flags |= ZEND_ACC_USE_GUARDS;
2355 scope->ce_flags |= ZEND_ACC_USE_GUARDS;
2362 zend_check_magic_method_implementation(scope, reg_function, error_type);
2370 if (scope) {
2378 zend_error(error_type, "Function registration failed - duplicate name - %s%s%s", scope ? ZSTR_VAL(scope->name) : "", scope ? "::" : "", ptr->fname);
2386 if (scope) {
2387 scope->constructor = ctor;
2388 scope->destructor = dtor;
2389 scope->clone = clone;
2390 scope->__call = __call;
2391 scope->__callstatic = __callstatic;
2392 scope->__tostring = __tostring;
2393 scope->__get = __get;
2394 scope->__set = __set;
2395 scope->__unset = __unset;
2396 scope->__isset = __isset;
2397 scope->__debugInfo = __debugInfo;
2398 scope->serialize_func = serialize_func;
2399 scope->unserialize_func = unserialize_func;
2403 zend_error(error_type, "Constructor %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(ctor->common.function_name));
2410 zend_error(error_type, "Destructor %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(dtor->common.function_name));
2416 zend_error(error_type, "%s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(clone->common.function_name));
2422 zend_error(error_type, "Method %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(__call->common.function_name));
2428 zend_error(error_type, "Method %s::%s() must be static", ZSTR_VAL(scope->name), ZSTR_VAL(__callstatic->common.function_name));
2434 zend_error(error_type, "Method %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(__tostring->common.function_name));
2440 zend_error(error_type, "Method %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(__get->common.function_name));
2446 zend_error(error_type, "Method %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(__set->common.function_name));
2452 zend_error(error_type, "Method %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(__unset->common.function_name));
2458 zend_error(error_type, "Method %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(__isset->common.function_name));
2464 zend_error(error_type, "Method %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(__debugInfo->common.function_name));
2469 zend_error_noreturn(E_CORE_ERROR, "Constructor %s::%s() cannot declare a return type", ZSTR_VAL(scope->name), ZSTR_VAL(ctor->common.function_name));
2473 zend_error_noreturn(E_CORE_ERROR, "Destructor %s::%s() cannot declare a return type", ZSTR_VAL(scope->name), ZSTR_VAL(dtor->common.function_name));
2477 zend_error_noreturn(E_CORE_ERROR, "%s::%s() cannot declare a return type", ZSTR_VAL(scope->name), ZSTR_VAL(clone->common.function_name));
2899 fn->common.scope == disabled_class) {
2908 static int zend_is_callable_check_class(zend_string *name, zend_class_entry *scope, zend_fcall_info_cache *fcc, int *strict_class, char **error) /* {{{ */
2921 if (!scope) {
2922 if (error) *error = estrdup("cannot access self:: when no class scope is active");
2925 fcc->calling_scope = scope;
2932 if (!scope) {
2933 if (error) *error = estrdup("cannot access parent:: when no class scope is active");
2934 } else if (!scope->parent) {
2935 if (error) *error = estrdup("cannot access parent:: when current class scope has no parent");
2938 fcc->calling_scope = scope->parent;
2949 if (error) *error = estrdup("cannot access static:: when no class scope is active");
2960 zend_class_entry *scope;
2966 scope = ex ? ex->func->common.scope : NULL;
2968 if (scope && !fcc->object) {
2972 instanceof_function(object->ce, scope) &&
2973 instanceof_function(scope, ce)) {
3016 zend_class_entry *scope;
3069 scope = ce_org;
3071 scope = zend_get_executed_scope();
3075 if (!zend_is_callable_check_class(cname, scope, fcc, &strict_class, error)) {
3114 scope = zend_get_executed_scope();
3115 if (scope &&
3116 instanceof_function(fcc->function_handler->common.scope, scope)) {
3118 zv = zend_hash_find(&scope->function_table, lmname);
3123 && priv_fbc->common.scope == scope) {
3134 scope = zend_get_executed_scope();
3135 if (fcc->function_handler->common.scope != scope) {
3137 || !zend_check_protected(zend_get_function_root_class(fcc->function_handler), scope)) {
3155 (!fcc->function_handler->common.scope ||
3156 !instanceof_function(ce_org, fcc->function_handler->common.scope))) {
3221 scope = zend_get_executed_scope();
3222 if (fcc->function_handler->common.scope != scope) {
3224 || (!zend_check_protected(zend_get_function_root_class(fcc->function_handler), scope))) {
4107 ZEND_API void zend_update_property_ex(zend_class_entry *scope, zval *object, zend_string *name, zval *value) /* {{{ */
4112 EG(fake_scope) = scope;
4121 ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zval *value) /* {{{ */
4126 EG(fake_scope) = scope;
4136 ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, size_t name_length) /* {{{ */
4141 zend_update_property(scope, object, name, name_length, &tmp);
4145 ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length) /* {{{ */
4150 EG(fake_scope) = scope;
4160 ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value) /* {{{ */
4165 zend_update_property(scope, object, name, name_length, &tmp);
4169 ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value) /* {{{ */
4174 zend_update_property(scope, object, name, name_length, &tmp);
4178 ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, size_t name_length, double value) /* {{{ */
4183 zend_update_property(scope, object, name, name_length, &tmp);
4187 ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_string *value) /* {{{ */
4192 zend_update_property(scope, object, name, name_length, &tmp);
4196 ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value) /* {{{ */
4202 zend_update_property(scope, object, name, name_length, &tmp);
4206 ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_len) /* {{{ */
4212 zend_update_property(scope, object, name, name_length, &tmp);
4216 ZEND_API int zend_update_static_property_ex(zend_class_entry *scope, zend_string *name, zval *value) /* {{{ */
4222 if (UNEXPECTED(!(scope->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) {
4223 if (UNEXPECTED(zend_update_class_constants(scope)) != SUCCESS) {
4228 EG(fake_scope) = scope;
4229 property = zend_std_get_static_property_with_info(scope, name, BP_VAR_W, &prop_info);
4252 ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value) /* {{{ */
4255 int retval = zend_update_static_property_ex(scope, key, value);
4261 ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length) /* {{{ */
4266 return zend_update_static_property(scope, name, name_length, &tmp);
4270 ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, size_t name_length, zend_long value) /* {{{ */
4275 return zend_update_static_property(scope, name, name_length, &tmp);
4279 ZEND_API int zend_update_static_property_long(zend_class_entry *scope, const char *name, size_t name_length, zend_long value) /* {{{ */
4284 return zend_update_static_property(scope, name, name_length, &tmp);
4288 ZEND_API int zend_update_static_property_double(zend_class_entry *scope, const char *name, size_t name_length, double value) /* {{{ */
4293 return zend_update_static_property(scope, name, name_length, &tmp);
4297 ZEND_API int zend_update_static_property_string(zend_class_entry *scope, const char *name, size_t name_length, const char *value) /* {{{ */
4303 return zend_update_static_property(scope, name, name_length, &tmp);
4307 ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const char *name, size_t name_length, const char *value, size_t value_len) /* {{{ */
4313 return zend_update_static_property(scope, name, name_length, &tmp);
4317 ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zval *object, zend_string *name, zend_bool silent, zval *rv) /* {{{ */
4322 EG(fake_scope) = scope;
4332 ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_bool silent, zval *rv) /* {{{ */
4338 value = zend_read_property_ex(scope, object, str, silent, rv);
4344 ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent) /* {{{ */
4349 EG(fake_scope) = scope;
4350 property = zend_std_get_static_property(scope, name, silent ? BP_VAR_IS : BP_VAR_R);
4357 ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */
4360 zval *property = zend_read_static_property_ex(scope, key, silent);
4419 !f->common.scope ||
4420 !f->common.scope->trait_aliases) {
4434 return zend_find_alias_name(f->common.scope, name);