mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Remove need to pass error level
This commit is contained in:
parent
5a99c07ecc
commit
22c38b2ef5
16 changed files with 938 additions and 941 deletions
21
Zend/zend.c
21
Zend/zend.c
|
@ -1292,26 +1292,21 @@ ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ..
|
|||
# endif
|
||||
#endif
|
||||
|
||||
ZEND_API void zend_throw_error(zend_class_entry *exception_ce, int type, const char *format, ...) /* {{{ */
|
||||
ZEND_API void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
|
||||
{
|
||||
va_list va;
|
||||
char *message = NULL;
|
||||
|
||||
|
||||
va_start(va, format);
|
||||
zend_vspprintf(&message, 0, format, va);
|
||||
|
||||
if (type & E_EXCEPTION) {
|
||||
type = E_ERROR; // Convert to E_ERROR if unable to throw.
|
||||
//TODO: we can't convert compile-time errors to exceptions yet???
|
||||
if (EG(current_execute_data) && !CG(in_compilation)) {
|
||||
zend_throw_exception(exception_ce, message, type);
|
||||
efree(message);
|
||||
va_end(va);
|
||||
return;
|
||||
}
|
||||
// TODO: we can't convert compile-time errors to exceptions yet???
|
||||
if (EG(current_execute_data) && !CG(in_compilation)) {
|
||||
zend_throw_exception(exception_ce, message, E_ERROR);
|
||||
} else {
|
||||
zend_error(E_ERROR, message);
|
||||
}
|
||||
|
||||
zend_error(type, message);
|
||||
|
||||
efree(message);
|
||||
va_end(va);
|
||||
}
|
||||
|
|
|
@ -285,7 +285,7 @@ extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
|
|||
extern ZEND_API zend_string *(*zend_resolve_path)(const char *filename, int filename_len);
|
||||
|
||||
ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
|
||||
ZEND_API void zend_throw_error(zend_class_entry *exception_ce, int type, const char *format, ...);
|
||||
ZEND_API void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...);
|
||||
ZEND_API void zend_type_error(const char *format, ...);
|
||||
ZEND_API void zend_internal_type_error(zend_bool throw_exception, const char *format, ...);
|
||||
|
||||
|
|
|
@ -244,8 +244,11 @@ ZEND_API void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, cha
|
|||
if (severity == E_WARNING) {
|
||||
zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be a valid callback, %s",
|
||||
class_name, space, get_active_function_name(), num, error);
|
||||
} else if (severity == E_ERROR) {
|
||||
zend_throw_error(zend_ce_error, "%s%s%s() expects parameter %d to be a valid callback, %s",
|
||||
class_name, space, get_active_function_name(), num, error);
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, severity, "%s%s%s() expects parameter %d to be a valid callback, %s",
|
||||
zend_error(severity, "%s%s%s() expects parameter %d to be a valid callback, %s",
|
||||
class_name, space, get_active_function_name(), num, error);
|
||||
}
|
||||
efree(error);
|
||||
|
@ -710,7 +713,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
|
|||
break;
|
||||
} else {
|
||||
if (is_callable_error) {
|
||||
*severity = E_EXCEPTION;
|
||||
*severity = E_ERROR;
|
||||
zend_spprintf(error, 0, "to be a valid callback, %s", is_callable_error);
|
||||
efree(is_callable_error);
|
||||
return "";
|
||||
|
@ -1273,11 +1276,11 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
|
|||
{
|
||||
if (UNEXPECTED(class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) {
|
||||
if (class_type->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot instantiate interface %s", ZSTR_VAL(class_type->name));
|
||||
zend_throw_error(zend_ce_error, "Cannot instantiate interface %s", ZSTR_VAL(class_type->name));
|
||||
} else if (class_type->ce_flags & ZEND_ACC_TRAIT) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot instantiate trait %s", ZSTR_VAL(class_type->name));
|
||||
zend_throw_error(zend_ce_error, "Cannot instantiate trait %s", ZSTR_VAL(class_type->name));
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot instantiate abstract class %s", ZSTR_VAL(class_type->name));
|
||||
zend_throw_error(zend_ce_error, "Cannot instantiate abstract class %s", ZSTR_VAL(class_type->name));
|
||||
}
|
||||
ZVAL_NULL(arg);
|
||||
Z_OBJ_P(arg) = NULL;
|
||||
|
@ -3104,7 +3107,7 @@ get_function_via_handler:
|
|||
zend_spprintf(error, 0, "cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
|
||||
retval = 0;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
|
||||
zend_throw_error(zend_ce_error, "Cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
|
||||
return 0;
|
||||
}
|
||||
} else if (!fcc->object && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
|
@ -3115,7 +3118,7 @@ get_function_via_handler:
|
|||
verb = "should not";
|
||||
} else {
|
||||
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
|
||||
severity = E_EXCEPTION;
|
||||
severity = E_ERROR;
|
||||
verb = "cannot";
|
||||
}
|
||||
if ((check_flags & IS_CALLABLE_CHECK_IS_STATIC) != 0) {
|
||||
|
@ -3127,7 +3130,11 @@ get_function_via_handler:
|
|||
retval = 0;
|
||||
}
|
||||
} else if (retval) {
|
||||
zend_throw_error(zend_ce_error, severity, "Non-static method %s::%s() %s be called statically", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name), verb);
|
||||
if (severity == E_ERROR) {
|
||||
zend_throw_error(zend_ce_error, "Non-static method %s::%s() %s be called statically", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name), verb);
|
||||
} else {
|
||||
zend_error(severity, "Non-static method %s::%s() %s be called statically", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name), verb);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (retval && (check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0) {
|
||||
|
|
|
@ -203,7 +203,7 @@ static int zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
|
|||
zend_hash_index_update(Z_ARRVAL_P(result), zend_dval_to_lval(Z_DVAL_P(offset)), expr);
|
||||
break;
|
||||
default:
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Illegal offset type");
|
||||
zend_throw_error(zend_ce_error, "Illegal offset type");
|
||||
return FAILURE;
|
||||
}
|
||||
return SUCCESS;
|
||||
|
@ -405,7 +405,7 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
|
|||
}
|
||||
break;
|
||||
default:
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Unsupported constant expression");
|
||||
zend_throw_error(zend_ce_error, "Unsupported constant expression");
|
||||
ret = FAILURE;
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#define ZEND_CLOSURE_PRINT_NAME "Closure object"
|
||||
|
||||
#define ZEND_CLOSURE_PROPERTY_ERROR() \
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Closure object cannot have properties")
|
||||
zend_throw_error(zend_ce_error, "Closure object cannot have properties")
|
||||
|
||||
typedef struct _zend_closure {
|
||||
zend_object std;
|
||||
|
@ -53,7 +53,7 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
|
|||
arguments = emalloc(sizeof(zval) * ZEND_NUM_ARGS());
|
||||
if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), arguments) == FAILURE) {
|
||||
efree(arguments);
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot get arguments for calling closure");
|
||||
zend_throw_error(zend_ce_error, "Cannot get arguments for calling closure");
|
||||
RETVAL_FALSE;
|
||||
} else if (call_user_function_ex(CG(function_table), NULL, getThis(), return_value, ZEND_NUM_ARGS(), arguments, 1, NULL) == FAILURE) {
|
||||
RETVAL_FALSE;
|
||||
|
@ -207,7 +207,7 @@ ZEND_METHOD(Closure, bind)
|
|||
|
||||
static zend_function *zend_closure_get_constructor(zend_object *object) /* {{{ */
|
||||
{
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Instantiation of 'Closure' is not allowed");
|
||||
zend_throw_error(zend_ce_error, "Instantiation of 'Closure' is not allowed");
|
||||
return NULL;
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -450,7 +450,7 @@ static HashTable *zend_closure_get_gc(zval *obj, zval **table, int *n) /* {{{ */
|
|||
Private constructor preventing instantiation */
|
||||
ZEND_METHOD(Closure, __construct)
|
||||
{
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Instantiation of 'Closure' is not allowed");
|
||||
zend_throw_error(zend_ce_error, "Instantiation of 'Closure' is not allowed");
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
|
|
@ -333,17 +333,17 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
|||
if (class_name_len == sizeof("self")-1 &&
|
||||
!memcmp(lcname, "self", sizeof("self")-1)) {
|
||||
if (UNEXPECTED(!scope)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access self:: when no class scope is active");
|
||||
zend_throw_error(zend_ce_error, "Cannot access self:: when no class scope is active");
|
||||
return NULL;
|
||||
}
|
||||
ce = scope;
|
||||
} else if (class_name_len == sizeof("parent")-1 &&
|
||||
!memcmp(lcname, "parent", sizeof("parent")-1)) {
|
||||
if (UNEXPECTED(!scope)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access parent:: when no class scope is active");
|
||||
zend_throw_error(zend_ce_error, "Cannot access parent:: when no class scope is active");
|
||||
return NULL;
|
||||
} else if (UNEXPECTED(!scope->parent)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access parent:: when current class scope has no parent");
|
||||
zend_throw_error(zend_ce_error, "Cannot access parent:: when current class scope has no parent");
|
||||
return NULL;
|
||||
} else {
|
||||
ce = scope->parent;
|
||||
|
@ -352,7 +352,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
|||
!memcmp(lcname, "static", sizeof("static")-1)) {
|
||||
ce = zend_get_called_scope(EG(current_execute_data));
|
||||
if (UNEXPECTED(!ce)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access static:: when no class scope is active");
|
||||
zend_throw_error(zend_ce_error, "Cannot access static:: when no class scope is active");
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
|
@ -363,7 +363,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
|||
ret_constant = zend_hash_find(&ce->constants_table, constant_name);
|
||||
if (ret_constant == NULL) {
|
||||
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined class constant '%s::%s'", ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
|
||||
zend_throw_error(zend_ce_error, "Undefined class constant '%s::%s'", ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
|
||||
zend_string_release(class_name);
|
||||
zend_string_free(constant_name);
|
||||
return NULL;
|
||||
|
|
|
@ -261,7 +261,7 @@ ZEND_METHOD(exception, __construct)
|
|||
} else {
|
||||
ce = base_ce;
|
||||
}
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Wrong parameters for %s([string $message [, long $code [, Throwable $previous = NULL]]])", ZSTR_VAL(ce->name));
|
||||
zend_throw_error(zend_ce_error, "Wrong parameters for %s([string $message [, long $code [, Throwable $previous = NULL]]])", ZSTR_VAL(ce->name));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -297,7 +297,7 @@ ZEND_METHOD(error_exception, __construct)
|
|||
} else {
|
||||
ce = zend_ce_error_exception;
|
||||
}
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Wrong parameters for %s([string $message [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Throwable $previous = NULL]]]]]])", ZSTR_VAL(ce->name));
|
||||
zend_throw_error(zend_ce_error, "Wrong parameters for %s([string $message [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Throwable $previous = NULL]]]]]])", ZSTR_VAL(ce->name));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1033,7 +1033,7 @@ ZEND_API void zend_throw_exception_object(zval *exception) /* {{{ */
|
|||
exception_ce = Z_OBJCE_P(exception);
|
||||
|
||||
if (!exception_ce || !instanceof_function(exception_ce, zend_ce_throwable)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot throw objects that do not implement Throwable");
|
||||
zend_throw_error(zend_ce_error, "Cannot throw objects that do not implement Throwable");
|
||||
return;
|
||||
}
|
||||
zend_throw_exception_internal(exception);
|
||||
|
|
|
@ -1201,7 +1201,7 @@ static zend_never_inline void zend_assign_to_object_dim(zval *retval, zval *obje
|
|||
|
||||
/* Note: property_name in this case is really the array index! */
|
||||
if (!Z_OBJ_HT_P(object)->write_dimension) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use object as array");
|
||||
FREE_OP(free_value);
|
||||
return;
|
||||
}
|
||||
|
@ -1681,7 +1681,7 @@ convert_to_array:
|
|||
}
|
||||
|
||||
if (dim == NULL) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings");
|
||||
zend_throw_error(zend_ce_error, "[] operator not supported for strings");
|
||||
ZVAL_NULL(result);
|
||||
} else {
|
||||
zend_check_string_offset(dim, type);
|
||||
|
@ -1689,7 +1689,7 @@ convert_to_array:
|
|||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
|
||||
if (!Z_OBJ_HT_P(container)->read_dimension) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use object as array");
|
||||
retval = &EG(error_zval);
|
||||
} else {
|
||||
retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result);
|
||||
|
@ -1830,7 +1830,7 @@ try_string_offset:
|
|||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
|
||||
if (!Z_OBJ_HT_P(container)->read_dimension) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use object as array");
|
||||
ZVAL_NULL(result);
|
||||
} else {
|
||||
retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result);
|
||||
|
@ -1922,7 +1922,7 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
|
|||
ZVAL_INDIRECT(result, ptr);
|
||||
}
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access undefined property for object with overloaded property access");
|
||||
zend_throw_error(zend_ce_error, "Cannot access undefined property for object with overloaded property access");
|
||||
ZVAL_INDIRECT(result, &EG(error_zval));
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -204,7 +204,6 @@ static int zval_call_destructor(zval *zv) /* {{{ */
|
|||
|
||||
static void zend_unclean_zval_ptr_dtor(zval *zv) /* {{{ */
|
||||
{
|
||||
|
||||
if (Z_TYPE_P(zv) == IS_INDIRECT) {
|
||||
zv = Z_INDIRECT_P(zv);
|
||||
}
|
||||
|
@ -528,13 +527,20 @@ ZEND_API void _zval_internal_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) /* {{{ *
|
|||
#define MARK_CONSTANT_VISITED(p) Z_TYPE_INFO_P(p) |= IS_VISITED_CONSTANT
|
||||
#define RESET_CONSTANT_VISITED(p) Z_TYPE_INFO_P(p) &= ~IS_VISITED_CONSTANT
|
||||
|
||||
#define THROW_OR_ERROR(fetch_type, ce, message, ...) \
|
||||
if (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) { \
|
||||
zend_throw_error(ce, message, ##__VA_ARGS__); \
|
||||
} else { \
|
||||
zend_error(E_ERROR, message, ##__VA_ARGS__); \
|
||||
}
|
||||
|
||||
ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_class_entry *scope) /* {{{ */
|
||||
{
|
||||
zval *const_value;
|
||||
char *colon;
|
||||
|
||||
if (IS_CONSTANT_VISITED(p)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot declare self-referencing constant '%s'", Z_STRVAL_P(p));
|
||||
zend_throw_error(zend_ce_error, "Cannot declare self-referencing constant '%s'", Z_STRVAL_P(p));
|
||||
return FAILURE;
|
||||
} else if (Z_TYPE_P(p) == IS_CONSTANT) {
|
||||
int refcount;
|
||||
|
@ -559,7 +565,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
|
|||
RESET_CONSTANT_VISITED(p);
|
||||
return FAILURE;
|
||||
} else if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRLEN_P(p)))) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined class constant '%s'", Z_STRVAL_P(p));
|
||||
zend_throw_error(zend_ce_error, "Undefined class constant '%s'", Z_STRVAL_P(p));
|
||||
RESET_CONSTANT_VISITED(p);
|
||||
return FAILURE;
|
||||
} else {
|
||||
|
@ -586,9 +592,9 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
|
|||
}
|
||||
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) == 0) {
|
||||
if (ZSTR_VAL(save)[0] == '\\') {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined constant '%s'", ZSTR_VAL(save) + 1);
|
||||
zend_throw_error(zend_ce_error, "Undefined constant '%s'", ZSTR_VAL(save) + 1);
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined constant '%s'", ZSTR_VAL(save));
|
||||
zend_throw_error(zend_ce_error, "Undefined constant '%s'", ZSTR_VAL(save));
|
||||
}
|
||||
if (inline_change) {
|
||||
zend_string_release(save);
|
||||
|
@ -767,7 +773,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
|||
|
||||
if (func->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
|
||||
if (func->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call abstract method %s::%s()", ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
zend_throw_error(zend_ce_error, "Cannot call abstract method %s::%s()", ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
return FAILURE;
|
||||
}
|
||||
if (func->common.fn_flags & ZEND_ACC_DEPRECATED) {
|
||||
|
@ -889,7 +895,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
|||
fci->object->handlers->call_method(func->common.function_name, fci->object, call, fci->retval);
|
||||
EG(current_execute_data) = call->prev_execute_data;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call overloaded function for non-object");
|
||||
zend_throw_error(zend_ce_error, "Cannot call overloaded function for non-object");
|
||||
}
|
||||
|
||||
zend_vm_stack_free_args(call);
|
||||
|
@ -1315,26 +1321,22 @@ check_fetch_type:
|
|||
switch (fetch_sub_type) {
|
||||
case ZEND_FETCH_CLASS_SELF:
|
||||
if (UNEXPECTED(!EG(scope))) {
|
||||
int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? E_EXCEPTION : E_ERROR;
|
||||
zend_throw_error(zend_ce_error, error_type, "Cannot access self:: when no class scope is active");
|
||||
THROW_OR_ERROR(fetch_type, zend_ce_error, "Cannot access self:: when no class scope is active")
|
||||
}
|
||||
return EG(scope);
|
||||
case ZEND_FETCH_CLASS_PARENT:
|
||||
if (UNEXPECTED(!EG(scope))) {
|
||||
int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? E_EXCEPTION : E_ERROR;
|
||||
zend_throw_error(zend_ce_error, error_type, "Cannot access parent:: when no class scope is active");
|
||||
THROW_OR_ERROR(fetch_type, zend_ce_error, "Cannot access parent:: when no class scope is active");
|
||||
return NULL;
|
||||
}
|
||||
if (UNEXPECTED(!EG(scope)->parent)) {
|
||||
int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? E_EXCEPTION : E_ERROR;
|
||||
zend_throw_error(zend_ce_error, error_type, "Cannot access parent:: when current class scope has no parent");
|
||||
THROW_OR_ERROR(fetch_type, zend_ce_error, "Cannot access parent:: when current class scope has no parent");
|
||||
}
|
||||
return EG(scope)->parent;
|
||||
case ZEND_FETCH_CLASS_STATIC:
|
||||
ce = zend_get_called_scope(EG(current_execute_data));
|
||||
if (UNEXPECTED(!ce)) {
|
||||
int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? E_EXCEPTION : E_ERROR;
|
||||
zend_throw_error(zend_ce_error, error_type, "Cannot access static:: when no class scope is active");
|
||||
THROW_OR_ERROR(fetch_type, zend_ce_error, "Cannot access static:: when no class scope is active");
|
||||
return NULL;
|
||||
}
|
||||
return ce;
|
||||
|
@ -1351,13 +1353,12 @@ check_fetch_type:
|
|||
return zend_lookup_class_ex(class_name, NULL, 0);
|
||||
} else if ((ce = zend_lookup_class_ex(class_name, NULL, 1)) == NULL) {
|
||||
if (!(fetch_type & ZEND_FETCH_CLASS_SILENT) && !EG(exception)) {
|
||||
int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? E_EXCEPTION : E_ERROR;
|
||||
if (fetch_sub_type == ZEND_FETCH_CLASS_INTERFACE) {
|
||||
zend_throw_error(zend_ce_error, error_type, "Interface '%s' not found", ZSTR_VAL(class_name));
|
||||
THROW_OR_ERROR(fetch_type, zend_ce_error, "Interface '%s' not found", ZSTR_VAL(class_name));
|
||||
} else if (fetch_sub_type == ZEND_FETCH_CLASS_TRAIT) {
|
||||
zend_throw_error(zend_ce_error, error_type, "Trait '%s' not found", ZSTR_VAL(class_name));
|
||||
THROW_OR_ERROR(fetch_type, zend_ce_error, "Trait '%s' not found", ZSTR_VAL(class_name));
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, error_type, "Class '%s' not found", ZSTR_VAL(class_name));
|
||||
THROW_OR_ERROR(fetch_type, zend_ce_error, "Class '%s' not found", ZSTR_VAL(class_name));
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
@ -1374,13 +1375,12 @@ zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *
|
|||
return zend_lookup_class_ex(class_name, key, 0);
|
||||
} else if ((ce = zend_lookup_class_ex(class_name, key, 1)) == NULL) {
|
||||
if ((fetch_type & ZEND_FETCH_CLASS_SILENT) == 0 && !EG(exception)) {
|
||||
int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? E_EXCEPTION : E_ERROR;
|
||||
if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) {
|
||||
zend_throw_error(zend_ce_error, error_type, "Interface '%s' not found", ZSTR_VAL(class_name));
|
||||
THROW_OR_ERROR(fetch_type, zend_ce_error, "Interface '%s' not found", ZSTR_VAL(class_name));
|
||||
} else if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_TRAIT) {
|
||||
zend_throw_error(zend_ce_error, error_type, "Trait '%s' not found", ZSTR_VAL(class_name));
|
||||
THROW_OR_ERROR(fetch_type, zend_ce_error, "Trait '%s' not found", ZSTR_VAL(class_name));
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, error_type, "Class '%s' not found", ZSTR_VAL(class_name));
|
||||
THROW_OR_ERROR(fetch_type, zend_ce_error, "Class '%s' not found", ZSTR_VAL(class_name));
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
@ -265,7 +265,7 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array
|
|||
|
||||
static zend_function *zend_generator_get_constructor(zend_object *object) /* {{{ */
|
||||
{
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "The \"Generator\" class is reserved for internal use and cannot be manually instantiated");
|
||||
zend_throw_error(zend_ce_error, "The \"Generator\" class is reserved for internal use and cannot be manually instantiated");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -637,7 +637,7 @@ ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */
|
|||
|
||||
try_again:
|
||||
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot resume an already running generator");
|
||||
zend_throw_error(zend_ce_error, "Cannot resume an already running generator");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zva
|
|||
zend_user_iterator *iterator;
|
||||
|
||||
if (by_ref) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "An iterator cannot be used with foreach by reference");
|
||||
zend_throw_error(zend_ce_error, "An iterator cannot be used with foreach by reference");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -304,9 +304,9 @@ static zend_always_inline uint32_t zend_get_property_offset(zend_class_entry *ce
|
|||
if (UNEXPECTED(ZSTR_VAL(member)[0] == '\0')) {
|
||||
if (!silent) {
|
||||
if (ZSTR_LEN(member) == 0) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access empty property");
|
||||
zend_throw_error(zend_ce_error, "Cannot access empty property");
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access property started with '\\0'");
|
||||
zend_throw_error(zend_ce_error, "Cannot access property started with '\\0'");
|
||||
}
|
||||
}
|
||||
return ZEND_WRONG_PROPERTY_OFFSET;
|
||||
|
@ -360,7 +360,7 @@ exit_dynamic:
|
|||
} else if (UNEXPECTED(property_info == ZEND_WRONG_PROPERTY_INFO)) {
|
||||
/* Information was available, but we were denied access. Error out. */
|
||||
if (!silent) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access %s property %s::$%s", zend_visibility_string(flags), ZSTR_VAL(ce->name), ZSTR_VAL(member));
|
||||
zend_throw_error(zend_ce_error, "Cannot access %s property %s::$%s", zend_visibility_string(flags), ZSTR_VAL(ce->name), ZSTR_VAL(member));
|
||||
}
|
||||
return ZEND_WRONG_PROPERTY_OFFSET;
|
||||
}
|
||||
|
@ -382,9 +382,9 @@ ZEND_API zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_s
|
|||
if (UNEXPECTED(ZSTR_VAL(member)[0] == '\0')) {
|
||||
if (!silent) {
|
||||
if (ZSTR_LEN(member) == 0) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access empty property");
|
||||
zend_throw_error(zend_ce_error, "Cannot access empty property");
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access property started with '\\0'");
|
||||
zend_throw_error(zend_ce_error, "Cannot access property started with '\\0'");
|
||||
}
|
||||
}
|
||||
return ZEND_WRONG_PROPERTY_INFO;
|
||||
|
@ -431,7 +431,7 @@ exit_dynamic:
|
|||
} else if (UNEXPECTED(property_info == ZEND_WRONG_PROPERTY_INFO)) {
|
||||
/* Information was available, but we were denied access. Error out. */
|
||||
if (!silent) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access %s property %s::$%s", zend_visibility_string(flags), ZSTR_VAL(ce->name), ZSTR_VAL(member));
|
||||
zend_throw_error(zend_ce_error, "Cannot access %s property %s::$%s", zend_visibility_string(flags), ZSTR_VAL(ce->name), ZSTR_VAL(member));
|
||||
}
|
||||
return ZEND_WRONG_PROPERTY_INFO;
|
||||
}
|
||||
|
@ -578,11 +578,11 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
|
|||
} else {
|
||||
if (Z_STRVAL_P(member)[0] == '\0') {
|
||||
if (Z_STRLEN_P(member) == 0) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access empty property");
|
||||
zend_throw_error(zend_ce_error, "Cannot access empty property");
|
||||
retval = &EG(uninitialized_zval);
|
||||
goto exit;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access property started with '\\0'");
|
||||
zend_throw_error(zend_ce_error, "Cannot access property started with '\\0'");
|
||||
retval = &EG(uninitialized_zval);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -664,10 +664,10 @@ found:
|
|||
} else {
|
||||
if (Z_STRVAL_P(member)[0] == '\0') {
|
||||
if (Z_STRLEN_P(member) == 0) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access empty property");
|
||||
zend_throw_error(zend_ce_error, "Cannot access empty property");
|
||||
goto exit;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access property started with '\\0'");
|
||||
zend_throw_error(zend_ce_error, "Cannot access property started with '\\0'");
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
@ -721,13 +721,13 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /*
|
|||
|
||||
if (UNEXPECTED(Z_TYPE_P(rv) == IS_UNDEF)) {
|
||||
if (UNEXPECTED(!EG(exception))) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined offset for object of type %s used as array", ZSTR_VAL(ce->name));
|
||||
zend_throw_error(zend_ce_error, "Undefined offset for object of type %s used as array", ZSTR_VAL(ce->name));
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
return rv;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
zend_throw_error(zend_ce_error, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -748,7 +748,7 @@ static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /*
|
|||
zend_call_method_with_2_params(object, ce, NULL, "offsetset", NULL, offset, value);
|
||||
zval_ptr_dtor(offset);
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
zend_throw_error(zend_ce_error, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -777,7 +777,7 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) /
|
|||
}
|
||||
zval_ptr_dtor(offset);
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
zend_throw_error(zend_ce_error, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
return 0;
|
||||
}
|
||||
return result;
|
||||
|
@ -914,10 +914,10 @@ static void zend_std_unset_property(zval *object, zval *member, void **cache_slo
|
|||
} else {
|
||||
if (Z_STRVAL_P(member)[0] == '\0') {
|
||||
if (Z_STRLEN_P(member) == 0) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access empty property");
|
||||
zend_throw_error(zend_ce_error, "Cannot access empty property");
|
||||
goto exit;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access property started with '\\0'");
|
||||
zend_throw_error(zend_ce_error, "Cannot access property started with '\\0'");
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
@ -940,7 +940,7 @@ static void zend_std_unset_dimension(zval *object, zval *offset) /* {{{ */
|
|||
zend_call_method_with_1_params(object, ce, NULL, "offsetunset", NULL, offset);
|
||||
zval_ptr_dtor(offset);
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
zend_throw_error(zend_ce_error, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -1115,7 +1115,7 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
|
|||
if (zobj->ce->__call) {
|
||||
fbc = zend_get_user_call_function(zobj->ce, method_name);
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), ZSTR_VAL(method_name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
zend_throw_error(zend_ce_error, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), ZSTR_VAL(method_name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
fbc = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1142,7 +1142,7 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
|
|||
if (zobj->ce->__call) {
|
||||
fbc = zend_get_user_call_function(zobj->ce, method_name);
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), ZSTR_VAL(method_name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
zend_throw_error(zend_ce_error, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), ZSTR_VAL(method_name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
fbc = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1235,7 +1235,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
|
|||
if (ce->__callstatic) {
|
||||
fbc = zend_get_user_callstatic_function(ce, function_name);
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), ZSTR_VAL(function_name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
zend_throw_error(zend_ce_error, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), ZSTR_VAL(function_name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
fbc = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1246,7 +1246,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
|
|||
if (ce->__callstatic) {
|
||||
fbc = zend_get_user_callstatic_function(ce, function_name);
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), ZSTR_VAL(function_name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
zend_throw_error(zend_ce_error, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), ZSTR_VAL(function_name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
fbc = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1271,7 +1271,7 @@ ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *p
|
|||
|
||||
if (UNEXPECTED(!zend_verify_property_access(property_info, ce))) {
|
||||
if (!silent) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ZSTR_VAL(ce->name), ZSTR_VAL(property_name));
|
||||
zend_throw_error(zend_ce_error, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ZSTR_VAL(ce->name), ZSTR_VAL(property_name));
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1291,7 +1291,7 @@ ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *p
|
|||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
undeclared_property:
|
||||
if (!silent) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(property_name));
|
||||
zend_throw_error(zend_ce_error, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(property_name));
|
||||
}
|
||||
ret = NULL;
|
||||
}
|
||||
|
@ -1302,7 +1302,7 @@ undeclared_property:
|
|||
|
||||
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name) /* {{{ */
|
||||
{
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Attempt to unset static property %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(property_name));
|
||||
zend_throw_error(zend_ce_error, "Attempt to unset static property %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(property_name));
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -1319,10 +1319,10 @@ ZEND_API union _zend_function *zend_std_get_constructor(zend_object *zobj) /* {{
|
|||
*/
|
||||
if (UNEXPECTED(constructor->common.scope != EG(scope))) {
|
||||
if (EG(scope)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to private %s::%s() from context '%s'", ZSTR_VAL(constructor->common.scope->name), ZSTR_VAL(constructor->common.function_name), ZSTR_VAL(EG(scope)->name));
|
||||
zend_throw_error(zend_ce_error, "Call to private %s::%s() from context '%s'", ZSTR_VAL(constructor->common.scope->name), ZSTR_VAL(constructor->common.function_name), ZSTR_VAL(EG(scope)->name));
|
||||
constructor = NULL;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to private %s::%s() from invalid context", ZSTR_VAL(constructor->common.scope->name), ZSTR_VAL(constructor->common.function_name));
|
||||
zend_throw_error(zend_ce_error, "Call to private %s::%s() from invalid context", ZSTR_VAL(constructor->common.scope->name), ZSTR_VAL(constructor->common.function_name));
|
||||
constructor = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1333,10 +1333,10 @@ ZEND_API union _zend_function *zend_std_get_constructor(zend_object *zobj) /* {{
|
|||
*/
|
||||
if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(constructor), EG(scope)))) {
|
||||
if (EG(scope)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to protected %s::%s() from context '%s'", ZSTR_VAL(constructor->common.scope->name), ZSTR_VAL(constructor->common.function_name), ZSTR_VAL(EG(scope)->name));
|
||||
zend_throw_error(zend_ce_error, "Call to protected %s::%s() from context '%s'", ZSTR_VAL(constructor->common.scope->name), ZSTR_VAL(constructor->common.function_name), ZSTR_VAL(EG(scope)->name));
|
||||
constructor = NULL;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to protected %s::%s() from invalid context", ZSTR_VAL(constructor->common.scope->name), ZSTR_VAL(constructor->common.function_name));
|
||||
zend_throw_error(zend_ce_error, "Call to protected %s::%s() from invalid context", ZSTR_VAL(constructor->common.scope->name), ZSTR_VAL(constructor->common.function_name));
|
||||
constructor = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,11 +93,17 @@ ZEND_API void zend_objects_destroy_object(zend_object *object)
|
|||
if (object->ce != EG(scope)) {
|
||||
zend_class_entry *ce = object->ce;
|
||||
|
||||
zend_throw_error(zend_ce_error, EG(current_execute_data) ? E_EXCEPTION : E_WARNING,
|
||||
"Call to private %s::__destruct() from context '%s'%s",
|
||||
ZSTR_VAL(ce->name),
|
||||
EG(scope) ? ZSTR_VAL(EG(scope)->name) : "",
|
||||
EG(current_execute_data) ? "" : " during shutdown ignored");
|
||||
if (EG(current_execute_data)) {
|
||||
zend_throw_error(zend_ce_error,
|
||||
"Call to private %s::__destruct() from context '%s'",
|
||||
ZSTR_VAL(ce->name),
|
||||
EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
} else {
|
||||
zend_error(E_WARNING,
|
||||
"Call to private %s::__destruct() from context '%s' during shutdown ignored",
|
||||
ZSTR_VAL(ce->name),
|
||||
EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -106,11 +112,17 @@ ZEND_API void zend_objects_destroy_object(zend_object *object)
|
|||
if (!zend_check_protected(zend_get_function_root_class(destructor), EG(scope))) {
|
||||
zend_class_entry *ce = object->ce;
|
||||
|
||||
zend_throw_error(zend_ce_error, EG(current_execute_data) ? E_EXCEPTION : E_WARNING,
|
||||
"Call to protected %s::__destruct() from context '%s'%s",
|
||||
ZSTR_VAL(ce->name),
|
||||
EG(scope) ? ZSTR_VAL(EG(scope)->name) : "",
|
||||
EG(current_execute_data) ? "" : " during shutdown ignored");
|
||||
if (EG(current_execute_data)) {
|
||||
zend_throw_error(zend_ce_error,
|
||||
"Call to protected %s::__destruct() from context '%s'",
|
||||
ZSTR_VAL(ce->name),
|
||||
EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
} else {
|
||||
zend_error(E_WARNING,
|
||||
"Call to protected %s::__destruct() from context '%s' during shutdown ignored",
|
||||
ZSTR_VAL(ce->name),
|
||||
EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -907,7 +907,7 @@ ZEND_API int ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2) /* {
|
|||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Unsupported operand types");
|
||||
zend_throw_error(zend_ce_error, "Unsupported operand types");
|
||||
return FAILURE; /* unknown datatype */
|
||||
}
|
||||
}
|
||||
|
@ -960,7 +960,7 @@ ZEND_API int ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2) /* {
|
|||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Unsupported operand types");
|
||||
zend_throw_error(zend_ce_error, "Unsupported operand types");
|
||||
return FAILURE; /* unknown datatype */
|
||||
}
|
||||
}
|
||||
|
@ -1007,7 +1007,7 @@ ZEND_API int ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2) /* {
|
|||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Unsupported operand types");
|
||||
zend_throw_error(zend_ce_error, "Unsupported operand types");
|
||||
return FAILURE; /* unknown datatype */
|
||||
}
|
||||
}
|
||||
|
@ -1095,7 +1095,7 @@ ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {
|
|||
}
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Unsupported operand types");
|
||||
zend_throw_error(zend_ce_error, "Unsupported operand types");
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -1144,7 +1144,7 @@ ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {
|
|||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Unsupported operand types");
|
||||
zend_throw_error(zend_ce_error, "Unsupported operand types");
|
||||
return FAILURE; /* unknown datatype */
|
||||
}
|
||||
}
|
||||
|
@ -1294,7 +1294,7 @@ try_again:
|
|||
default:
|
||||
ZEND_TRY_UNARY_OBJECT_OPERATION(ZEND_BW_NOT);
|
||||
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Unsupported operand types");
|
||||
zend_throw_error(zend_ce_error, "Unsupported operand types");
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -1611,7 +1611,7 @@ ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) /
|
|||
zend_string *result_str;
|
||||
|
||||
if (UNEXPECTED(op1_len > SIZE_MAX - op2_len)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "String size overflow");
|
||||
zend_throw_error(zend_ce_error, "String size overflow");
|
||||
ZVAL_FALSE(result);
|
||||
return FAILURE;
|
||||
}
|
||||
|
|
|
@ -721,7 +721,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|
|
|||
object = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var);
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -730,7 +730,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|
|
|||
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an object");
|
||||
FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var);
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -785,13 +785,13 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_dim_helper, VAR|UNUSED|CV, CONST|TMPVAR|
|
|||
SAVE_OPLINE();
|
||||
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW);
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var);
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an array");
|
||||
FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var);
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -817,7 +817,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_dim_helper, VAR|UNUSED|CV, CONST|TMPVAR|
|
|||
var_ptr = Z_INDIRECT(rv);
|
||||
|
||||
if (UNEXPECTED(var_ptr == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot use assign-op operators with overloaded objects nor string offsets");
|
||||
FREE_OP2();
|
||||
FREE_OP(free_op_data1);
|
||||
FREE_OP1_VAR_PTR();
|
||||
|
@ -860,7 +860,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|CV, CONST|TMPVAR|CV, binary_
|
|||
var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot use assign-op operators with overloaded objects nor string offsets");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1118,7 +1118,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C
|
|||
object = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1126,7 +1126,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C
|
|||
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1200,7 +1200,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|
|
|||
object = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1208,7 +1208,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|
|
|||
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1276,7 +1276,7 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY)
|
|||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
|
||||
SAVE_OPLINE();
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
|
@ -1323,7 +1323,7 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY)
|
|||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
|
||||
SAVE_OPLINE();
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
|
@ -1370,7 +1370,7 @@ ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY)
|
|||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
|
||||
SAVE_OPLINE();
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
|
@ -1410,7 +1410,7 @@ ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY)
|
|||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
|
||||
SAVE_OPLINE();
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot increment/decrement overloaded objects nor string offsets");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
|
@ -1506,7 +1506,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
|
|||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(zend_ce_error, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1533,7 +1533,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
|
|||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(zend_ce_error, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1684,7 +1684,7 @@ ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMPVAR|UNUSED|CV)
|
|||
container = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an array");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE);
|
||||
|
@ -1707,7 +1707,7 @@ ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMPVAR|UNUSED|CV)
|
|||
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an array");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE);
|
||||
|
@ -1745,14 +1745,14 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUS
|
|||
|
||||
if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
|
||||
if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context");
|
||||
zend_throw_error(zend_ce_error, "Cannot use temporary expression in write context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
FREE_UNFETCHED_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
container = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an array");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1764,7 +1764,7 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUS
|
|||
FREE_OP1_VAR_PTR();
|
||||
} else {
|
||||
if (OP2_TYPE == IS_UNUSED) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading");
|
||||
zend_throw_error(zend_ce_error, "Cannot use [] for reading");
|
||||
FREE_UNFETCHED_OP2();
|
||||
FREE_UNFETCHED_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -1788,7 +1788,7 @@ ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMPVAR|CV)
|
|||
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_UNSET);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an array");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1814,7 +1814,7 @@ ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMP|VAR|UNUSED|CV, CONST|TMPVAR|CV)
|
|||
container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1888,12 +1888,12 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMPVAR|CV)
|
|||
|
||||
container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an object");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1920,12 +1920,12 @@ ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMPVAR|CV)
|
|||
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an object");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -1951,7 +1951,7 @@ ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMPVAR|UNUSED|CV, CONST|TMPVAR|CV)
|
|||
container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -2028,18 +2028,18 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|CV, CONST|TMPV
|
|||
container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context");
|
||||
zend_throw_error(zend_ce_error, "Cannot use temporary expression in write context");
|
||||
FREE_OP2();
|
||||
FREE_OP1_VAR_PTR();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an object");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -2066,7 +2066,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMPVAR|CV)
|
|||
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -2074,7 +2074,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMPVAR|CV)
|
|||
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an object");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -2144,7 +2144,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMPVAR|CV)
|
|||
object = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -2152,7 +2152,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMPVAR|CV)
|
|||
property_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an array");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -2179,7 +2179,7 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMPVAR|UNUSED|CV)
|
|||
object_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use string offset as an array");
|
||||
FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var);
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -2228,7 +2228,7 @@ ZEND_VM_C_LABEL(try_assign_dim_array):
|
|||
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) {
|
||||
if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
|
||||
if (OP2_TYPE == IS_UNUSED) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings");
|
||||
zend_throw_error(zend_ce_error, "[] operator not supported for strings");
|
||||
FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var);
|
||||
FREE_OP1_VAR_PTR();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -2313,7 +2313,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
|
|||
value_ptr = GET_OP2_ZVAL_PTR_PTR(BP_VAR_W);
|
||||
|
||||
if (OP2_TYPE == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets nor overloaded objects");
|
||||
zend_throw_error(zend_ce_error, "Cannot create references to/from string offsets nor overloaded objects");
|
||||
FREE_UNFETCHED_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -2334,14 +2334,14 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
|
|||
|
||||
variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(variable_ptr == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets nor overloaded objects");
|
||||
zend_throw_error(zend_ce_error, "Cannot create references to/from string offsets nor overloaded objects");
|
||||
FREE_OP2_VAR_PTR();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP1_TYPE == IS_VAR &&
|
||||
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) &&
|
||||
UNEXPECTED(!Z_ISREF_P(variable_ptr))) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot assign by reference to overloaded object");
|
||||
zend_throw_error(zend_ce_error, "Cannot assign by reference to overloaded object");
|
||||
FREE_OP2_VAR_PTR();
|
||||
FREE_OP1_VAR_PTR();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -2916,7 +2916,7 @@ ZEND_VM_C_LABEL(try_class_name):
|
|||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Class name must be a valid object or a string");
|
||||
zend_throw_error(zend_ce_error, "Class name must be a valid object or a string");
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
|
@ -2956,7 +2956,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|CV, CONST|TMPVAR
|
|||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string");
|
||||
zend_throw_error(zend_ce_error, "Method name must be a string");
|
||||
FREE_OP2();
|
||||
FREE_UNFETCHED_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -2966,7 +2966,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|CV, CONST|TMPVAR
|
|||
object = GET_OP1_OBJ_ZVAL_PTR_UNDEF(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -2986,7 +2986,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|CV, CONST|TMPVAR
|
|||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
|
||||
zend_throw_error(zend_ce_error, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
|
||||
FREE_OP2();
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -3002,7 +3002,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|CV, CONST|TMPVAR
|
|||
zend_object *orig_obj = obj;
|
||||
|
||||
if (UNEXPECTED(obj->handlers->get_method == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls");
|
||||
zend_throw_error(zend_ce_error, "Object does not support method calls");
|
||||
FREE_OP2();
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -3012,7 +3012,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|CV, CONST|TMPVAR
|
|||
fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
|
||||
if (UNEXPECTED(fbc == NULL)) {
|
||||
if (EXPECTED(!EG(exception))) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
|
||||
zend_throw_error(zend_ce_error, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
|
||||
}
|
||||
FREE_OP2();
|
||||
FREE_OP1();
|
||||
|
@ -3068,7 +3068,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
|
|||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1)));
|
||||
zend_throw_error(zend_ce_error, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1)));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
|
||||
|
@ -3097,7 +3097,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
|
|||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string");
|
||||
zend_throw_error(zend_ce_error, "Function name must be a string");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -3110,7 +3110,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
|
|||
}
|
||||
if (UNEXPECTED(fbc == NULL)) {
|
||||
if (EXPECTED(!EG(exception))) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name));
|
||||
zend_throw_error(zend_ce_error, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name));
|
||||
}
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -3129,11 +3129,11 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
|
|||
}
|
||||
} else {
|
||||
if (UNEXPECTED(ce->constructor == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call constructor");
|
||||
zend_throw_error(zend_ce_error, "Cannot call constructor");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name));
|
||||
zend_throw_error(zend_ce_error, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
fbc = ce->constructor;
|
||||
|
@ -3156,7 +3156,6 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
|
|||
* So PHP would crash by allowing the call. */
|
||||
zend_throw_error(
|
||||
zend_ce_error,
|
||||
E_EXCEPTION,
|
||||
"Non-static method %s::%s() cannot be called statically",
|
||||
ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -3194,7 +3193,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST)
|
|||
function_name = (zval*)(EX_CONSTANT(opline->op2)+1);
|
||||
if (UNEXPECTED((func = zend_hash_find(EG(function_table), Z_STR_P(function_name))) == NULL)) {
|
||||
SAVE_OPLINE();
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
|
||||
zend_throw_error(zend_ce_error, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
fbc = Z_FUNC_P(func);
|
||||
|
@ -3255,7 +3254,7 @@ ZEND_VM_C_LABEL(try_function_name):
|
|||
}
|
||||
if (UNEXPECTED(fbc == NULL)) {
|
||||
if (EXPECTED(!EG(exception))) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname));
|
||||
zend_throw_error(zend_ce_error, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname));
|
||||
}
|
||||
zend_string_release(lcname);
|
||||
zend_string_release(mname);
|
||||
|
@ -3274,7 +3273,6 @@ ZEND_VM_C_LABEL(try_function_name):
|
|||
} else {
|
||||
zend_throw_error(
|
||||
zend_ce_error,
|
||||
E_EXCEPTION,
|
||||
"Non-static method %s::%s() cannot be called statically",
|
||||
ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
|
||||
FREE_OP2();
|
||||
|
@ -3289,7 +3287,7 @@ ZEND_VM_C_LABEL(try_function_name):
|
|||
lcname = zend_string_tolower(Z_STR_P(function_name));
|
||||
}
|
||||
if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined function %s()", Z_STRVAL_P(function_name));
|
||||
zend_throw_error(zend_ce_error, "Call to undefined function %s()", Z_STRVAL_P(function_name));
|
||||
zend_string_release(lcname);
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -3320,21 +3318,21 @@ ZEND_VM_C_LABEL(try_function_name):
|
|||
method = zend_hash_index_find(Z_ARRVAL_P(function_name), 1);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Array callback has to contain indices 0 and 1");
|
||||
zend_throw_error(zend_ce_error, "Array callback has to contain indices 0 and 1");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
ZVAL_DEREF(obj);
|
||||
if (Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_OBJECT) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "First array member is not a valid class name or object");
|
||||
zend_throw_error(zend_ce_error, "First array member is not a valid class name or object");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
ZVAL_DEREF(method);
|
||||
if (Z_TYPE_P(method) != IS_STRING) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Second array member is not a valid method");
|
||||
zend_throw_error(zend_ce_error, "Second array member is not a valid method");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -3354,7 +3352,7 @@ ZEND_VM_C_LABEL(try_function_name):
|
|||
}
|
||||
if (UNEXPECTED(fbc == NULL)) {
|
||||
if (EXPECTED(!EG(exception))) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method));
|
||||
zend_throw_error(zend_ce_error, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method));
|
||||
}
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -3367,7 +3365,6 @@ ZEND_VM_C_LABEL(try_function_name):
|
|||
} else {
|
||||
zend_throw_error(
|
||||
zend_ce_error,
|
||||
E_EXCEPTION,
|
||||
"Non-static method %s::%s() cannot be called statically",
|
||||
ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
|
||||
FREE_OP2();
|
||||
|
@ -3381,7 +3378,7 @@ ZEND_VM_C_LABEL(try_function_name):
|
|||
fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL);
|
||||
if (UNEXPECTED(fbc == NULL)) {
|
||||
if (EXPECTED(!EG(exception))) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method));
|
||||
zend_throw_error(zend_ce_error, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method));
|
||||
}
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -3405,7 +3402,7 @@ ZEND_VM_C_LABEL(try_function_name):
|
|||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string");
|
||||
zend_throw_error(zend_ce_error, "Function name must be a string");
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -3490,7 +3487,7 @@ ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST)
|
|||
func_name++;
|
||||
if (UNEXPECTED((func = zend_hash_find(EG(function_table), Z_STR_P(func_name))) == NULL)) {
|
||||
SAVE_OPLINE();
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
|
||||
zend_throw_error(zend_ce_error, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
fbc = Z_FUNC_P(func);
|
||||
|
@ -3522,7 +3519,7 @@ ZEND_VM_HANDLER(61, ZEND_INIT_FCALL, ANY, CONST)
|
|||
fbc = CACHED_PTR(Z_CACHE_SLOT_P(fname));
|
||||
} else if (UNEXPECTED((func = zend_hash_find(EG(function_table), Z_STR_P(fname))) == NULL)) {
|
||||
SAVE_OPLINE();
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined function %s()", Z_STRVAL_P(fname));
|
||||
zend_throw_error(zend_ce_error, "Call to undefined function %s()", Z_STRVAL_P(fname));
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
fbc = Z_FUNC_P(func);
|
||||
|
@ -3725,7 +3722,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
|
|||
EX(call) = call->prev_execute_data;
|
||||
if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) {
|
||||
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call abstract method %s::%s()", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
|
||||
zend_throw_error(zend_ce_error, "Cannot call abstract method %s::%s()", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) {
|
||||
|
@ -3850,7 +3847,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
|
|||
object->handlers->call_method(fbc->common.function_name, object, call, EX_VAR(opline->result.var));
|
||||
EG(current_execute_data) = call->prev_execute_data;
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call overloaded function for non-object");
|
||||
zend_throw_error(zend_ce_error, "Cannot call overloaded function for non-object");
|
||||
#if 0
|
||||
//TODO: implement clean exit ???
|
||||
zend_vm_stack_free_args(call);
|
||||
|
@ -4044,7 +4041,7 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY)
|
|||
retval_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(retval_ptr == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot return string offsets by reference");
|
||||
zend_throw_error(zend_ce_error, "Cannot return string offsets by reference");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
|
@ -4142,7 +4139,7 @@ ZEND_VM_HANDLER(108, ZEND_THROW, CONST|TMP|VAR|CV, ANY)
|
|||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Can only throw objects");
|
||||
zend_throw_error(zend_ce_error, "Can only throw objects");
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -4240,7 +4237,7 @@ ZEND_VM_HANDLER(116, ZEND_SEND_VAL_EX, CONST|TMP, ANY)
|
|||
} else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
|
||||
ZEND_VM_C_LABEL(send_val_by_ref):
|
||||
SAVE_OPLINE();
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot pass parameter %d by reference", opline->op2.num);
|
||||
zend_throw_error(zend_ce_error, "Cannot pass parameter %d by reference", opline->op2.num);
|
||||
FREE_UNFETCHED_OP1();
|
||||
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
|
||||
ZVAL_UNDEF(arg);
|
||||
|
@ -4345,7 +4342,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
|||
varptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(varptr == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Only variables can be passed by reference");
|
||||
zend_throw_error(zend_ce_error, "Only variables can be passed by reference");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
|
@ -4454,7 +4451,7 @@ ZEND_VM_C_LABEL(send_again):
|
|||
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) {
|
||||
if (name) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unpack array with string keys");
|
||||
zend_throw_error(zend_ce_error, "Cannot unpack array with string keys");
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -4524,7 +4521,7 @@ ZEND_VM_C_LABEL(send_again):
|
|||
}
|
||||
|
||||
if (Z_TYPE(key) == IS_STRING) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION,
|
||||
zend_throw_error(zend_ce_error,
|
||||
"Cannot unpack Traversable with string keys");
|
||||
zend_string_release(Z_STR(key));
|
||||
ZEND_VM_C_GOTO(unpack_iter_dtor);
|
||||
|
@ -5024,7 +5021,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|CV, ANY)
|
|||
obj = GET_OP1_OBJ_ZVAL_PTR_UNDEF(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(obj) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
|
@ -5043,7 +5040,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|CV, ANY)
|
|||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "__clone method called on non-object");
|
||||
zend_throw_error(zend_ce_error, "__clone method called on non-object");
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -5054,9 +5051,9 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|CV, ANY)
|
|||
clone_call = Z_OBJ_HT_P(obj)->clone_obj;
|
||||
if (UNEXPECTED(clone_call == NULL)) {
|
||||
if (ce) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name));
|
||||
zend_throw_error(zend_ce_error, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name));
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Trying to clone an uncloneable object");
|
||||
zend_throw_error(zend_ce_error, "Trying to clone an uncloneable object");
|
||||
}
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -5067,7 +5064,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|CV, ANY)
|
|||
/* Ensure that if we're calling a private function, we're allowed to do so.
|
||||
*/
|
||||
if (UNEXPECTED(ce != EG(scope))) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
zend_throw_error(zend_ce_error, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -5075,7 +5072,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|CV, ANY)
|
|||
/* Ensure that if we're calling a protected function, we're allowed to do so.
|
||||
*/
|
||||
if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
zend_throw_error(zend_ce_error, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -5119,7 +5116,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
|||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
|
||||
zend_throw_error(zend_ce_error, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else {
|
||||
|
@ -5156,7 +5153,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
|||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1)));
|
||||
zend_throw_error(zend_ce_error, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1)));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
|
||||
|
@ -5185,7 +5182,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
|||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce, value);
|
||||
}
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
|
||||
zend_throw_error(zend_ce_error, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} while (0);
|
||||
|
@ -5213,7 +5210,7 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUSE
|
|||
UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
|
||||
expr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot create references to/from string offsets");
|
||||
zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var)));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -5623,7 +5620,7 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
|
|||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
|
||||
zend_throw_error(zend_ce_error, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
|
||||
if (OP1_TYPE != IS_CONST) {
|
||||
zend_string_release(Z_STR(tmp));
|
||||
}
|
||||
|
@ -5660,12 +5657,12 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMPVAR|CV)
|
|||
SAVE_OPLINE();
|
||||
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot unset string offsets");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -5733,12 +5730,12 @@ ZEND_VM_C_LABEL(num_index_dim):
|
|||
}
|
||||
if (OP1_TYPE == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
|
||||
if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array");
|
||||
zend_throw_error(zend_ce_error, "Cannot use object as array");
|
||||
} else {
|
||||
Z_OBJ_HT_P(container)->unset_dimension(container, offset);
|
||||
}
|
||||
} else if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot unset string offsets");
|
||||
}
|
||||
} while (0);
|
||||
|
||||
|
@ -5758,12 +5755,12 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMPVAR|CV)
|
|||
SAVE_OPLINE();
|
||||
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets");
|
||||
zend_throw_error(zend_ce_error, "Cannot unset string offsets");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -6563,7 +6560,7 @@ ZEND_VM_HANDLER(115, ZEND_ISSET_ISEMPTY_DIM_OBJ, CONST|TMPVAR|UNUSED|CV, CONST|T
|
|||
container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -6700,7 +6697,7 @@ ZEND_VM_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, CONST|TMPVAR|UNUSED|CV, CONST|
|
|||
container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS);
|
||||
|
||||
if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context");
|
||||
zend_throw_error(zend_ce_error, "Using $this when not in object context");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -7367,7 +7364,7 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
|
|||
|
||||
SAVE_OPLINE();
|
||||
if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator");
|
||||
zend_throw_error(zend_ce_error, "Cannot yield from finally in a force-closed generator");
|
||||
FREE_UNFETCHED_OP2();
|
||||
FREE_UNFETCHED_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -7402,7 +7399,7 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
|
|||
zval *value_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference");
|
||||
zend_throw_error(zend_ce_error, "Cannot yield string offsets by reference");
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -7533,13 +7530,13 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
|
|||
|
||||
if (Z_ISUNDEF(new_gen->retval)) {
|
||||
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Impossible to yield from the Generator being currently run");
|
||||
zend_throw_error(zend_ce_error, "Impossible to yield from the Generator being currently run");
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
zend_generator_yield_from(generator, new_gen);
|
||||
}
|
||||
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Generator passed to yield from was aborted without proper return and is unable to continue");
|
||||
zend_throw_error(zend_ce_error, "Generator passed to yield from was aborted without proper return and is unable to continue");
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
|
@ -7553,7 +7550,7 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
|
|||
|
||||
if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
|
||||
if (!EG(exception)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name));
|
||||
zend_throw_error(zend_ce_error, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name));
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
@ -7570,7 +7567,7 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
|
|||
ZVAL_OBJ(&generator->values, &iter->std);
|
||||
}
|
||||
} else {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Can use \"yield from\" only with arrays and Traversables", 0);
|
||||
zend_throw_error(zend_ce_error, "Can use \"yield from\" only with arrays and Traversables", 0);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
|
@ -7890,7 +7887,7 @@ ZEND_VM_HANDLER(157, ZEND_FETCH_CLASS_NAME, ANY, ANY)
|
|||
fetch_type = opline->extended_value;
|
||||
|
||||
if (UNEXPECTED(EG(scope) == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use \"%s\" when no class scope is active",
|
||||
zend_throw_error(zend_ce_error, "Cannot use \"%s\" when no class scope is active",
|
||||
fetch_type == ZEND_FETCH_CLASS_SELF ? "self" :
|
||||
fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static");
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -7902,7 +7899,7 @@ ZEND_VM_HANDLER(157, ZEND_FETCH_CLASS_NAME, ANY, ANY)
|
|||
break;
|
||||
case ZEND_FETCH_CLASS_PARENT:
|
||||
if (UNEXPECTED(EG(scope)->parent == NULL)) {
|
||||
zend_throw_error(zend_ce_error, E_EXCEPTION,
|
||||
zend_throw_error(zend_ce_error,
|
||||
"Cannot use \"parent\" when current class scope has no parent");
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue