diff options
Diffstat (limited to 'Zend/zend_vm_execute.h')
| -rw-r--r-- | Zend/zend_vm_execute.h | 1500 |
1 files changed, 757 insertions, 743 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 729ad1be6d..d11ce033fb 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -745,7 +745,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPC 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_error(E_EXCEPTION | E_ERROR, "Cannot call abstract method %s::%s()", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name)); + 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)); HANDLE_EXCEPTION(); } if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { @@ -870,7 +870,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPC 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_error(E_EXCEPTION | E_ERROR, "Cannot call overloaded function for non-object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call overloaded function for non-object"); #if 0 //TODO: implement clean exit ??? zend_vm_stack_free_args(call); @@ -971,7 +971,7 @@ send_again: ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) { if (name) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unpack array with string keys"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unpack array with string keys"); FREE_OP(free_op1); HANDLE_EXCEPTION(); } @@ -1041,7 +1041,7 @@ send_again: } if (Z_TYPE(key) == IS_STRING) { - zend_error(E_EXCEPTION | E_ERROR, + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unpack Traversable with string keys"); zend_string_release(Z_STR(key)); goto unpack_iter_dtor; @@ -1676,7 +1676,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_HANDLER( fetch_type = opline->extended_value; if (UNEXPECTED(EG(scope) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use \"%s\" when no class scope is active", + zend_throw_error(zend_ce_error, E_EXCEPTION, "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(); @@ -1688,7 +1688,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_HANDLER( break; case ZEND_FETCH_CLASS_PARENT: if (UNEXPECTED(EG(scope)->parent == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use \"parent\" when current class scope has no parent"); HANDLE_EXCEPTION(); } @@ -1879,7 +1879,7 @@ try_class_name: if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Class name must be a valid object or a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class name must be a valid object or a string"); } CHECK_EXCEPTION(); @@ -1900,7 +1900,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_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_error(E_EXCEPTION | E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2))); HANDLE_EXCEPTION(); } else { fbc = Z_FUNC_P(func); @@ -1961,7 +1961,7 @@ try_function_name: } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname)); } zend_string_release(lcname); zend_string_release(mname); @@ -1978,8 +1978,9 @@ try_function_name: "Non-static method %s::%s() should not be called statically", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name)); } else { - zend_error( - E_EXCEPTION | E_ERROR, + 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)); @@ -1994,7 +1995,7 @@ try_function_name: lcname = zend_string_tolower(Z_STR_P(function_name)); } if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined function %s()", Z_STRVAL_P(function_name)); zend_string_release(lcname); HANDLE_EXCEPTION(); @@ -2025,21 +2026,21 @@ try_function_name: method = zend_hash_index_find(Z_ARRVAL_P(function_name), 1); if (!obj || !method) { - zend_error(E_EXCEPTION | E_ERROR, "Array callback has to contain indices 0 and 1"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Array callback has to contain indices 0 and 1"); HANDLE_EXCEPTION(); } ZVAL_DEREF(obj); if (Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_EXCEPTION | E_ERROR, "First array member is not a valid class name or object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "First array member is not a valid class name or object"); HANDLE_EXCEPTION(); } ZVAL_DEREF(method); if (Z_TYPE_P(method) != IS_STRING) { - zend_error(E_EXCEPTION | E_ERROR, "Second array member is not a valid method"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Second array member is not a valid method"); HANDLE_EXCEPTION(); } @@ -2059,7 +2060,7 @@ try_function_name: } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method)); } HANDLE_EXCEPTION(); @@ -2070,8 +2071,9 @@ try_function_name: "Non-static method %s::%s() should not be called statically", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name)); } else { - zend_error( - E_EXCEPTION | E_ERROR, + 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)); @@ -2085,7 +2087,7 @@ 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_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method)); } HANDLE_EXCEPTION(); @@ -2109,7 +2111,7 @@ try_function_name: if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); HANDLE_EXCEPTION(); } @@ -2137,7 +2139,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CON func_name++; if (UNEXPECTED((func = zend_hash_find(EG(function_table), Z_STR_P(func_name))) == NULL)) { SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2))); HANDLE_EXCEPTION(); } else { fbc = Z_FUNC_P(func); @@ -2169,7 +2171,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CONST_HANDLER( 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_error(E_EXCEPTION | E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(fname)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined function %s()", Z_STRVAL_P(fname)); HANDLE_EXCEPTION(); } else { fbc = Z_FUNC_P(func); @@ -2314,7 +2316,7 @@ try_class_name: if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Class name must be a valid object or a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class name must be a valid object or a string"); } CHECK_EXCEPTION(); @@ -2360,7 +2362,7 @@ try_class_name: if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Class name must be a valid object or a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class name must be a valid object or a string"); } CHECK_EXCEPTION(); @@ -2414,7 +2416,7 @@ try_function_name: } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname)); } zend_string_release(lcname); zend_string_release(mname); @@ -2431,8 +2433,9 @@ try_function_name: "Non-static method %s::%s() should not be called statically", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name)); } else { - zend_error( - E_EXCEPTION | E_ERROR, + 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)); @@ -2447,7 +2450,7 @@ try_function_name: lcname = zend_string_tolower(Z_STR_P(function_name)); } if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined function %s()", Z_STRVAL_P(function_name)); zend_string_release(lcname); HANDLE_EXCEPTION(); @@ -2478,21 +2481,21 @@ try_function_name: method = zend_hash_index_find(Z_ARRVAL_P(function_name), 1); if (!obj || !method) { - zend_error(E_EXCEPTION | E_ERROR, "Array callback has to contain indices 0 and 1"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Array callback has to contain indices 0 and 1"); HANDLE_EXCEPTION(); } ZVAL_DEREF(obj); if (Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_EXCEPTION | E_ERROR, "First array member is not a valid class name or object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "First array member is not a valid class name or object"); HANDLE_EXCEPTION(); } ZVAL_DEREF(method); if (Z_TYPE_P(method) != IS_STRING) { - zend_error(E_EXCEPTION | E_ERROR, "Second array member is not a valid method"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Second array member is not a valid method"); HANDLE_EXCEPTION(); } @@ -2512,7 +2515,7 @@ try_function_name: } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method)); } HANDLE_EXCEPTION(); @@ -2523,8 +2526,9 @@ try_function_name: "Non-static method %s::%s() should not be called statically", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name)); } else { - zend_error( - E_EXCEPTION | E_ERROR, + 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)); @@ -2538,7 +2542,7 @@ 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_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method)); } HANDLE_EXCEPTION(); @@ -2562,7 +2566,7 @@ try_function_name: if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); HANDLE_EXCEPTION(); } @@ -2613,7 +2617,7 @@ try_class_name: if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Class name must be a valid object or a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class name must be a valid object or a string"); } zval_ptr_dtor_nogc(free_op2); @@ -2668,7 +2672,7 @@ try_function_name: } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname)); } zend_string_release(lcname); zend_string_release(mname); @@ -2685,8 +2689,9 @@ try_function_name: "Non-static method %s::%s() should not be called statically", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name)); } else { - zend_error( - E_EXCEPTION | E_ERROR, + 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)); zval_ptr_dtor_nogc(free_op2); @@ -2701,7 +2706,7 @@ try_function_name: lcname = zend_string_tolower(Z_STR_P(function_name)); } if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined function %s()", Z_STRVAL_P(function_name)); zend_string_release(lcname); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -2732,21 +2737,21 @@ try_function_name: method = zend_hash_index_find(Z_ARRVAL_P(function_name), 1); if (!obj || !method) { - zend_error(E_EXCEPTION | E_ERROR, "Array callback has to contain indices 0 and 1"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Array callback has to contain indices 0 and 1"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } ZVAL_DEREF(obj); if (Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_EXCEPTION | E_ERROR, "First array member is not a valid class name or object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "First array member is not a valid class name or object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } ZVAL_DEREF(method); if (Z_TYPE_P(method) != IS_STRING) { - zend_error(E_EXCEPTION | E_ERROR, "Second array member is not a valid method"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Second array member is not a valid method"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -2766,7 +2771,7 @@ try_function_name: } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method)); } zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -2777,8 +2782,9 @@ try_function_name: "Non-static method %s::%s() should not be called statically", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name)); } else { - zend_error( - E_EXCEPTION | E_ERROR, + 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)); zval_ptr_dtor_nogc(free_op2); @@ -2792,7 +2798,7 @@ 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_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method)); } zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -2816,7 +2822,7 @@ try_function_name: if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -3178,7 +3184,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDL retval_ptr = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(retval_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot return string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot return string offsets by reference"); HANDLE_EXCEPTION(); } @@ -3275,7 +3281,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_THROW_SPEC_CONST_HANDLER(ZEND_ if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Can only throw objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Can only throw objects"); HANDLE_EXCEPTION(); } @@ -3322,7 +3328,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_CONST_HANDLER } else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) { send_val_by_ref: SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot pass parameter %d by reference", opline->op2.num); arg = ZEND_CALL_VAR(EX(call), opline->result.var); ZVAL_UNDEF(arg); @@ -3432,7 +3438,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_ obj = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(obj) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -3451,7 +3457,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_ if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "__clone method called on non-object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "__clone method called on non-object"); HANDLE_EXCEPTION(); } @@ -3462,9 +3468,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_ clone_call = Z_OBJ_HT_P(obj)->clone_obj; if (UNEXPECTED(clone_call == NULL)) { if (ce) { - zend_error(E_EXCEPTION | E_ERROR, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); } else { - zend_error(E_EXCEPTION | E_ERROR, "Trying to clone an uncloneable object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Trying to clone an uncloneable object"); } HANDLE_EXCEPTION(); @@ -3475,7 +3481,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (UNEXPECTED(ce != EG(scope))) { - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); HANDLE_EXCEPTION(); } @@ -3483,7 +3489,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_ /* 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_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); HANDLE_EXCEPTION(); } @@ -4171,13 +4177,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER( if (Z_ISUNDEF(new_gen->retval)) { if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) { - zend_error(E_ERROR | E_EXCEPTION, "Impossible to yield from the Generator being currently run"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_ERROR | E_EXCEPTION, "Generator passed to yield from was aborted without proper return and is unable to continue"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Generator passed to yield from was aborted without proper return and is unable to continue"); HANDLE_EXCEPTION(); } else { if (RETURN_VALUE_USED(opline)) { @@ -4190,7 +4196,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER( if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { if (!EG(exception)) { - zend_error(E_ERROR | E_EXCEPTION, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); } HANDLE_EXCEPTION(); } @@ -4207,7 +4213,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER( ZVAL_OBJ(&generator->values, &iter->std); } } else { - zend_error(E_ERROR | E_EXCEPTION, "Can use \"yield from\" only with arrays and Traversables", 0); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Can use \"yield from\" only with arrays and Traversables", 0); HANDLE_EXCEPTION(); } @@ -5009,7 +5015,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -5036,7 +5042,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -5201,14 +5207,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } container = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -5220,7 +5226,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ } else { if (IS_CONST == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); HANDLE_EXCEPTION(); @@ -5246,7 +5252,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_H container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -5319,7 +5325,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_ container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -5395,18 +5401,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ container = NULL; if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -5567,7 +5573,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CO if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); HANDLE_EXCEPTION(); @@ -5577,7 +5583,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CO object = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -5597,7 +5603,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CO if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); HANDLE_EXCEPTION(); @@ -5613,7 +5619,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CO zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); HANDLE_EXCEPTION(); @@ -5623,7 +5629,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CO fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } @@ -5677,7 +5683,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -5706,7 +5712,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); HANDLE_EXCEPTION(); } @@ -5719,7 +5725,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); } HANDLE_EXCEPTION(); @@ -5738,11 +5744,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } } else { if (UNEXPECTED(ce->constructor == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot call constructor"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_EXCEPTION | E_ERROR, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); HANDLE_EXCEPTION(); } fbc = ce->constructor; @@ -5763,8 +5769,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } else { /* An internal function assumes $this is present and won't check that. * So PHP would crash by allowing the call. */ - zend_error( - E_EXCEPTION | E_ERROR, + 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(); @@ -5938,7 +5945,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONS CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - zend_error(E_EXCEPTION | E_ERROR, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); HANDLE_EXCEPTION(); } } else { @@ -5975,7 +5982,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONS HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -6004,7 +6011,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONS CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce, value); } } else { - zend_error(E_EXCEPTION | E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); HANDLE_EXCEPTION(); } } while (0); @@ -6032,7 +6039,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_C UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -6209,7 +6216,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HAN HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); if (IS_CONST != IS_CONST) { zend_string_release(Z_STR(tmp)); } @@ -6352,7 +6359,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -6489,7 +6496,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CO container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -6569,7 +6576,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); HANDLE_EXCEPTION(); @@ -6604,7 +6611,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER zval *value_ptr = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -6768,7 +6775,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(Z SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -6803,7 +6810,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(Z zval *value_ptr = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -6978,7 +6985,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -7005,7 +7012,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -7187,7 +7194,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDL HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); if (IS_CONST != IS_CONST) { zend_string_release(Z_STR(tmp)); } @@ -7325,7 +7332,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(Z SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -7360,7 +7367,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(Z zval *value_ptr = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -7493,7 +7500,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -7520,7 +7527,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -7655,14 +7662,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } container = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -7674,7 +7681,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ } else { if (IS_UNUSED == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); HANDLE_EXCEPTION(); @@ -7709,7 +7716,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -7738,7 +7745,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); HANDLE_EXCEPTION(); } @@ -7751,7 +7758,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); } HANDLE_EXCEPTION(); @@ -7770,11 +7777,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } } else { if (UNEXPECTED(ce->constructor == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot call constructor"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_EXCEPTION | E_ERROR, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); HANDLE_EXCEPTION(); } fbc = ce->constructor; @@ -7795,8 +7802,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } else { /* An internal function assumes $this is present and won't check that. * So PHP would crash by allowing the call. */ - zend_error( - E_EXCEPTION | E_ERROR, + 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(); @@ -7881,7 +7889,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_U UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -8058,7 +8066,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HA HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); if (IS_CONST != IS_CONST) { zend_string_release(Z_STR(tmp)); } @@ -8219,7 +8227,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLE SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); HANDLE_EXCEPTION(); @@ -8254,7 +8262,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLE zval *value_ptr = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -9037,14 +9045,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } container = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -9056,7 +9064,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ } else { if (IS_CV == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); HANDLE_EXCEPTION(); @@ -9082,7 +9090,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HAND container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -9155,7 +9163,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HAN container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -9231,18 +9239,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ container = NULL; if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -9358,7 +9366,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); HANDLE_EXCEPTION(); @@ -9368,7 +9376,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV object = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -9388,7 +9396,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); HANDLE_EXCEPTION(); @@ -9404,7 +9412,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); HANDLE_EXCEPTION(); @@ -9414,7 +9422,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } @@ -9468,7 +9476,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -9497,7 +9505,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); HANDLE_EXCEPTION(); } @@ -9510,7 +9518,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); } HANDLE_EXCEPTION(); @@ -9529,11 +9537,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } } else { if (UNEXPECTED(ce->constructor == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot call constructor"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_EXCEPTION | E_ERROR, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); HANDLE_EXCEPTION(); } fbc = ce->constructor; @@ -9554,8 +9562,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } else { /* An internal function assumes $this is present and won't check that. * So PHP would crash by allowing the call. */ - zend_error( - E_EXCEPTION | E_ERROR, + 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(); @@ -9765,7 +9774,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_C UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -9898,7 +9907,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -10035,7 +10044,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CO container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -10078,7 +10087,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZE SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); HANDLE_EXCEPTION(); @@ -10113,7 +10122,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZE zval *value_ptr = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -10870,14 +10879,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } container = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -10889,7 +10898,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_ } else { if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -10915,7 +10924,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_ container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -10989,7 +10998,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -11066,18 +11075,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ container = NULL; if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -11193,7 +11202,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_TM if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -11203,7 +11212,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_TM object = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -11223,7 +11232,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_TM if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -11239,7 +11248,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_TM zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -11249,7 +11258,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_TM fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } zval_ptr_dtor_nogc(free_op2); @@ -11304,7 +11313,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -11333,7 +11342,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -11346,7 +11355,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); } zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -11365,11 +11374,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } } else { if (UNEXPECTED(ce->constructor == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot call constructor"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_EXCEPTION | E_ERROR, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); HANDLE_EXCEPTION(); } fbc = ce->constructor; @@ -11390,8 +11399,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C } else { /* An internal function assumes $this is present and won't check that. * So PHP would crash by allowing the call. */ - zend_error( - E_EXCEPTION | E_ERROR, + 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(); @@ -11551,7 +11561,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_T UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = NULL; if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -11684,7 +11694,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -11821,7 +11831,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CO container = EX_CONSTANT(opline->op1); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -11955,7 +11965,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER retval_ptr = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(retval_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot return string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot return string offsets by reference"); HANDLE_EXCEPTION(); } @@ -12052,7 +12062,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OP if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Can only throw objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Can only throw objects"); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -12099,7 +12109,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_TMP_HANDLER(Z } else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) { send_val_by_ref: SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot pass parameter %d by reference", opline->op2.num); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); arg = ZEND_CALL_VAR(EX(call), opline->result.var); ZVAL_UNDEF(arg); @@ -12640,13 +12650,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZE if (Z_ISUNDEF(new_gen->retval)) { if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) { - zend_error(E_ERROR | E_EXCEPTION, "Impossible to yield from the Generator being currently run"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_ERROR | E_EXCEPTION, "Generator passed to yield from was aborted without proper return and is unable to continue"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Generator passed to yield from was aborted without proper return and is unable to continue"); HANDLE_EXCEPTION(); } else { if (RETURN_VALUE_USED(opline)) { @@ -12660,7 +12670,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZE if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { if (!EG(exception)) { - zend_error(E_ERROR | E_EXCEPTION, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); } HANDLE_EXCEPTION(); } @@ -12677,7 +12687,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZE ZVAL_OBJ(&generator->values, &iter->std); } } else { - zend_error(E_ERROR | E_EXCEPTION, "Can use \"yield from\" only with arrays and Traversables", 0); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Can use \"yield from\" only with arrays and Traversables", 0); HANDLE_EXCEPTION(); } @@ -12787,14 +12797,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CO if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); } container = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -12806,7 +12816,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CO } else { if (IS_CONST == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -12832,7 +12842,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HAN container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1); if (IS_TMP_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -12908,18 +12918,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CO container = NULL; if (IS_TMP_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -13028,7 +13038,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CON UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -13156,7 +13166,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(Z SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -13191,7 +13201,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(Z zval *value_ptr = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -13339,7 +13349,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEN SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -13374,7 +13384,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEN zval *value_ptr = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -13522,7 +13532,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEN SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -13557,7 +13567,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEN zval *value_ptr = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -13665,14 +13675,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UN if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); } container = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -13684,7 +13694,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UN } else { if (IS_UNUSED == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -13758,7 +13768,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNU UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -13886,7 +13896,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER( SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -13921,7 +13931,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER( zval *value_ptr = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -14071,14 +14081,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); } container = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -14090,7 +14100,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV } else { if (IS_CV == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -14116,7 +14126,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLE container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1); if (IS_TMP_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -14192,18 +14202,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV container = NULL; if (IS_TMP_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -14312,7 +14322,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_ UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -14440,7 +14450,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -14475,7 +14485,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND zval *value_ptr = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -14583,14 +14593,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TM if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); } container = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -14602,7 +14612,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TM } else { if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -14628,7 +14638,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_TMPVAR_HA container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1); if (IS_TMP_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -14705,18 +14715,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TM container = NULL; if (IS_TMP_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -14825,7 +14835,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = NULL; if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -14955,7 +14965,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_ if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -15002,7 +15012,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_ if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -15049,7 +15059,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -15089,7 +15099,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -15201,7 +15211,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER retval_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(retval_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot return string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot return string offsets by reference"); HANDLE_EXCEPTION(); } @@ -15299,7 +15309,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OP if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Can only throw objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Can only throw objects"); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -15404,7 +15414,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND varptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(varptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Only variables can be passed by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Only variables can be passed by reference"); HANDLE_EXCEPTION(); } @@ -16484,13 +16494,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZE if (Z_ISUNDEF(new_gen->retval)) { if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) { - zend_error(E_ERROR | E_EXCEPTION, "Impossible to yield from the Generator being currently run"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_ERROR | E_EXCEPTION, "Generator passed to yield from was aborted without proper return and is unable to continue"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Generator passed to yield from was aborted without proper return and is unable to continue"); HANDLE_EXCEPTION(); } else { if (RETURN_VALUE_USED(opline)) { @@ -16504,7 +16514,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZE if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { if (!EG(exception)) { - zend_error(E_ERROR | E_EXCEPTION, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); } HANDLE_EXCEPTION(); } @@ -16521,7 +16531,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZE ZVAL_OBJ(&generator->values, &iter->std); } } else { - zend_error(E_ERROR | E_EXCEPTION, "Can use \"yield from\" only with arrays and Traversables", 0); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Can use \"yield from\" only with arrays and Traversables", 0); HANDLE_EXCEPTION(); } @@ -16634,7 +16644,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -16643,7 +16653,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP property = EX_CONSTANT(opline->op2); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -16698,13 +16708,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -16730,7 +16740,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); FREE_OP(free_op_data1); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; @@ -16772,7 +16782,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_V var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -17029,7 +17039,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -17037,7 +17047,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE property = EX_CONSTANT(opline->op2); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -17110,7 +17120,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -17118,7 +17128,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP property = EX_CONSTANT(opline->op2); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -17185,7 +17195,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HAN container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST); @@ -17208,7 +17218,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HA container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST); @@ -17231,14 +17241,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CO if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); } container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -17250,7 +17260,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CO if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; } else { if (IS_CONST == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -17274,7 +17284,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -17300,7 +17310,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HAN container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -17373,12 +17383,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HAN container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -17405,12 +17415,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HA container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -17439,18 +17449,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CO container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -17477,7 +17487,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -17485,7 +17495,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST property = EX_CONSTANT(opline->op2); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -17510,7 +17520,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HAND object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -17518,7 +17528,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HAND property_name = EX_CONSTANT(opline->op2); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -17545,7 +17555,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HAND object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -17594,7 +17604,7 @@ try_assign_dim_array: } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { if (IS_CONST == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "[] operator not supported for strings"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; HANDLE_EXCEPTION(); @@ -17689,7 +17699,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -17718,7 +17728,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); HANDLE_EXCEPTION(); } @@ -17731,7 +17741,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); } HANDLE_EXCEPTION(); @@ -17750,11 +17760,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } } else { if (UNEXPECTED(ce->constructor == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot call constructor"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_EXCEPTION | E_ERROR, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); HANDLE_EXCEPTION(); } fbc = ce->constructor; @@ -17775,8 +17785,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } else { /* An internal function assumes $this is present and won't check that. * So PHP would crash by allowing the call. */ - zend_error( - E_EXCEPTION | E_ERROR, + 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(); @@ -17827,7 +17838,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_ CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - zend_error(E_EXCEPTION | E_ERROR, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); HANDLE_EXCEPTION(); } } else { @@ -17864,7 +17875,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_ HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -17893,7 +17904,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce, value); } } else { - zend_error(E_EXCEPTION | E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); HANDLE_EXCEPTION(); } } while (0); @@ -17921,7 +17932,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CON UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -18053,12 +18064,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDL SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -18126,12 +18137,12 @@ num_index_dim: } if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); } else { Z_OBJ_HT_P(container)->unset_dimension(container, offset); } } else if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); } } while (0); @@ -18150,12 +18161,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDL SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -18192,7 +18203,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(Z SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -18227,7 +18238,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(Z zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -18410,7 +18421,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEN SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -18445,7 +18456,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEN zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -18626,7 +18637,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLE value_ptr = _get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets nor overloaded objects"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); } @@ -18647,14 +18658,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLE variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets nor overloaded objects"); if (free_op2) {zval_ptr_dtor_nogc(free_op2);}; HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) && UNEXPECTED(!Z_ISREF_P(variable_ptr))) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot assign by reference to overloaded object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot assign by reference to overloaded object"); if (free_op2) {zval_ptr_dtor_nogc(free_op2);}; if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; HANDLE_EXCEPTION(); @@ -18685,7 +18696,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEN SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -18720,7 +18731,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEN zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -18829,13 +18840,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -18861,7 +18872,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); FREE_OP(free_op_data1); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; @@ -19121,7 +19132,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HA container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED); @@ -19144,7 +19155,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_H container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, NULL, IS_UNUSED); @@ -19167,14 +19178,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UN if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); } container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -19186,7 +19197,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UN if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; } else { if (IS_UNUSED == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -19214,7 +19225,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HAN object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -19263,7 +19274,7 @@ try_assign_dim_array: } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { if (IS_UNUSED == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "[] operator not supported for strings"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; HANDLE_EXCEPTION(); @@ -19329,7 +19340,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -19358,7 +19369,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); HANDLE_EXCEPTION(); } @@ -19371,7 +19382,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); } HANDLE_EXCEPTION(); @@ -19390,11 +19401,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } } else { if (UNEXPECTED(ce->constructor == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot call constructor"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_EXCEPTION | E_ERROR, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); HANDLE_EXCEPTION(); } fbc = ce->constructor; @@ -19415,8 +19426,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } else { /* An internal function assumes $this is present and won't check that. * So PHP would crash by allowing the call. */ - zend_error( - E_EXCEPTION | E_ERROR, + 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(); @@ -19501,7 +19513,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNU UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -19646,7 +19658,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER( SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -19681,7 +19693,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER( zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -19835,7 +19847,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -19844,7 +19856,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -19899,13 +19911,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -19931,7 +19943,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); FREE_OP(free_op_data1); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; @@ -19973,7 +19985,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_V var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -20230,7 +20242,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -20238,7 +20250,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -20311,7 +20323,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -20319,7 +20331,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -20386,7 +20398,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLE container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV); @@ -20409,7 +20421,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDL container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV); @@ -20432,14 +20444,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); } container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -20451,7 +20463,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; } else { if (IS_CV == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -20475,7 +20487,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HA container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -20501,7 +20513,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLE container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -20574,12 +20586,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLE container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -20606,12 +20618,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDL container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -20640,18 +20652,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -20678,7 +20690,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HA container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -20686,7 +20698,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HA property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -20711,7 +20723,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -20719,7 +20731,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -20746,7 +20758,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -20795,7 +20807,7 @@ try_assign_dim_array: } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { if (IS_CV == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "[] operator not supported for strings"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; HANDLE_EXCEPTION(); @@ -20880,7 +20892,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op2.var); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets nor overloaded objects"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); } @@ -20901,14 +20913,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets nor overloaded objects"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) && UNEXPECTED(!Z_ISREF_P(variable_ptr))) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot assign by reference to overloaded object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot assign by reference to overloaded object"); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; HANDLE_EXCEPTION(); @@ -20951,7 +20963,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -20980,7 +20992,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); HANDLE_EXCEPTION(); } @@ -20993,7 +21005,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); } HANDLE_EXCEPTION(); @@ -21012,11 +21024,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } } else { if (UNEXPECTED(ce->constructor == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot call constructor"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_EXCEPTION | E_ERROR, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); HANDLE_EXCEPTION(); } fbc = ce->constructor; @@ -21037,8 +21049,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } else { /* An internal function assumes $this is present and won't check that. * So PHP would crash by allowing the call. */ - zend_error( - E_EXCEPTION | E_ERROR, + 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(); @@ -21074,7 +21087,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_ UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -21206,12 +21219,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER( SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -21279,12 +21292,12 @@ num_index_dim: } if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); } else { Z_OBJ_HT_P(container)->unset_dimension(container, offset); } } else if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); } } while (0); @@ -21303,12 +21316,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER( SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -21345,7 +21358,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -21380,7 +21393,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -21497,7 +21510,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -21506,7 +21519,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -21561,13 +21574,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -21593,7 +21606,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); FREE_OP(free_op_data1); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; @@ -21636,7 +21649,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_V var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -21894,7 +21907,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -21902,7 +21915,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -21976,7 +21989,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -21984,7 +21997,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -22052,7 +22065,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR_HA container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR)); @@ -22075,7 +22088,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR_H container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR)); @@ -22098,14 +22111,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TM if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); } container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -22117,7 +22130,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TM if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; } else { if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -22141,7 +22154,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVA container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -22167,7 +22180,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMPVAR_HA container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -22241,12 +22254,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HA container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -22273,12 +22286,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR_H container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -22307,18 +22320,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TM container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(free_op2); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -22345,7 +22358,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVA container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -22353,7 +22366,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVA property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -22378,7 +22391,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_HAN object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -22386,7 +22399,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_HAN property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -22413,7 +22426,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_HAN object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -22462,7 +22475,7 @@ try_assign_dim_array: } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "[] operator not supported for strings"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); if (free_op1) {zval_ptr_dtor_nogc(free_op1);}; HANDLE_EXCEPTION(); @@ -22528,7 +22541,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -22557,7 +22570,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Function name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Function name must be a string"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -22570,7 +22583,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name)); } zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -22589,11 +22602,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } } else { if (UNEXPECTED(ce->constructor == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot call constructor"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_EXCEPTION | E_ERROR, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); HANDLE_EXCEPTION(); } fbc = ce->constructor; @@ -22614,8 +22627,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V } else { /* An internal function assumes $this is present and won't check that. * So PHP would crash by allowing the call. */ - zend_error( - E_EXCEPTION | E_ERROR, + 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(); @@ -22651,7 +22665,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -22783,12 +22797,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMPVAR_HAND SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -22856,12 +22870,12 @@ num_index_dim: } if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); } else { Z_OBJ_HT_P(container)->unset_dimension(container, offset); } } else if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); } } while (0); @@ -22881,12 +22895,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HAND SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -22934,7 +22948,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND obj = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(obj) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -22953,7 +22967,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "__clone method called on non-object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "__clone method called on non-object"); HANDLE_EXCEPTION(); } @@ -22964,9 +22978,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND clone_call = Z_OBJ_HT_P(obj)->clone_obj; if (UNEXPECTED(clone_call == NULL)) { if (ce) { - zend_error(E_EXCEPTION | E_ERROR, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); } else { - zend_error(E_EXCEPTION | E_ERROR, "Trying to clone an uncloneable object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Trying to clone an uncloneable object"); } HANDLE_EXCEPTION(); @@ -22977,7 +22991,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND /* Ensure that if we're calling a private function, we're allowed to do so. */ if (UNEXPECTED(ce != EG(scope))) { - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); HANDLE_EXCEPTION(); } @@ -22985,7 +22999,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND /* 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_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); HANDLE_EXCEPTION(); } @@ -23047,7 +23061,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -23056,7 +23070,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP property = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -23111,13 +23125,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -23143,7 +23157,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); FREE_OP(free_op_data1); @@ -23405,7 +23419,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -23413,7 +23427,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE property = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -23486,7 +23500,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -23494,7 +23508,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP property = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -23563,7 +23577,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_ container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -23636,12 +23650,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_ container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -23668,12 +23682,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -23699,7 +23713,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -23775,18 +23789,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -23813,7 +23827,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CO container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -23821,7 +23835,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CO property = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -23846,7 +23860,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_H object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -23854,7 +23868,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_H property_name = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -23931,7 +23945,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); HANDLE_EXCEPTION(); @@ -23941,7 +23955,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -23961,7 +23975,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); HANDLE_EXCEPTION(); @@ -23977,7 +23991,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); HANDLE_EXCEPTION(); @@ -23987,7 +24001,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } @@ -24046,7 +24060,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CON CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - zend_error(E_EXCEPTION | E_ERROR, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); HANDLE_EXCEPTION(); } } else { @@ -24083,7 +24097,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CON HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1))); HANDLE_EXCEPTION(); } CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce); @@ -24112,7 +24126,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CON CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce, value); } } else { - zend_error(E_EXCEPTION | E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2))); HANDLE_EXCEPTION(); } } while (0); @@ -24172,12 +24186,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HA SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -24245,12 +24259,12 @@ num_index_dim: } if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); } else { Z_OBJ_HT_P(container)->unset_dimension(container, offset); } } else if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); } } while (0); @@ -24269,12 +24283,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HA SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -24316,7 +24330,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNU container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -24453,7 +24467,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -24496,7 +24510,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLE SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); HANDLE_EXCEPTION(); @@ -24531,7 +24545,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLE zval *value_ptr = NULL; if (IS_UNUSED == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -24637,7 +24651,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER( SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -24672,7 +24686,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER( zval *value_ptr = NULL; if (IS_UNUSED == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -24778,7 +24792,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER( SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -24813,7 +24827,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER( zval *value_ptr = NULL; if (IS_UNUSED == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -24921,13 +24935,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -24953,7 +24967,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); FREE_OP(free_op_data1); @@ -25291,7 +25305,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDL SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); HANDLE_EXCEPTION(); @@ -25326,7 +25340,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDL zval *value_ptr = NULL; if (IS_UNUSED == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -25437,7 +25451,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -25446,7 +25460,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -25501,13 +25515,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -25533,7 +25547,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); FREE_OP(free_op_data1); @@ -25795,7 +25809,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -25803,7 +25817,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -25876,7 +25890,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -25884,7 +25898,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -25953,7 +25967,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HAN container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -26026,12 +26040,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HAN container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -26058,12 +26072,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HA container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -26089,7 +26103,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HA container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -26165,18 +26179,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -26203,7 +26217,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -26211,7 +26225,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -26236,7 +26250,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HAND object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -26244,7 +26258,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HAND property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -26321,7 +26335,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); HANDLE_EXCEPTION(); @@ -26331,7 +26345,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -26351,7 +26365,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); HANDLE_EXCEPTION(); @@ -26367,7 +26381,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); HANDLE_EXCEPTION(); @@ -26377,7 +26391,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } @@ -26453,12 +26467,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDL SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -26526,12 +26540,12 @@ num_index_dim: } if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); } else { Z_OBJ_HT_P(container)->unset_dimension(container, offset); } } else if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); } } while (0); @@ -26550,12 +26564,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDL SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -26597,7 +26611,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNU container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -26734,7 +26748,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -26777,7 +26791,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(Z SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); HANDLE_EXCEPTION(); @@ -26812,7 +26826,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(Z zval *value_ptr = NULL; if (IS_UNUSED == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -26923,7 +26937,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -26932,7 +26946,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -26987,13 +27001,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -27019,7 +27033,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); FREE_OP(free_op_data1); @@ -27282,7 +27296,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -27290,7 +27304,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -27364,7 +27378,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -27372,7 +27386,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -27442,7 +27456,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -27516,12 +27530,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -27548,12 +27562,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVA container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -27579,7 +27593,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVA container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -27656,18 +27670,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -27694,7 +27708,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TM container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -27702,7 +27716,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TM property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -27727,7 +27741,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_ object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -27735,7 +27749,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_ property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -27812,7 +27826,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -27822,7 +27836,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T object = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -27842,7 +27856,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -27858,7 +27872,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -27868,7 +27882,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } zval_ptr_dtor_nogc(free_op2); @@ -27945,12 +27959,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMPVAR_H SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -28018,12 +28032,12 @@ num_index_dim: } if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); } else { Z_OBJ_HT_P(container)->unset_dimension(container, offset); } } else if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); } } while (0); @@ -28043,12 +28057,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_H SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -28091,7 +28105,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNU container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -28228,7 +28242,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN container = _get_obj_zval_ptr_unused(execute_data); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -28312,7 +28326,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_O if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -28358,7 +28372,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_O if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -28404,7 +28418,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_ if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -28443,7 +28457,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_ if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { SAVE_OPLINE(); - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -28783,7 +28797,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER( retval_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(retval_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot return string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot return string offsets by reference"); HANDLE_EXCEPTION(); } @@ -28880,7 +28894,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPC if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Can only throw objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Can only throw objects"); HANDLE_EXCEPTION(); } @@ -28985,7 +28999,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_ varptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(varptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Only variables can be passed by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Only variables can be passed by reference"); HANDLE_EXCEPTION(); } @@ -29148,7 +29162,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPC obj = _get_zval_ptr_cv_undef(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(obj) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -29167,7 +29181,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPC if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "__clone method called on non-object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "__clone method called on non-object"); HANDLE_EXCEPTION(); } @@ -29178,9 +29192,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPC clone_call = Z_OBJ_HT_P(obj)->clone_obj; if (UNEXPECTED(clone_call == NULL)) { if (ce) { - zend_error(E_EXCEPTION | E_ERROR, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); } else { - zend_error(E_EXCEPTION | E_ERROR, "Trying to clone an uncloneable object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Trying to clone an uncloneable object"); } HANDLE_EXCEPTION(); @@ -29191,7 +29205,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPC /* Ensure that if we're calling a private function, we're allowed to do so. */ if (UNEXPECTED(ce != EG(scope))) { - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); HANDLE_EXCEPTION(); } @@ -29199,7 +29213,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPC /* 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_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); HANDLE_EXCEPTION(); } @@ -29887,13 +29901,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEN if (Z_ISUNDEF(new_gen->retval)) { if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) { - zend_error(E_ERROR | E_EXCEPTION, "Impossible to yield from the Generator being currently run"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "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_error(E_ERROR | E_EXCEPTION, "Generator passed to yield from was aborted without proper return and is unable to continue"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Generator passed to yield from was aborted without proper return and is unable to continue"); HANDLE_EXCEPTION(); } else { if (RETURN_VALUE_USED(opline)) { @@ -29906,7 +29920,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEN if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { if (!EG(exception)) { - zend_error(E_ERROR | E_EXCEPTION, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); } HANDLE_EXCEPTION(); } @@ -29923,7 +29937,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEN ZVAL_OBJ(&generator->values, &iter->std); } } else { - zend_error(E_ERROR | E_EXCEPTION, "Can use \"yield from\" only with arrays and Traversables", 0); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Can use \"yield from\" only with arrays and Traversables", 0); HANDLE_EXCEPTION(); } @@ -30683,7 +30697,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -30692,7 +30706,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP property = EX_CONSTANT(opline->op2); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -30747,13 +30761,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -30779,7 +30793,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); FREE_OP(free_op_data1); @@ -30821,7 +30835,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_C var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -31078,7 +31092,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -31086,7 +31100,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE property = EX_CONSTANT(opline->op2); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -31159,7 +31173,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -31167,7 +31181,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP property = EX_CONSTANT(opline->op2); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -31259,7 +31273,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -31286,7 +31300,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -31436,7 +31450,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CONST_HAND container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST); @@ -31459,7 +31473,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HAN container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST); @@ -31497,14 +31511,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CON if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -31516,7 +31530,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CON } else { if (IS_CONST == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); HANDLE_EXCEPTION(); @@ -31540,7 +31554,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -31566,7 +31580,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HAND container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -31639,12 +31653,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HAND container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -31671,12 +31685,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HAN container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -31702,7 +31716,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HAN container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -31778,18 +31792,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CON container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -31816,7 +31830,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -31824,7 +31838,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_ property = EX_CONSTANT(opline->op2); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -31894,7 +31908,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDL object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -31902,7 +31916,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDL property_name = EX_CONSTANT(opline->op2); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -31929,7 +31943,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDL object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -31978,7 +31992,7 @@ try_assign_dim_array: } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { if (IS_CONST == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "[] operator not supported for strings"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -32151,7 +32165,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); HANDLE_EXCEPTION(); @@ -32161,7 +32175,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST object = _get_zval_ptr_cv_undef(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -32181,7 +32195,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); HANDLE_EXCEPTION(); @@ -32197,7 +32211,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); HANDLE_EXCEPTION(); @@ -32207,7 +32221,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } @@ -32318,7 +32332,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONS UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -32495,7 +32509,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLE HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); if (IS_CV != IS_CONST) { zend_string_release(Z_STR(tmp)); } @@ -32532,12 +32546,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLE SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -32605,12 +32619,12 @@ num_index_dim: } if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); } else { Z_OBJ_HT_P(container)->unset_dimension(container, offset); } } else if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); } } while (0); @@ -32629,12 +32643,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLE SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -32781,7 +32795,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -32918,7 +32932,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -33008,7 +33022,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZE SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); HANDLE_EXCEPTION(); @@ -33043,7 +33057,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZE zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -33322,7 +33336,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -33357,7 +33371,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -33532,7 +33546,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -33559,7 +33573,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -33724,7 +33738,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER value_ptr = _get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets nor overloaded objects"); HANDLE_EXCEPTION(); } @@ -33745,14 +33759,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets nor overloaded objects"); if (free_op2) {zval_ptr_dtor_nogc(free_op2);}; HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) && UNEXPECTED(!Z_ISREF_P(variable_ptr))) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot assign by reference to overloaded object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot assign by reference to overloaded object"); if (free_op2) {zval_ptr_dtor_nogc(free_op2);}; HANDLE_EXCEPTION(); @@ -33831,7 +33845,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER( HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); if (IS_CV != IS_CONST) { zend_string_release(Z_STR(tmp)); } @@ -34016,7 +34030,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -34051,7 +34065,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -34159,13 +34173,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -34191,7 +34205,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); FREE_OP(free_op_data1); @@ -34476,7 +34490,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -34503,7 +34517,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); HANDLE_EXCEPTION(); } @@ -34638,7 +34652,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HAN container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED); @@ -34661,7 +34675,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HA container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, NULL, IS_UNUSED); @@ -34684,14 +34698,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNU if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -34703,7 +34717,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNU } else { if (IS_UNUSED == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); HANDLE_EXCEPTION(); @@ -34731,7 +34745,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HAND object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -34780,7 +34794,7 @@ try_assign_dim_array: } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { if (IS_UNUSED == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "[] operator not supported for strings"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -34885,7 +34899,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUS UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -35062,7 +35076,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDL HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); if (IS_CV != IS_CONST) { zend_string_release(Z_STR(tmp)); } @@ -35200,7 +35214,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(Z SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); HANDLE_EXCEPTION(); @@ -35235,7 +35249,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(Z zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -35991,7 +36005,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -36000,7 +36014,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -36055,13 +36069,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -36087,7 +36101,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); FREE_OP(free_op_data1); @@ -36129,7 +36143,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_C var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -36386,7 +36400,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -36394,7 +36408,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -36467,7 +36481,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -36475,7 +36489,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); HANDLE_EXCEPTION(); } @@ -36557,7 +36571,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV); @@ -36580,7 +36594,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLE container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV); @@ -36618,14 +36632,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -36637,7 +36651,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_ } else { if (IS_CV == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); HANDLE_EXCEPTION(); @@ -36661,7 +36675,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HAN container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -36687,7 +36701,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -36760,12 +36774,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -36792,12 +36806,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLE container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -36823,7 +36837,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLE container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -36899,18 +36913,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -36937,7 +36951,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HAN container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -36945,7 +36959,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HAN property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); HANDLE_EXCEPTION(); } @@ -36970,7 +36984,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER( object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -36978,7 +36992,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER( property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } @@ -37005,7 +37019,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER( object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -37054,7 +37068,7 @@ try_assign_dim_array: } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { if (IS_CV == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "[] operator not supported for strings"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -37139,7 +37153,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER( value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op2.var); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets nor overloaded objects"); HANDLE_EXCEPTION(); } @@ -37160,14 +37174,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER( variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets nor overloaded objects"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) && UNEXPECTED(!Z_ISREF_P(variable_ptr))) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot assign by reference to overloaded object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot assign by reference to overloaded object"); HANDLE_EXCEPTION(); @@ -37287,7 +37301,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); HANDLE_EXCEPTION(); @@ -37297,7 +37311,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA object = _get_zval_ptr_cv_undef(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -37317,7 +37331,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); HANDLE_EXCEPTION(); @@ -37333,7 +37347,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); HANDLE_EXCEPTION(); @@ -37343,7 +37357,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } @@ -37454,7 +37468,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_H UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -37586,12 +37600,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(Z SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -37659,12 +37673,12 @@ num_index_dim: } if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); } else { Z_OBJ_HT_P(container)->unset_dimension(container, offset); } } else if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); } } while (0); @@ -37683,12 +37697,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(Z SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); HANDLE_EXCEPTION(); } @@ -37730,7 +37744,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -37867,7 +37881,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -37910,7 +37924,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_ SAVE_OPLINE(); if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield from finally in a force-closed generator"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield from finally in a force-closed generator"); HANDLE_EXCEPTION(); @@ -37945,7 +37959,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_ zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot yield string offsets by reference"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot yield string offsets by reference"); HANDLE_EXCEPTION(); } @@ -38680,7 +38694,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -38689,7 +38703,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -38744,13 +38758,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -38776,7 +38790,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_dim_helper_SP var_ptr = Z_INDIRECT(rv); if (UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); FREE_OP(free_op_data1); @@ -38819,7 +38833,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_C var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use assign-op operators with overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -39077,7 +39091,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -39085,7 +39099,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -39159,7 +39173,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -39167,7 +39181,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -39250,7 +39264,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR_HAN container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR)); @@ -39273,7 +39287,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR_HA container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); HANDLE_EXCEPTION(); } zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR)); @@ -39311,14 +39325,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) { if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -39330,7 +39344,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP } else { if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use [] for reading"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use [] for reading"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -39354,7 +39368,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -39380,7 +39394,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -39454,12 +39468,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HAN container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -39486,12 +39500,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR_HA container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -39517,7 +39531,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HA container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -39594,18 +39608,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use temporary expression in write context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use temporary expression in write context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -39632,7 +39646,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -39640,7 +39654,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -39665,7 +39679,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_HAND object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -39673,7 +39687,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_HAND property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -39700,7 +39714,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_HAND object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use string offset as an array"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); @@ -39749,7 +39763,7 @@ try_assign_dim_array: } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { if (EXPECTED(Z_STRLEN_P(object_ptr) != 0)) { if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { - zend_error(E_EXCEPTION | E_ERROR, "[] operator not supported for strings"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); @@ -39893,7 +39907,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -39903,7 +39917,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA object = _get_zval_ptr_cv_undef(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -39923,7 +39937,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -39939,7 +39953,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -39949,7 +39963,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } zval_ptr_dtor_nogc(free_op2); @@ -40061,7 +40075,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPV UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var); if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot create references to/from string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot create references to/from string offsets"); zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var))); HANDLE_EXCEPTION(); } @@ -40193,12 +40207,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMPVAR_HANDL SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -40266,12 +40280,12 @@ num_index_dim: } if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); } else { Z_OBJ_HT_P(container)->unset_dimension(container, offset); } } else if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); } } while (0); @@ -40291,12 +40305,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDL SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot unset string offsets"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot unset string offsets"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -40339,7 +40353,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -40476,7 +40490,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -40864,7 +40878,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_TMPVAR_HANDLER(ZEND obj = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(obj) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -40883,7 +40897,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_TMPVAR_HANDLER(ZEND if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "__clone method called on non-object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "__clone method called on non-object"); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -40894,9 +40908,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_TMPVAR_HANDLER(ZEND clone_call = Z_OBJ_HT_P(obj)->clone_obj; if (UNEXPECTED(clone_call == NULL)) { if (ce) { - zend_error(E_EXCEPTION | E_ERROR, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); } else { - zend_error(E_EXCEPTION | E_ERROR, "Trying to clone an uncloneable object"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Trying to clone an uncloneable object"); } zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); @@ -40907,7 +40921,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_TMPVAR_HANDLER(ZEND /* Ensure that if we're calling a private function, we're allowed to do so. */ if (UNEXPECTED(ce != EG(scope))) { - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -40915,7 +40929,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_TMPVAR_HANDLER(ZEND /* 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_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -41775,7 +41789,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -41802,7 +41816,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -41970,7 +41984,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -42175,7 +42189,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -42185,7 +42199,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C object = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -42205,7 +42219,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); @@ -42221,7 +42235,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); @@ -42231,7 +42245,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } zval_ptr_dtor_nogc(free_op1); @@ -42389,7 +42403,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_CONST_HA HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { zend_string_release(Z_STR(tmp)); } @@ -42533,7 +42547,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -42670,7 +42684,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -42803,7 +42817,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -42830,7 +42844,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -43013,7 +43027,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_VAR_HAND HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { zend_string_release(Z_STR(tmp)); } @@ -43226,7 +43240,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -43253,7 +43267,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); } @@ -43436,7 +43450,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_H HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2))); if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { zend_string_release(Z_STR(tmp)); } @@ -44212,7 +44226,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HA container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -44372,7 +44386,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -44382,7 +44396,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C object = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -44402,7 +44416,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); @@ -44418,7 +44432,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); @@ -44428,7 +44442,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } zval_ptr_dtor_nogc(free_op1); @@ -44542,7 +44556,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -44679,7 +44693,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); HANDLE_EXCEPTION(); } @@ -45375,7 +45389,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVA container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -45536,7 +45550,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "Method name must be a string"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Method name must be a string"); zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -45546,7 +45560,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T object = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -45566,7 +45580,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } - zend_error(E_EXCEPTION | E_ERROR, "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, E_EXCEPTION, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); @@ -45582,7 +45596,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T zend_object *orig_obj = obj; if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Object does not support method calls"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Object does not support method calls"); zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); @@ -45592,7 +45606,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name)); } zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); @@ -45707,7 +45721,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } @@ -45844,7 +45858,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } |
