diff --git a/Zend/Optimizer/compact_literals.c b/Zend/Optimizer/compact_literals.c
index d603fe159e20..e43da5892b9f 100644
--- a/Zend/Optimizer/compact_literals.c
+++ b/Zend/Optimizer/compact_literals.c
@@ -120,7 +120,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
HashTable hash;
zend_string *key = NULL;
void *checkpoint = zend_arena_checkpoint(ctx->arena);
- int *const_slot, *class_slot, *func_slot, *bind_var_slot, *property_slot, *method_slot, *jmp_slot;
+ int *const_slot, *class_slot, *func_slot, *bind_var_slot, *property_slot, *method_slot, *jmp_slot, *assign_obj_slots;
if (op_array->last_literal) {
uint32_t j;
@@ -439,14 +439,15 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
zend_hash_clean(&hash);
op_array->last_literal = j;
- const_slot = zend_arena_alloc(&ctx->arena, j * 7 * sizeof(int));
- memset(const_slot, -1, j * 7 * sizeof(int));
+ const_slot = zend_arena_alloc(&ctx->arena, j * 8 * sizeof(int));
+ memset(const_slot, -1, j * 8 * sizeof(int));
class_slot = const_slot + j;
func_slot = class_slot + j;
bind_var_slot = func_slot + j;
property_slot = bind_var_slot + j;
method_slot = property_slot + j;
jmp_slot = method_slot + j;
+ assign_obj_slots = jmp_slot + j;
/* Update opcodes to use new literals table */
cache_size = zend_op_array_extension_handles * sizeof(void*);
@@ -500,6 +501,19 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
}
break;
case ZEND_ASSIGN_OBJ:
+ if (opline->op2_type == IS_CONST) {
+ if (opline->op1_type == IS_UNUSED &&
+ assign_obj_slots[opline->op2.constant] >= 0) {
+ opline->extended_value = assign_obj_slots[opline->op2.constant];
+ } else {
+ opline->extended_value = cache_size;
+ cache_size += 3 * sizeof(void *);
+ if (opline->op1_type == IS_UNUSED) {
+ assign_obj_slots[opline->op2.constant] = opline->extended_value;
+ }
+ }
+ }
+ break;
case ZEND_ASSIGN_OBJ_REF:
case ZEND_FETCH_OBJ_R:
case ZEND_FETCH_OBJ_W:
diff --git a/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt b/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt
new file mode 100644
index 000000000000..2e24ad1f8d03
--- /dev/null
+++ b/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Asymmetric set visibility survives optimizer cache-slot sharing between $this reads and writes
+--FILE--
+prop; the write
+ // below must not reuse that (read-kind) resolution to bypass the
+ // set-visibility check when the optimizer shares property slots.
+ var_dump($this->prop);
+ try {
+ $this->prop = 'overwritten';
+ } catch (Error $e) {
+ echo $e->getMessage(), "\n";
+ }
+ var_dump($this->prop);
+ }
+}
+
+$c = new C;
+$c->test();
+$c->test();
+?>
+--EXPECT--
+string(7) "default"
+Cannot modify private(set) property P::$prop from scope C
+string(7) "default"
+string(7) "default"
+Cannot modify private(set) property P::$prop from scope C
+string(7) "default"
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index bc93aa8892ac..ab371cbc4e22 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -234,11 +234,6 @@ ZEND_API void* zend_vm_stack_extend(size_t size)
return ptr;
}
-ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data, uint32_t var)
-{
- return EX_VAR(var);
-}
-
ZEND_API bool zend_gcc_global_regs(void)
{
#if defined(HAVE_GCC_GLOBAL_REGS)
@@ -1070,7 +1065,7 @@ ZEND_API bool zend_never_inline zend_verify_property_type(const zend_property_in
return i_zend_verify_property_type(info, property, strict);
}
-static zend_never_inline zval* zend_assign_to_typed_prop(const zend_property_info *info, zval *property_val, zval *value, zend_refcounted **garbage_ptr EXECUTE_DATA_DC)
+static zend_never_inline zval* zend_assign_to_typed_prop(const zend_property_info *info, zval *property_val, zval *value, zend_refcounted **garbage_ptr, bool check_writable EXECUTE_DATA_DC)
{
zval tmp;
@@ -1079,7 +1074,7 @@ static zend_never_inline zval* zend_assign_to_typed_prop(const zend_property_inf
zend_readonly_property_modification_error(info);
return &EG(uninitialized_zval);
}
- if (info->flags & ZEND_ACC_PPP_SET_MASK && !zend_asymmetric_property_has_set_access(info)) {
+ if (check_writable && (info->flags & ZEND_ACC_PPP_SET_MASK) && !zend_asymmetric_property_has_set_access(info)) {
zend_asymmetric_visibility_property_modification_error(info, "modify");
return &EG(uninitialized_zval);
}
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index eb73b3f3de9e..a895afd3dbcd 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -488,8 +488,6 @@ ZEND_API void ZEND_FASTCALL zend_init_func_run_time_cache(zend_op_array *op_arra
ZEND_API void zend_fetch_dimension_const(zval *result, const zval *container, zval *dim, int type);
-ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);
-
ZEND_API bool zend_gcc_global_regs(void);
#define ZEND_USER_OPCODE_CONTINUE 0 /* execute next opcode */
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 754f603100c2..e06287895d15 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -1138,6 +1138,11 @@ ZEND_API zval *zend_std_write_property(zend_object *zobj, zend_string *name, zva
if ((prop_info->flags & ZEND_ACC_PPP_SET_MASK) && !zend_asymmetric_property_has_set_access(prop_info)) {
zend_asymmetric_visibility_property_modification_error(prop_info, "modify");
variable_ptr = &EG(error_zval);
+ if (cache_slot) {
+ /* Reset cache slot to dodge fast path in next execution. */
+ CACHE_POLYMORPHIC_PTR_EX(cache_slot, NULL, NULL);
+ CACHE_PTR_EX(cache_slot + 2, NULL);
+ }
goto exit;
}
}
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index d14230514b34..d89d460d9d9d 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2524,7 +2524,7 @@ ZEND_VM_C_LABEL(assign_obj_simple):
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
ZEND_VM_C_GOTO(free_and_exit_assign_obj);
} else {
ZEND_VM_C_LABEL(fast_assign_obj):
@@ -2659,7 +2659,7 @@ ZEND_VM_HANDLER(25, ZEND_ASSIGN_STATIC_PROP, ANY, ANY, CACHE_SLOT, SPEC(OP_DATA=
value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R);
if (ZEND_TYPE_IS_SET(prop_info->type)) {
- value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage, /* check_writable */ true EXECUTE_DATA_CC);
FREE_OP_DATA();
} else {
value = zend_assign_to_variable_ex(prop, value, OP_DATA_TYPE, EX_USES_STRICT_TYPES(), &garbage);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 53bcdccd9719..4c830f203bfb 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1006,7 +1006,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_STATIC
value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (ZEND_TYPE_IS_SET(prop_info->type)) {
- value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage, /* check_writable */ true EXECUTE_DATA_CC);
} else {
@@ -1044,7 +1044,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_STATIC
value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC);
if (ZEND_TYPE_IS_SET(prop_info->type)) {
- value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage, /* check_writable */ true EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var));
} else {
value = zend_assign_to_variable_ex(prop, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage);
@@ -1082,7 +1082,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_STATIC
value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC);
if (ZEND_TYPE_IS_SET(prop_info->type)) {
- value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage, /* check_writable */ true EXECUTE_DATA_CC);
} else {
@@ -24575,7 +24575,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -24732,7 +24732,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -24887,7 +24887,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -27283,7 +27283,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -27439,7 +27439,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -27593,7 +27593,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -31110,7 +31110,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -31267,7 +31267,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -31422,7 +31422,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -33644,7 +33644,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -33802,7 +33802,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -33958,7 +33958,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -35766,7 +35766,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -35923,7 +35923,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -36078,7 +36078,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -38362,7 +38362,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -38520,7 +38520,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -38676,7 +38676,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -42731,7 +42731,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -42889,7 +42889,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -43045,7 +43045,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -46554,7 +46554,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -46711,7 +46711,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -46866,7 +46866,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -51673,7 +51673,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -51831,7 +51831,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -51987,7 +51987,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ASSIGN_OBJ_SP
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -53954,7 +53954,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_STATIC_PROP
value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (ZEND_TYPE_IS_SET(prop_info->type)) {
- value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage, /* check_writable */ true EXECUTE_DATA_CC);
} else {
@@ -53992,7 +53992,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_STATIC_PROP
value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC);
if (ZEND_TYPE_IS_SET(prop_info->type)) {
- value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage, /* check_writable */ true EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var));
} else {
value = zend_assign_to_variable_ex(prop, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage);
@@ -54030,7 +54030,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_STATIC_PROP
value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC);
if (ZEND_TYPE_IS_SET(prop_info->type)) {
- value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage, /* check_writable */ true EXECUTE_DATA_CC);
} else {
@@ -77205,7 +77205,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_VA
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -77362,7 +77362,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_VA
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -77517,7 +77517,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_VA
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -79913,7 +79913,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_VA
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -80069,7 +80069,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_VA
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -80223,7 +80223,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_VA
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -83740,7 +83740,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_VA
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -83897,7 +83897,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_VA
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -84052,7 +84052,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_VA
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -86274,7 +86274,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_UN
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -86432,7 +86432,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_UN
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -86588,7 +86588,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_UN
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -88396,7 +88396,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_UN
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -88553,7 +88553,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_UN
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -88708,7 +88708,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_UN
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -90992,7 +90992,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_UN
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -91150,7 +91150,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_UN
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -91306,7 +91306,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_UN
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -95361,7 +95361,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_CV
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -95519,7 +95519,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_CV
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -95675,7 +95675,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_CV
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -99184,7 +99184,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_CV
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -99341,7 +99341,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_CV
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -99496,7 +99496,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_CV
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -104201,7 +104201,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_CV
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -104359,7 +104359,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_CV
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
@@ -104515,7 +104515,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_ASSIGN_OBJ_SPEC_CV
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
if (prop_info != NULL) {
- value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
+ value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, /* check_writable */ false EXECUTE_DATA_CC);
goto free_and_exit_assign_obj;
} else {
fast_assign_obj:
diff --git a/ext/bz2/tests/001.phpt b/ext/bz2/tests/001.phpt
index 6323a224c3ac..31a8c1ea8bce 100644
--- a/ext/bz2/tests/001.phpt
+++ b/ext/bz2/tests/001.phpt
@@ -8,31 +8,31 @@ bz2
try {
var_dump(bzopen("", "r"));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bzopen("", "w"));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bzopen("no_such_file", ""));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bzopen("no_such_file", "x"));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bzopen("no_such_file", "rw"));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(bzopen("no_such_file", "r"));
@@ -42,11 +42,11 @@ var_dump(bzopen($fp, "r"));
?>
--EXPECTF--
-bzopen(): Argument #1 ($file) must not be empty
-bzopen(): Argument #1 ($file) must not be empty
-bzopen(): Argument #2 ($mode) must be either "r" or "w"
-bzopen(): Argument #2 ($mode) must be either "r" or "w"
-bzopen(): Argument #2 ($mode) must be either "r" or "w"
+ValueError: bzopen(): Argument #1 ($file) must not be empty
+ValueError: bzopen(): Argument #1 ($file) must not be empty
+ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w"
+ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w"
+ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w"
Warning: bzopen(): Failed to open stream: No such file or directory in %s on line %d
bool(false)
diff --git a/ext/bz2/tests/002.phpt b/ext/bz2/tests/002.phpt
index 7210f90a4d92..105fa0b4f57e 100644
--- a/ext/bz2/tests/002.phpt
+++ b/ext/bz2/tests/002.phpt
@@ -31,14 +31,14 @@ $fp = fopen("bz_open_002.txt", "br");
try {
var_dump(bzopen($fp, "r"));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$fp = fopen("bz_open_002.txt", "br");
try {
var_dump(bzopen($fp, "w"));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$fp = fopen("bz_open_002.txt", "r");
@@ -91,10 +91,10 @@ resource(%d) of type (stream)
resource(%d) of type (stream)
Warning: fopen(): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d
-bzopen(): Argument #1 ($file) must be of type string or file-resource, false given
+TypeError: bzopen(): Argument #1 ($file) must be of type string or file-resource, false given
Warning: fopen(): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d
-bzopen(): Argument #1 ($file) must be of type string or file-resource, false given
+TypeError: bzopen(): Argument #1 ($file) must be of type string or file-resource, false given
Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d
bool(false)
diff --git a/ext/bz2/tests/003-mb.phpt b/ext/bz2/tests/003-mb.phpt
index 3189b473a4ac..805cc150e1ed 100644
--- a/ext/bz2/tests/003-mb.phpt
+++ b/ext/bz2/tests/003-mb.phpt
@@ -11,7 +11,7 @@ var_dump(bzread($fd, 0));
try {
var_dump(bzread($fd, -10));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(bzread($fd, 1));
@@ -21,7 +21,7 @@ var_dump(bzread($fd, 100000));
?>
--EXPECT--
string(0) ""
-bzread(): Argument #2 ($length) must be greater than or equal to 0
+ValueError: bzread(): Argument #2 ($length) must be greater than or equal to 0
string(1) "R"
string(2) "is"
string(251) "ing up from the heart of the desert
diff --git a/ext/bz2/tests/003.phpt b/ext/bz2/tests/003.phpt
index 4b6ee820dd56..f737422a074c 100644
--- a/ext/bz2/tests/003.phpt
+++ b/ext/bz2/tests/003.phpt
@@ -11,7 +11,7 @@ var_dump(bzread($fd, 0));
try {
var_dump(bzread($fd, -10));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(bzread($fd, 1));
@@ -21,7 +21,7 @@ var_dump(bzread($fd, 100000));
?>
--EXPECT--
string(0) ""
-bzread(): Argument #2 ($length) must be greater than or equal to 0
+ValueError: bzread(): Argument #2 ($length) must be greater than or equal to 0
string(1) "R"
string(2) "is"
string(251) "ing up from the heart of the desert
diff --git a/ext/bz2/tests/004.phpt b/ext/bz2/tests/004.phpt
index 240cef37a17a..910aa067f6b4 100644
--- a/ext/bz2/tests/004.phpt
+++ b/ext/bz2/tests/004.phpt
@@ -39,22 +39,22 @@ bzclose($fd2);
try {
var_dump(bzread($fd2));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerror($fd2));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerrstr($fd2));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerrno($fd2));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Done\n";
@@ -112,8 +112,8 @@ array(2) {
}
string(10) "DATA_ERROR"
int(-4)
-bzread(): Argument #1 ($bz) must be an open stream resource
-bzerror(): Argument #1 ($bz) must be an open stream resource
-bzerrstr(): Argument #1 ($bz) must be an open stream resource
-bzerrno(): Argument #1 ($bz) must be an open stream resource
+TypeError: bzread(): Argument #1 ($bz) must be an open stream resource
+TypeError: bzerror(): Argument #1 ($bz) must be an open stream resource
+TypeError: bzerrstr(): Argument #1 ($bz) must be an open stream resource
+TypeError: bzerrno(): Argument #1 ($bz) must be an open stream resource
Done
diff --git a/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt b/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt
index a9fd3a211869..03b8e09c6547 100644
--- a/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt
+++ b/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt
@@ -8,20 +8,20 @@ $f = fopen(__FILE__, 'r');
try {
var_dump(bzerrno($f));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerrstr($f));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerror($f));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-bzerrno(): Argument #1 ($bz) must be a bz2 stream
-bzerrstr(): Argument #1 ($bz) must be a bz2 stream
-bzerror(): Argument #1 ($bz) must be a bz2 stream
+TypeError: bzerrno(): Argument #1 ($bz) must be a bz2 stream
+TypeError: bzerrstr(): Argument #1 ($bz) must be a bz2 stream
+TypeError: bzerror(): Argument #1 ($bz) must be a bz2 stream
diff --git a/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt b/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt
index b76515a178d9..6f47c2fa237c 100644
--- a/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt
+++ b/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt
@@ -8,16 +8,16 @@ bz2
try {
bzopen("file\0", "w");
} catch (TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bzopen("file\0", "r");
} catch (TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bzopen(): Argument #1 ($file) must not contain null bytes
-bzopen(): Argument #1 ($file) must not contain null bytes
+TypeError: bzopen(): Argument #1 ($file) must not contain null bytes
+TypeError: bzopen(): Argument #1 ($file) must not contain null bytes
diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c
index 983857c553d9..a5970691efef 100644
--- a/ext/calendar/cal_unix.c
+++ b/ext/calendar/cal_unix.c
@@ -59,7 +59,7 @@ PHP_FUNCTION(jdtounix)
RETURN_THROWS();
}
if (uday < 2440588 || (uday - 2440588) > (ZEND_LONG_MAX / SECS_PER_DAY)) { /* before beginning of unix epoch or greater than representable */
- zend_value_error("jday must be between 2440588 and " ZEND_LONG_FMT, ZEND_LONG_MAX / SECS_PER_DAY + 2440588);
+ zend_argument_value_error(1, "jday must be between 2440588 and " ZEND_LONG_FMT, ZEND_LONG_MAX / SECS_PER_DAY + 2440588);
RETURN_THROWS();
}
diff --git a/ext/calendar/tests/bug80185.phpt b/ext/calendar/tests/bug80185.phpt
index d52f9696a173..e9ca439b7178 100644
--- a/ext/calendar/tests/bug80185.phpt
+++ b/ext/calendar/tests/bug80185.phpt
@@ -13,10 +13,10 @@ var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440588)));
try {
var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440589)));
} catch (ValueError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
int(2170713600)
int(9223372036854720000)
-jday must be between 2440588 and 106751993607888
+ValueError: jdtounix(): Argument #1 ($julian_day) jday must be between 2440588 and 106751993607888
diff --git a/ext/calendar/tests/bug80185_32bit.phpt b/ext/calendar/tests/bug80185_32bit.phpt
index 8d7088fe856c..ed54502f4432 100644
--- a/ext/calendar/tests/bug80185_32bit.phpt
+++ b/ext/calendar/tests/bug80185_32bit.phpt
@@ -11,16 +11,16 @@ if (PHP_INT_SIZE != 4) die("skip for 32bit platforms only");
try {
var_dump(jdtounix(2465712));
} catch (ValueError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440588)));
try {
var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440589)));
} catch (ValueError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-jday must be between 2440588 and 2465443
+ValueError: jdtounix(): Argument #1 ($julian_day) jday must be between 2440588 and 2465443
int(2147472000)
-jday must be between 2440588 and 2465443
+ValueError: jdtounix(): Argument #1 ($julian_day) jday must be between 2440588 and 2465443
diff --git a/ext/calendar/tests/cal_days_in_month_error1.phpt b/ext/calendar/tests/cal_days_in_month_error1.phpt
index e110c13cc2a7..dcf7db51ec0b 100644
--- a/ext/calendar/tests/cal_days_in_month_error1.phpt
+++ b/ext/calendar/tests/cal_days_in_month_error1.phpt
@@ -9,14 +9,14 @@ calendar
try {
cal_days_in_month(-1, 4, 2017);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try{
cal_days_in_month(CAL_GREGORIAN,20, 2009);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-cal_days_in_month(): Argument #1 ($calendar) must be a valid calendar ID
-Invalid date
+ValueError: cal_days_in_month(): Argument #1 ($calendar) must be a valid calendar ID
+ValueError: Invalid date
diff --git a/ext/calendar/tests/cal_from_jd_error1.phpt b/ext/calendar/tests/cal_from_jd_error1.phpt
index 3b4e11b8350d..80731b867647 100644
--- a/ext/calendar/tests/cal_from_jd_error1.phpt
+++ b/ext/calendar/tests/cal_from_jd_error1.phpt
@@ -9,8 +9,8 @@ calendar
try {
cal_from_jd(1748326, -1);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-cal_from_jd(): Argument #2 ($calendar) must be a valid calendar ID
+ValueError: cal_from_jd(): Argument #2 ($calendar) must be a valid calendar ID
diff --git a/ext/calendar/tests/cal_info.phpt b/ext/calendar/tests/cal_info.phpt
index 18884917e534..1990c1ccbd6d 100644
--- a/ext/calendar/tests/cal_info.phpt
+++ b/ext/calendar/tests/cal_info.phpt
@@ -11,7 +11,7 @@ calendar
try {
cal_info(99999);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
@@ -216,4 +216,4 @@ Array
[calname] => Julian
[calsymbol] => CAL_JULIAN
)
-cal_info(): Argument #1 ($calendar) must be a valid calendar ID
+ValueError: cal_info(): Argument #1 ($calendar) must be a valid calendar ID
diff --git a/ext/calendar/tests/cal_to_jd_error1.phpt b/ext/calendar/tests/cal_to_jd_error1.phpt
index 1cef36af69fe..18ab699de1d7 100644
--- a/ext/calendar/tests/cal_to_jd_error1.phpt
+++ b/ext/calendar/tests/cal_to_jd_error1.phpt
@@ -9,8 +9,8 @@ calendar
try {
cal_to_jd(-1, 8, 26, 74);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-cal_to_jd(): Argument #1 ($calendar) must be a valid calendar ID
+ValueError: cal_to_jd(): Argument #1 ($calendar) must be a valid calendar ID
diff --git a/ext/calendar/tests/easter_date_64bit.phpt b/ext/calendar/tests/easter_date_64bit.phpt
index 3939b7e4a4d4..f6d97ba9f20f 100644
--- a/ext/calendar/tests/easter_date_64bit.phpt
+++ b/ext/calendar/tests/easter_date_64bit.phpt
@@ -20,14 +20,14 @@ echo date("Y-m-d", easter_date(2047))."\n";
try {
easter_date(1492);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-2000-04-23
-2001-04-15
-2002-03-31
-2045-04-09
-2046-03-25
-2047-04-14
-easter_date(): Argument #1 ($year) must be a year after 1970 (inclusive)
+2000-04-23
+2001-04-15
+2002-03-31
+2045-04-09
+2046-03-25
+2047-04-14
+ValueError: easter_date(): Argument #1 ($year) must be a year after 1970 (inclusive)
diff --git a/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt b/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt
index 2c7afbdfa2d9..c2177673ffee 100644
--- a/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt
+++ b/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt
@@ -14,8 +14,8 @@ putenv('TZ=UTC');
try {
easter_date(293274701009);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-easter_date(): Argument #1 ($year) must be a year before 2.000.000.000 (inclusive)
+ValueError: easter_date(): Argument #1 ($year) must be a year before 2.000.000.000 (inclusive)
diff --git a/ext/calendar/tests/gh16228.phpt b/ext/calendar/tests/gh16228.phpt
index 9ce80688195b..0699152566fe 100644
--- a/ext/calendar/tests/gh16228.phpt
+++ b/ext/calendar/tests/gh16228.phpt
@@ -7,20 +7,20 @@ calendar
try {
easter_days(PHP_INT_MAX, 0);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
easter_days(-1, 0);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
easter_date(PHP_INT_MAX, 0);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-easter_days(): Argument #1 ($year) must be between 1 and %d
-easter_days(): Argument #1 ($year) must be between 1 and %d
-easter_date(): Argument #1 ($year) must be between 1 and %d
+ValueError: easter_days(): Argument #1 ($year) must be between 1 and %d
+ValueError: easter_days(): Argument #1 ($year) must be between 1 and %d
+ValueError: easter_date(): Argument #1 ($year) must be between 1 and %d
diff --git a/ext/calendar/tests/gh16231.phpt b/ext/calendar/tests/gh16231.phpt
index 89b09dd3f63a..a68a4ea665be 100644
--- a/ext/calendar/tests/gh16231.phpt
+++ b/ext/calendar/tests/gh16231.phpt
@@ -7,15 +7,15 @@ calendar
try {
jdtounix(PHP_INT_MIN);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
jdtounix(240587);
} catch (\ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-jday must be between 2440588 and %d
-jday must be between 2440588 and %d
+ValueError: jdtounix(): Argument #1 ($julian_day) jday must be between 2440588 and %d
+ValueError: jdtounix(): Argument #1 ($julian_day) jday must be between 2440588 and %d
diff --git a/ext/calendar/tests/gh16234_2_64.phpt b/ext/calendar/tests/gh16234_2_64.phpt
index 7da254609650..166e67a0efaf 100644
--- a/ext/calendar/tests/gh16234_2_64.phpt
+++ b/ext/calendar/tests/gh16234_2_64.phpt
@@ -13,9 +13,8 @@ if (PHP_INT_SIZE == 4) {
try {
jewishtojd(10, 6, PHP_INT_MIN);
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-jewishtojd(): Argument #3 ($year) must be between %i and %d
-
+ValueError: jewishtojd(): Argument #3 ($year) must be between %i and %d
diff --git a/ext/calendar/tests/gh19371.phpt b/ext/calendar/tests/gh19371.phpt
index 1d807a983886..b2b4837851cb 100644
--- a/ext/calendar/tests/gh19371.phpt
+++ b/ext/calendar/tests/gh19371.phpt
@@ -10,52 +10,52 @@ calendar
try {
echo cal_days_in_month(CAL_GREGORIAN, 12, PHP_INT_MAX);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_days_in_month(CAL_GREGORIAN, PHP_INT_MIN, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_days_in_month(CAL_GREGORIAN, PHP_INT_MAX, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_to_jd(CAL_GREGORIAN, PHP_INT_MIN, 1, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_to_jd(CAL_GREGORIAN, PHP_INT_MAX, 1, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_to_jd(CAL_GREGORIAN, 1, PHP_INT_MIN, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_to_jd(CAL_GREGORIAN, 1, PHP_INT_MAX, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_to_jd(CAL_GREGORIAN, 1, 1, PHP_INT_MAX);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-cal_days_in_month(): Argument #3 ($year) must be less than 2147483646
-cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646
-cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646
-cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646
-cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646
-cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647
-cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647
-cal_to_jd(): Argument #4 ($year) must be less than 2147483646
+ValueError: cal_days_in_month(): Argument #3 ($year) must be less than 2147483646
+ValueError: cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646
+ValueError: cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646
+ValueError: cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646
+ValueError: cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646
+ValueError: cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647
+ValueError: cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647
+ValueError: cal_to_jd(): Argument #4 ($year) must be less than 2147483646
diff --git a/ext/calendar/tests/jdtojewish.phpt b/ext/calendar/tests/jdtojewish.phpt
index 6b1c2e3f7756..ba40a2056da5 100644
--- a/ext/calendar/tests/jdtojewish.phpt
+++ b/ext/calendar/tests/jdtojewish.phpt
@@ -23,7 +23,7 @@ echo jdtojewish(gregoriantojd(1,1,9998)) . "\n";
try {
jdtojewish(gregoriantojd(1,1,9998),true);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -42,4 +42,4 @@ string(%d) "2/22/5763
2/30/5763
3/16/5765
3/8/13758
-Year out of range (0-9999)
+ValueError: Year out of range (0-9999)
diff --git a/ext/calendar/tests/jdtojewish_hebrew.phpt b/ext/calendar/tests/jdtojewish_hebrew.phpt
index ceb53c219e71..3909162e1bf4 100644
--- a/ext/calendar/tests/jdtojewish_hebrew.phpt
+++ b/ext/calendar/tests/jdtojewish_hebrew.phpt
@@ -46,4 +46,3 @@ e020f1e9e5ef20e4e0
e020faeee5e620e4e0
e020e0e120e4e0
e020e0ece5ec20e4e0
-
diff --git a/ext/calendar/tests/jdtounix_error1.phpt b/ext/calendar/tests/jdtounix_error1.phpt
index 0032e376db3c..56e4e6fc05a2 100644
--- a/ext/calendar/tests/jdtounix_error1.phpt
+++ b/ext/calendar/tests/jdtounix_error1.phpt
@@ -11,8 +11,8 @@ calendar
try {
jdtounix(2440579);
} catch (ValueError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-jday must be between 2440588 and %d
+ValueError: jdtounix(): Argument #1 ($julian_day) jday must be between 2440588 and %d
diff --git a/ext/calendar/tests/unixtojd_error1.phpt b/ext/calendar/tests/unixtojd_error1.phpt
index 171d400b99e7..a17a5b291a05 100644
--- a/ext/calendar/tests/unixtojd_error1.phpt
+++ b/ext/calendar/tests/unixtojd_error1.phpt
@@ -13,12 +13,12 @@ putenv('TZ=UTC');
try {
unixtojd(-1);
} catch (ValueError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
var_dump(unixtojd(null)) . PHP_EOL;
var_dump(unixtojd(time())) . PHP_EOL;
?>
--EXPECTF--
-unixtojd(): Argument #1 ($timestamp) must be greater than or equal to 0
+ValueError: unixtojd(): Argument #1 ($timestamp) must be greater than or equal to 0
int(%d)
int(%d)
diff --git a/ext/exif/tests/bug77540.phpt b/ext/exif/tests/bug77540.phpt
index 397e9f8223ba..92a5927068fd 100644
--- a/ext/exif/tests/bug77540.phpt
+++ b/ext/exif/tests/bug77540.phpt
@@ -13,4 +13,4 @@ DONE
--EXPECT--
Width 0
Height 0
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/exif/tests/bug77831.phpt b/ext/exif/tests/bug77831.phpt
index 5f29581d11ce..1490b2d66064 100644
--- a/ext/exif/tests/bug77831.phpt
+++ b/ext/exif/tests/bug77831.phpt
@@ -10,4 +10,4 @@ DONE
--EXPECTF--
%A
bool(false)
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/exif/tests/bug77950.phpt b/ext/exif/tests/bug77950.phpt
index bccd9ec3e2c3..7361ff596a61 100644
--- a/ext/exif/tests/bug77950.phpt
+++ b/ext/exif/tests/bug77950.phpt
@@ -9,4 +9,4 @@ exif_read_data(__DIR__."/bug77950.tiff");
DONE
--EXPECTF--
%A
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/exif/tests/filename_empty.phpt b/ext/exif/tests/filename_empty.phpt
index 753a7c6acd09..89b16cda0afa 100644
--- a/ext/exif/tests/filename_empty.phpt
+++ b/ext/exif/tests/filename_empty.phpt
@@ -8,30 +8,30 @@ exif
try {
exif_read_data("");
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
exif_thumbnail("");
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
exif_read_data("foo\0bar");
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
exif_thumbnail("foo\0bar");
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-exif_read_data(): Argument #1 ($file) must not be empty
-exif_thumbnail(): Argument #1 ($file) must not be empty
-exif_read_data(): Argument #1 ($file) must not contain any null bytes
-exif_thumbnail(): Argument #1 ($file) must not contain any null bytes
+ValueError: exif_read_data(): Argument #1 ($file) must not be empty
+ValueError: exif_thumbnail(): Argument #1 ($file) must not be empty
+ValueError: exif_read_data(): Argument #1 ($file) must not contain any null bytes
+ValueError: exif_thumbnail(): Argument #1 ($file) must not contain any null bytes
diff --git a/ext/fileinfo/tests/bug61173.phpt b/ext/fileinfo/tests/bug61173.phpt
index e135f9093339..9d18dc8bcf52 100644
--- a/ext/fileinfo/tests/bug61173.phpt
+++ b/ext/fileinfo/tests/bug61173.phpt
@@ -9,8 +9,8 @@ try {
$finfo = new finfo(1, '', false);
var_dump($finfo);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-finfo::__construct() expects at most 2 arguments, 3 given
+ArgumentCountError: finfo::__construct() expects at most 2 arguments, 3 given
diff --git a/ext/fileinfo/tests/clone_serialize.phpt b/ext/fileinfo/tests/clone_serialize.phpt
index 768cccfff392..7a63d04908a1 100644
--- a/ext/fileinfo/tests/clone_serialize.phpt
+++ b/ext/fileinfo/tests/clone_serialize.phpt
@@ -11,17 +11,17 @@ try {
$finfo2 = clone $finfo;
var_dump($finfo2->buffer("Test string"));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$finfo3 = unserialize(serialize($finfo));
var_dump($finfo3->buffer("Test string"));
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
string(%d) "%s"
-Trying to clone an uncloneable object of class finfo
-Serialization of 'finfo' is not allowed
+Error: Trying to clone an uncloneable object of class finfo
+Exception: Serialization of 'finfo' is not allowed
diff --git a/ext/fileinfo/tests/finfo_close_error.phpt b/ext/fileinfo/tests/finfo_close_error.phpt
index c7873b462724..798adb7e4dab 100644
--- a/ext/fileinfo/tests/finfo_close_error.phpt
+++ b/ext/fileinfo/tests/finfo_close_error.phpt
@@ -11,7 +11,7 @@ $fp = fopen( __FILE__, 'r' );
try {
var_dump( finfo_close( $fp ) );
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -21,4 +21,4 @@ try {
-- Testing finfo_close() function with wrong resource type --
Deprecated: Function finfo_close() is deprecated since 8.5, as finfo objects are freed automatically in %s on line %d
-finfo_close(): Argument #1 ($finfo) must be of type finfo, resource given
+TypeError: finfo_close(): Argument #1 ($finfo) must be of type finfo, resource given
diff --git a/ext/fileinfo/tests/finfo_file_001.phpt b/ext/fileinfo/tests/finfo_file_001.phpt
index 91b9b69717f6..184eee77633a 100644
--- a/ext/fileinfo/tests/finfo_file_001.phpt
+++ b/ext/fileinfo/tests/finfo_file_001.phpt
@@ -9,20 +9,20 @@ $fp = finfo_open();
try {
var_dump(finfo_file($fp, "\0"));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(finfo_file($fp, ''));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(finfo_file($fp, '.'));
var_dump(finfo_file($fp, '&'));
?>
--EXPECTF--
-finfo_file(): Argument #2 ($filename) must not contain any null bytes
-finfo_file(): Argument #2 ($filename) must not be empty
+ValueError: finfo_file(): Argument #2 ($filename) must not contain any null bytes
+ValueError: finfo_file(): Argument #2 ($filename) must not be empty
string(9) "directory"
Warning: finfo_file(): Failed to open stream: No such file or directory in %s on line %d
diff --git a/ext/fileinfo/tests/finfo_file_basic.phpt b/ext/fileinfo/tests/finfo_file_basic.phpt
index 4545a3063a7f..9348dea33075 100644
--- a/ext/fileinfo/tests/finfo_file_basic.phpt
+++ b/ext/fileinfo/tests/finfo_file_basic.phpt
@@ -16,7 +16,7 @@ var_dump( finfo_file( $finfo, $magicFile ) );
try {
var_dump( finfo_file( $finfo, $magicFile.chr(0).$magicFile) );
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -25,4 +25,4 @@ try {
string(28) "text/x-php; charset=us-ascii"
string(22) "PHP script, ASCII text"
string(29) "text/x-file; charset=us-ascii"
-finfo_file(): Argument #2 ($filename) must not contain any null bytes
+ValueError: finfo_file(): Argument #2 ($filename) must not contain any null bytes
diff --git a/ext/fileinfo/tests/finfo_open_001.phpt b/ext/fileinfo/tests/finfo_open_001.phpt
index 2ed7168e90d3..2ee999113b95 100644
--- a/ext/fileinfo/tests/finfo_open_001.phpt
+++ b/ext/fileinfo/tests/finfo_open_001.phpt
@@ -7,7 +7,7 @@ fileinfo
try {
var_dump(finfo_open(FILEINFO_MIME, "\0"));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(finfo_open(FILEINFO_MIME, NULL));
@@ -22,23 +22,23 @@ var_dump($obj = new finfo(FILEINFO_MIME, ''));
try {
var_dump($obj = new finfo(FILEINFO_MIME, 123));
} catch (\Exception $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($obj = new finfo(FILEINFO_MIME, 1.0));
} catch (\Exception $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($obj = new finfo(FILEINFO_MIME, '/foo/bar/inexistent'));
} catch (\Exception $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-finfo_open(): Argument #2 ($magic_database) must not contain any null bytes
+ValueError: finfo_open(): Argument #2 ($magic_database) must not contain any null bytes
object(finfo)#%d (0) {
}
object(finfo)#%d (0) {
@@ -68,6 +68,6 @@ object(finfo)#%d (%d) {
}
object(finfo)#%d (%d) {
}
-finfo::__construct(): Failed to open stream: No such file or directory
-finfo::__construct(): Failed to open stream: No such file or directory
-finfo::__construct(): Failed to open stream: No such file or directory
+Exception: finfo::__construct(): Failed to open stream: No such file or directory
+Exception: finfo::__construct(): Failed to open stream: No such file or directory
+Exception: finfo::__construct(): Failed to open stream: No such file or directory
diff --git a/ext/fileinfo/tests/finfo_open_003.phpt b/ext/fileinfo/tests/finfo_open_003.phpt
index 39a45a61c6ff..7e464c3d39c2 100644
--- a/ext/fileinfo/tests/finfo_open_003.phpt
+++ b/ext/fileinfo/tests/finfo_open_003.phpt
@@ -11,9 +11,9 @@ var_dump(finfo_open(FILEINFO_MIME, $buggyPath));
try {
$object = new finfo(FILEINFO_MIME, $buggyPath);
} catch (\Exception $ex) {
- echo "TEST:" . $ex->getMessage() . PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
bool(false)
-TEST:Constructor failed
+Exception: Constructor failed
diff --git a/ext/fileinfo/tests/finfo_open_004.phpt b/ext/fileinfo/tests/finfo_open_004.phpt
index ff911bc75086..06f7858cb24d 100644
--- a/ext/fileinfo/tests/finfo_open_004.phpt
+++ b/ext/fileinfo/tests/finfo_open_004.phpt
@@ -13,10 +13,10 @@ var_dump(finfo_open(FILEINFO_MIME, $buggyPath));
try {
$object = new finfo(FILEINFO_MIME, $buggyPath);
} catch (\Exception $ex) {
- echo "TEST:" . $ex->getMessage() . PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
Warning: finfo_open(): File name is longer than the maximum allowed path length on this platform (%d): %s in %s on line %d
bool(false)
-TEST:finfo::__construct(): File name is longer than the maximum allowed path length on this platform (%d): %s
+Exception: finfo::__construct(): File name is longer than the maximum allowed path length on this platform (%d): %s
diff --git a/ext/fileinfo/tests/finfo_open_error.phpt b/ext/fileinfo/tests/finfo_open_error.phpt
index 7c6fc9766372..c48230b7aa2f 100644
--- a/ext/fileinfo/tests/finfo_open_error.phpt
+++ b/ext/fileinfo/tests/finfo_open_error.phpt
@@ -14,13 +14,13 @@ var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) );
try {
var_dump( finfo_open( 'foobar' ) );
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump( new finfo('foobar') );
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -37,5 +37,5 @@ bool(false)
Warning: finfo_open(): using regular magic file `%smagic' in %sfinfo_open_error.php on line %d
object(finfo)#%d (0) {
}
-finfo_open(): Argument #1 ($flags) must be of type int, string given
-finfo::__construct(): Argument #1 ($flags) must be of type int, string given
+TypeError: finfo_open(): Argument #1 ($flags) must be of type int, string given
+TypeError: finfo::__construct(): Argument #1 ($flags) must be of type int, string given
diff --git a/ext/fileinfo/tests/finfo_uninitialized.phpt b/ext/fileinfo/tests/finfo_uninitialized.phpt
index 533574c9c0dc..9aba6719414c 100644
--- a/ext/fileinfo/tests/finfo_uninitialized.phpt
+++ b/ext/fileinfo/tests/finfo_uninitialized.phpt
@@ -10,37 +10,37 @@ $finfo = (new ReflectionClass('finfo'))->newInstanceWithoutConstructor();
try {
var_dump(finfo_set_flags($finfo, FILEINFO_NONE));
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($finfo->set_flags(FILEINFO_NONE));
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(finfo_file($finfo, __FILE__));
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($finfo->file(__FILE__));
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(finfo_buffer($finfo, file_get_contents(__FILE__)));
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($finfo->file(file_get_contents(__FILE__)));
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/ext/fileinfo/tests/gh18267.phpt b/ext/fileinfo/tests/gh18267.phpt
index ba7647288d1d..a33a51775a80 100644
--- a/ext/fileinfo/tests/gh18267.phpt
+++ b/ext/fileinfo/tests/gh18267.phpt
@@ -8,7 +8,7 @@ $cls = new finfo();
try {
$cls->file("test",FILEINFO_NONE, STDERR);
} catch (\TypeError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
--EXPECT--
-finfo::file(): supplied resource is not a valid Stream-Context resource
+TypeError: finfo::file(): supplied resource is not a valid Stream-Context resource
diff --git a/ext/fileinfo/tests/mime_content_type_001.phpt b/ext/fileinfo/tests/mime_content_type_001.phpt
index 93b145768141..74e22de59aa0 100644
--- a/ext/fileinfo/tests/mime_content_type_001.phpt
+++ b/ext/fileinfo/tests/mime_content_type_001.phpt
@@ -8,22 +8,22 @@ fileinfo
try {
mime_content_type(1);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
mime_content_type(NULL);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
mime_content_type(new stdclass);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
mime_content_type(array());
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
mime_content_type('foo/inexistent');
@@ -31,21 +31,21 @@ mime_content_type('foo/inexistent');
try {
mime_content_type('');
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
mime_content_type("\0");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-mime_content_type(): Argument #1 ($filename) must be of type resource|string, int given
-mime_content_type(): Argument #1 ($filename) must be of type resource|string, null given
-mime_content_type(): Argument #1 ($filename) must be of type resource|string, stdClass given
-mime_content_type(): Argument #1 ($filename) must be of type resource|string, array given
+TypeError: mime_content_type(): Argument #1 ($filename) must be of type resource|string, int given
+TypeError: mime_content_type(): Argument #1 ($filename) must be of type resource|string, null given
+TypeError: mime_content_type(): Argument #1 ($filename) must be of type resource|string, stdClass given
+TypeError: mime_content_type(): Argument #1 ($filename) must be of type resource|string, array given
Warning: mime_content_type(): Failed to open stream: No such file or directory in %s on line %d
-mime_content_type(): Argument #1 ($filename) must not be empty
-mime_content_type(): Argument #1 ($filename) must not contain any null bytes
+ValueError: mime_content_type(): Argument #1 ($filename) must not be empty
+TypeError: mime_content_type(): Argument #1 ($filename) must not contain any null bytes
diff --git a/ext/filter/tests/011.phpt b/ext/filter/tests/011.phpt
index 772fdf6b5ec7..008967099f7d 100644
--- a/ext/filter/tests/011.phpt
+++ b/ext/filter/tests/011.phpt
@@ -16,7 +16,7 @@ var_dump(filter_input(INPUT_GET, "a", FILTER_SANITIZE_SPECIAL_CHARS, array(1,2,3
try {
filter_input(INPUT_GET, "b", FILTER_VALIDATE_FLOAT, new stdClass);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(filter_input(INPUT_POST, "d", FILTER_VALIDATE_FLOAT));
var_dump(filter_input(INPUT_POST, "c", FILTER_SANITIZE_SPECIAL_CHARS));
@@ -27,7 +27,7 @@ echo "Done\n";
--EXPECT--
string(18) "http://example.com"
string(27) "<b>test</b>"
-filter_input(): Argument #4 ($options) must be of type array|int, stdClass given
+TypeError: filter_input(): Argument #4 ($options) must be of type array|int, stdClass given
float(12345.7)
string(29) "<p>string</p>"
bool(false)
diff --git a/ext/filter/tests/017.phpt b/ext/filter/tests/017.phpt
index e37177c60d6e..9d2e702b4c7f 100644
--- a/ext/filter/tests/017.phpt
+++ b/ext/filter/tests/017.phpt
@@ -13,7 +13,7 @@ var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("rege
try {
filter_var("data", FILTER_VALIDATE_REGEXP);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
echo "Done\n";
@@ -24,5 +24,5 @@ bool(false)
string(4) "data"
bool(false)
bool(false)
-filter_var(): "regexp" option is missing
+ValueError: filter_var(): "regexp" option is missing
Done
diff --git a/ext/filter/tests/029.phpt b/ext/filter/tests/029.phpt
index ca4feb2e4ae0..44415e06b090 100644
--- a/ext/filter/tests/029.phpt
+++ b/ext/filter/tests/029.phpt
@@ -17,19 +17,19 @@ var_dump(filter_var("", FILTER_CALLBACK, array("options"=>"test")));
try {
filter_var("qwe", FILTER_CALLBACK, array("options"=>"no such func"));
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
filter_var("qwe", FILTER_CALLBACK, array("options"=>""));
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
filter_var("qwe", FILTER_CALLBACK);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
/* Simple class method callback */
@@ -68,7 +68,7 @@ function test3($var) {
try {
var_dump(filter_var("data", FILTER_CALLBACK, array("options"=>"test3")));
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Done\n";
@@ -77,9 +77,9 @@ echo "Done\n";
string(4) "DATA"
string(46) "~!@#$%^&*()_QWERTYUIOPASDFGHJKLZXCVBNM<>>?"}{:"
string(0) ""
-filter_var(): Option must be a valid callback
-filter_var(): Option must be a valid callback
-filter_var(): Option must be a valid callback
+TypeError: filter_var(): Option must be a valid callback
+TypeError: filter_var(): Option must be a valid callback
+TypeError: filter_var(): Option must be a valid callback
string(4) "data"
string(46) "~!@#$%^&*()_qwertyuiopasdfghjklzxcvbnm<>>?"}{:"
string(0) ""
@@ -95,5 +95,5 @@ NULL
Warning: test2(): Argument #1 ($var) must be passed by reference, value given in %s on line %d
NULL
-string(4) "test"
+Exception: test
Done
diff --git a/ext/filter/tests/031.phpt b/ext/filter/tests/031.phpt
index 70117fa025ad..eb930642d18f 100644
--- a/ext/filter/tests/031.phpt
+++ b/ext/filter/tests/031.phpt
@@ -36,7 +36,7 @@ foreach ($floats as $float => $dec) {
try {
var_dump(filter_var($float, FILTER_VALIDATE_FLOAT, array("options"=>array('decimal' => $dec))));
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
}
@@ -55,5 +55,5 @@ custom decimal:
bool(false)
float(1.234)
float(1.234)
-filter_var(): "decimal" option must be one character long
+ValueError: filter_var(): "decimal" option must be one character long
bool(false)
diff --git a/ext/filter/tests/039.phpt b/ext/filter/tests/039.phpt
index 229feecd4475..22a7170c05dd 100644
--- a/ext/filter/tests/039.phpt
+++ b/ext/filter/tests/039.phpt
@@ -14,7 +14,7 @@ var_dump(filter_var_array(array(), 1000000));
try {
filter_var_array(array(), "");
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
echo "-- (2)\n";
@@ -24,7 +24,7 @@ var_dump(filter_var_array(array(""=>""), 1000000));
try {
filter_var_array(array(""=>""), "");
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
echo "-- (3)\n";
@@ -34,7 +34,7 @@ var_dump(filter_var_array(array("aaa"=>"bbb"), 1000000));
try {
filter_var_array(array("aaa"=>"bbb"), "");
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
echo "-- (4)\n";
@@ -42,7 +42,7 @@ echo "-- (4)\n";
try {
filter_var_array(array(), new stdclass);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(filter_var_array(array(), array()));
@@ -54,12 +54,12 @@ echo "-- (5)\n";
try {
filter_var_array(array("var_name"=>""), array("var_name"=>-1, "asdas"=>"asdasd", "qwe"=>"rty", ""=>""));
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
filter_var_array(array("asdas"=>"text"), array("var_name"=>-1, "asdas"=>"asdasd", "qwe"=>"rty", ""=>""));
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
$a = array(""=>""); $b = -1;
@@ -74,7 +74,7 @@ $a = array(""=>""); $b = "";
try {
filter_var_array($a, $b);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump($a, $b);
@@ -96,7 +96,7 @@ bool(false)
Warning: filter_var_array(): Unknown filter with ID 1000000 in %s on line %d
bool(false)
-filter_var_array(): Argument #2 ($options) must be of type array|int, string given
+TypeError: filter_var_array(): Argument #2 ($options) must be of type array|int, string given
-- (2)
Warning: filter_var_array(): Unknown filter with ID -1 in %s on line %d
@@ -104,7 +104,7 @@ bool(false)
Warning: filter_var_array(): Unknown filter with ID 1000000 in %s on line %d
bool(false)
-filter_var_array(): Argument #2 ($options) must be of type array|int, string given
+TypeError: filter_var_array(): Argument #2 ($options) must be of type array|int, string given
-- (3)
Warning: filter_var_array(): Unknown filter with ID -1 in %s on line %d
@@ -112,9 +112,9 @@ bool(false)
Warning: filter_var_array(): Unknown filter with ID 1000000 in %s on line %d
bool(false)
-filter_var_array(): Argument #2 ($options) must be of type array|int, string given
+TypeError: filter_var_array(): Argument #2 ($options) must be of type array|int, string given
-- (4)
-filter_var_array(): Argument #2 ($options) must be of type array|int, stdClass given
+TypeError: filter_var_array(): Argument #2 ($options) must be of type array|int, stdClass given
array(0) {
}
array(1) {
@@ -134,10 +134,10 @@ array(1) {
-- (5)
Warning: filter_var_array(): Unknown filter with ID -1 in %s on line %d
-filter_var_array(): Argument #2 ($options) cannot contain empty keys
+ValueError: filter_var_array(): Argument #2 ($options) cannot contain empty keys
Warning: filter_var_array(): Unknown filter with ID 0 in %s on line %d
-filter_var_array(): Argument #2 ($options) cannot contain empty keys
+ValueError: filter_var_array(): Argument #2 ($options) cannot contain empty keys
Warning: filter_var_array(): Unknown filter with ID -1 in %s on line %d
bool(false)
@@ -154,7 +154,7 @@ array(1) {
string(0) ""
}
int(100000)
-filter_var_array(): Argument #2 ($options) must be of type array|int, string given
+TypeError: filter_var_array(): Argument #2 ($options) must be of type array|int, string given
array(1) {
[""]=>
string(0) ""
diff --git a/ext/filter/tests/040.phpt b/ext/filter/tests/040.phpt
index 316088ff31cd..ff4eedf63b63 100644
--- a/ext/filter/tests/040.phpt
+++ b/ext/filter/tests/040.phpt
@@ -19,7 +19,7 @@ var_dump(filter_has_var(INPUT_GET, "cc"));
try {
filter_has_var(-1, "cc");
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(filter_has_var(0, "cc"));
@@ -34,6 +34,6 @@ bool(true)
bool(true)
bool(false)
bool(false)
-filter_has_var(): Argument #1 ($input_type) must be an INPUT_* constant
+ValueError: filter_has_var(): Argument #1 ($input_type) must be an INPUT_* constant
bool(false)
Done
diff --git a/ext/filter/tests/055.phpt b/ext/filter/tests/055.phpt
index f058db064b02..23241b76ae90 100644
--- a/ext/filter/tests/055.phpt
+++ b/ext/filter/tests/055.phpt
@@ -24,7 +24,7 @@ foreach ($values as $value) {
try {
var_dump(filter_var($value[0], FILTER_VALIDATE_MAC, $value[1]));
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
}
@@ -43,6 +43,6 @@ string(17) "01:23:45:67:89:aB"
bool(false)
bool(false)
string(14) "0123.4567.89ab"
-filter_var(): "separator" option must be one character long
-filter_var(): "separator" option must be one character long
+ValueError: filter_var(): "separator" option must be one character long
+ValueError: filter_var(): "separator" option must be one character long
Done
diff --git a/ext/filter/tests/bug51368.phpt b/ext/filter/tests/bug51368.phpt
index a3490215afdc..c13866932108 100644
--- a/ext/filter/tests/bug51368.phpt
+++ b/ext/filter/tests/bug51368.phpt
@@ -14,11 +14,11 @@ $options = ['flags' => FILTER_FLAG_ALLOW_THOUSAND, 'options' => ['thousand' => '
try {
filter_var('12345', FILTER_VALIDATE_FLOAT, $options);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
float(1000)
float(1234.567)
-filter_var(): "thousand" option must not be empty
+ValueError: filter_var(): "thousand" option must not be empty
diff --git a/ext/filter/tests/throw-on-failure/filter_input_array_failure.phpt b/ext/filter/tests/throw-on-failure/filter_input_array_failure.phpt
index 868829dbbac0..db857f0fef04 100644
--- a/ext/filter/tests/throw-on-failure/filter_input_array_failure.phpt
+++ b/ext/filter/tests/throw-on-failure/filter_input_array_failure.phpt
@@ -11,14 +11,14 @@ echo "\nvalidation fails (array type check)\n";
try {
filter_input_array(INPUT_GET, ['a' => ['flags' => FILTER_REQUIRE_ARRAY | FILTER_THROW_ON_FAILURE]]);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nvalidation fails (filter value)\n";
try {
filter_input_array(INPUT_GET, ['a' => ['filter' => FILTER_VALIDATE_EMAIL, 'flags' => FILTER_THROW_ON_FAILURE]]);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/ext/filter/tests/throw-on-failure/filter_input_failure.phpt b/ext/filter/tests/throw-on-failure/filter_input_failure.phpt
index 8ec2d572e7f1..7130a777960b 100644
--- a/ext/filter/tests/throw-on-failure/filter_input_failure.phpt
+++ b/ext/filter/tests/throw-on-failure/filter_input_failure.phpt
@@ -11,21 +11,21 @@ echo "missing value\n";
try {
filter_input(INPUT_GET, 'b', FILTER_DEFAULT, FILTER_THROW_ON_FAILURE);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nvalidation fails (array type check)\n";
try {
filter_input(INPUT_GET, 'a', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY | FILTER_THROW_ON_FAILURE);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nvalidation fails (filter value)\n";
try {
filter_input(INPUT_GET, 'a', FILTER_VALIDATE_EMAIL, FILTER_THROW_ON_FAILURE);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/ext/filter/tests/throw-on-failure/filter_var_array_failure.phpt b/ext/filter/tests/throw-on-failure/filter_var_array_failure.phpt
index f40dec1537dd..36d1db4eaa1a 100644
--- a/ext/filter/tests/throw-on-failure/filter_var_array_failure.phpt
+++ b/ext/filter/tests/throw-on-failure/filter_var_array_failure.phpt
@@ -9,21 +9,21 @@ echo "\nvalidation fails (array type check)\n";
try {
filter_var_array(['a' => 'a'], ['a' => ['flags' => FILTER_REQUIRE_ARRAY | FILTER_THROW_ON_FAILURE]]);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nvalidation fails (object without __toString)\n";
try {
filter_var_array(['a' => new stdClass()], ['a' => ['flags' => FILTER_THROW_ON_FAILURE]]);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nvalidation fails (filter value)\n";
try {
filter_var_array(['a' => true], ['a' => ['filter' => FILTER_VALIDATE_EMAIL, 'flags' => FILTER_THROW_ON_FAILURE]]);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/ext/filter/tests/throw-on-failure/filter_var_failure.phpt b/ext/filter/tests/throw-on-failure/filter_var_failure.phpt
index fccc61da4d0f..d7a53105200c 100644
--- a/ext/filter/tests/throw-on-failure/filter_var_failure.phpt
+++ b/ext/filter/tests/throw-on-failure/filter_var_failure.phpt
@@ -9,21 +9,21 @@ echo "\nvalidation fails (array type check)\n";
try {
filter_var('a', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY | FILTER_THROW_ON_FAILURE);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nvalidation fails (object without __toString)\n";
try {
filter_var(new stdClass(), FILTER_VALIDATE_EMAIL, FILTER_THROW_ON_FAILURE);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nvalidation fails (filter value)\n";
try {
filter_var('a', FILTER_VALIDATE_EMAIL, FILTER_THROW_ON_FAILURE);
} catch (Filter\FilterFailedException $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/ext/filter/tests/throw-on-failure/throw-and-null-error.phpt b/ext/filter/tests/throw-on-failure/throw-and-null-error.phpt
index 48c37618ed91..3dff1a85f788 100644
--- a/ext/filter/tests/throw-on-failure/throw-and-null-error.phpt
+++ b/ext/filter/tests/throw-on-failure/throw-and-null-error.phpt
@@ -13,54 +13,54 @@ echo "filter_input(), with a missing value\n";
try {
filter_input(INPUT_GET, 'b', FILTER_DEFAULT, $flags);
} catch (ValueError $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
filter_input(INPUT_GET, 'b', FILTER_DEFAULT, ['flags' => $flags]);
} catch (ValueError $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nfilter_input(), with a missing value and a default\n";
try {
filter_input(INPUT_GET, 'b', FILTER_DEFAULT, ['flags' => $flags, 'options' => ['default' => 'a']]);
} catch (ValueError $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nfilter_input(), with a present value\n";
try {
filter_input(INPUT_GET, 'a', FILTER_DEFAULT, $flags);
} catch (ValueError $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
filter_input(INPUT_GET, 'a', FILTER_DEFAULT, ['flags' => $flags]);
} catch (ValueError $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nfilter_var()\n";
try {
filter_var(true, FILTER_DEFAULT, $flags);
} catch (ValueError $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
filter_var(true, FILTER_DEFAULT, ['flags' => $flags]);
} catch (ValueError $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nfilter_input_array()\n";
try {
filter_input_array(INPUT_GET, ['a' => ['flags' => $flags]]);
} catch (ValueError $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nfilter_var_array()\n";
try {
filter_var_array(['a' => true], ['a' => ['flags' => $flags]]);
} catch (ValueError $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/ext/ftp/tests/004.phpt b/ext/ftp/tests/004.phpt
index fde0b5090399..131fe984a1d9 100644
--- a/ext/ftp/tests/004.phpt
+++ b/ext/ftp/tests/004.phpt
@@ -11,7 +11,7 @@ require 'server.inc';
try {
ftp_connect('127.0.0.1', 0, -3);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
$ftp = ftp_connect('127.0.0.1', $port);
@@ -23,7 +23,7 @@ var_dump(ftp_login($ftp, 'user', 'bogus'));
var_dump(ftp_quit($ftp));
?>
--EXPECTF--
-ftp_connect(): Argument #3 ($timeout) must be greater than 0
+ValueError: ftp_connect(): Argument #3 ($timeout) must be greater than 0
bool(true)
Warning: ftp_login(): Not logged in. in %s on line %d
diff --git a/ext/ftp/tests/005.phpt b/ext/ftp/tests/005.phpt
index f08cadd2b428..632badc9c59a 100644
--- a/ext/ftp/tests/005.phpt
+++ b/ext/ftp/tests/005.phpt
@@ -22,19 +22,19 @@ var_dump(ftp_exec($ftp, 'x'));
try {
ftp_fget($ftp, STDOUT, 'x', 0);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
ftp_fput($ftp, 'x', fopen(__FILE__, 'r'), 0);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
ftp_get($ftp, 'x', 'y', 0);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(ftp_mdtm($ftp, 'x'));
@@ -44,13 +44,13 @@ var_dump(ftp_nb_continue($ftp));
try {
ftp_nb_fget($ftp, STDOUT, 'x', 0);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
ftp_nb_fput($ftp, 'x', fopen(__FILE__, 'r'), 0);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(ftp_systype($ftp));
@@ -77,9 +77,9 @@ bool(false)
Warning: ftp_exec(): Command not implemented (5). in %s005.php on line %d
bool(false)
-ftp_fget(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
-ftp_fput(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
-ftp_get(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
+ValueError: ftp_fget(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
+ValueError: ftp_fput(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
+ValueError: ftp_get(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
int(-1)
Warning: ftp_mkdir(): Command not implemented (7). in %s005.php on line %d
@@ -87,8 +87,8 @@ bool(false)
Warning: ftp_nb_continue(): No non-blocking transfer to continue in %s on line %d
int(0)
-ftp_nb_fget(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
-ftp_nb_fput(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
+ValueError: ftp_nb_fget(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
+ValueError: ftp_nb_fput(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
Warning: ftp_systype(): Command not implemented (8). in %s005.php on line %d
bool(false)
diff --git a/ext/ftp/tests/007.phpt b/ext/ftp/tests/007.phpt
index a23b5496be91..38eb20badd7f 100644
--- a/ext/ftp/tests/007.phpt
+++ b/ext/ftp/tests/007.phpt
@@ -13,202 +13,202 @@ $ftp = tmpfile();
try {
var_dump(ftp_login($ftp, 'user', 'pass'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_pwd($ftp));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_cdup($ftp));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_chdir($ftp, '~'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_exec($ftp, 'x'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_raw($ftp, 'x'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_mkdir($ftp, '/'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_rmdir($ftp, '/'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_chmod($ftp, 7777, '/'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_alloc($ftp, 7777));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_nlist($ftp, '/'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_rawlist($ftp, '~'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_mlsd($ftp, '~'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_systype($ftp));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_fget($ftp, $ftp, 'remote', 7777));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_nb_fget($ftp, $ftp, 'remote', 7777));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_pasv($ftp, false));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_get($ftp, 'local', 'remote', 7777));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_nb_get($ftp, 'local', 'remote', 7777));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_nb_continue($ftp));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_fput($ftp, 'remote', $ftp, 9999));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_nb_fput($ftp, 'remote', $ftp, 9999));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_put($ftp, 'remote', 'local', 9999));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_append($ftp, 'remote', 'local', 9999));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_nb_put($ftp, 'remote', 'local', 9999));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_size($ftp, '~'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_mdtm($ftp, '~'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_rename($ftp, 'old', 'new'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_delete($ftp, 'gone'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_site($ftp, 'localhost'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_close($ftp));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_set_option($ftp, 1, 2));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ftp_get_option($ftp, 1));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
fclose($ftp);
?>
--EXPECT--
-ftp_login(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_pwd(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_cdup(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_chdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_exec(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_raw(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_mkdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_rmdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_chmod(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_alloc(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_rawlist(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_mlsd(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_systype(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_fget(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_nb_fget(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_pasv(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_get(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_nb_get(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_nb_continue(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_fput(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_nb_fput(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_put(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_append(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_nb_put(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_size(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_mdtm(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_rename(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_delete(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_site(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_close(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_set_option(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
-ftp_get_option(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_login(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_pwd(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_cdup(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_chdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_exec(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_raw(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_mkdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_rmdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_chmod(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_alloc(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_rawlist(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_mlsd(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_systype(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_fget(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_nb_fget(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_pasv(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_get(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_nb_get(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_nb_continue(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_fput(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_nb_fput(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_put(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_append(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_nb_put(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_size(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_mdtm(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_rename(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_delete(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_site(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_close(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_set_option(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
+TypeError: ftp_get_option(): Argument #1 ($ftp) must be of type FTP\Connection, resource given
diff --git a/ext/ftp/tests/dead-resource.phpt b/ext/ftp/tests/dead-resource.phpt
index 75cf3c4a55f7..90e59d19641d 100644
--- a/ext/ftp/tests/dead-resource.phpt
+++ b/ext/ftp/tests/dead-resource.phpt
@@ -16,10 +16,10 @@ try {
var_dump(ftp_login($ftp, 'user', 'pass'));
echo "Login did not throw\n";
} catch (ValueError $ex) {
- echo "Exception: ", $ex->getMessage(), "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
bool(true)
-Exception: FTP\Connection is already closed
+ValueError: FTP\Connection is already closed
diff --git a/ext/ftp/tests/ftp_close_during_transfer.phpt b/ext/ftp/tests/ftp_close_during_transfer.phpt
index 72e410603921..201a6f172681 100644
--- a/ext/ftp/tests/ftp_close_during_transfer.phpt
+++ b/ext/ftp/tests/ftp_close_during_transfer.phpt
@@ -32,7 +32,7 @@ CloseDuringWrite::$ftp = $ftp;
try {
@ftp_get($ftp, 'reentrant://sink', 'a story.txt', FTP_BINARY);
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ftp_close($ftp);
@@ -40,5 +40,5 @@ echo "closed\n";
?>
--EXPECT--
bool(true)
-Cannot close FTP\Connection while a transfer is in progress
+Error: Cannot close FTP\Connection while a transfer is in progress
closed
diff --git a/ext/ftp/tests/ftp_constructor.phpt b/ext/ftp/tests/ftp_constructor.phpt
index 6fae7f9d3fa0..70ac410ffe6c 100644
--- a/ext/ftp/tests/ftp_constructor.phpt
+++ b/ext/ftp/tests/ftp_constructor.phpt
@@ -9,8 +9,8 @@ pcntl
try {
new FTP\Connection();
} catch (Error $ex) {
- echo "Exception: ", $ex->getMessage(), "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-Exception: Cannot directly construct FTP\Connection, use ftp_connect() or ftp_ssl_connect() instead
+Error: Cannot directly construct FTP\Connection, use ftp_connect() or ftp_ssl_connect() instead
diff --git a/ext/ftp/tests/ftp_get_option.phpt b/ext/ftp/tests/ftp_get_option.phpt
index 496fceadffe7..56738f2c6c72 100644
--- a/ext/ftp/tests/ftp_get_option.phpt
+++ b/ext/ftp/tests/ftp_get_option.phpt
@@ -21,7 +21,7 @@ var_dump(ftp_get_option($ftp, FTP_USEPASVADDRESS));
try {
ftp_get_option($ftp, FOO_BAR);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
@@ -29,4 +29,4 @@ try {
int(%d)
bool(true)
bool(true)
-ftp_get_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS
+ValueError: ftp_get_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS
diff --git a/ext/ftp/tests/ftp_nb_close_during_transfer.phpt b/ext/ftp/tests/ftp_nb_close_during_transfer.phpt
index 702648f69592..aacc4dfd77be 100644
--- a/ext/ftp/tests/ftp_nb_close_during_transfer.phpt
+++ b/ext/ftp/tests/ftp_nb_close_during_transfer.phpt
@@ -32,7 +32,7 @@ CloseDuringNbWrite::$ftp = $ftp;
try {
@ftp_nb_get($ftp, 'reentrantnb://sink', 'a story.txt', FTP_BINARY);
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ftp_close($ftp);
@@ -40,5 +40,5 @@ echo "closed\n";
?>
--EXPECT--
bool(true)
-Cannot close FTP\Connection while a transfer is in progress
+Error: Cannot close FTP\Connection while a transfer is in progress
closed
diff --git a/ext/ftp/tests/ftp_set_option_errors.phpt b/ext/ftp/tests/ftp_set_option_errors.phpt
index 35785e7f1eba..5b30dfdef2d4 100644
--- a/ext/ftp/tests/ftp_set_option_errors.phpt
+++ b/ext/ftp/tests/ftp_set_option_errors.phpt
@@ -24,13 +24,13 @@ $options = [
foreach ($options as $option) try {
var_dump(ftp_set_option($ftp, $option['option'], $option['value']));
} catch (\Throwable $ex) {
- echo "Exception: ", $ex->getMessage(), "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-Exception: ftp_set_option(): Argument #3 ($value) must be greater than 0 for the FTP_TIMEOUT_SEC option
-Exception: ftp_set_option(): Argument #3 ($value) must be of type int for the FTP_TIMEOUT_SEC option, string given
-Exception: ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_USEPASVADDRESS option, array given
-Exception: ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_AUTOSEEK option, string given
-Exception: ftp_set_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS
+ValueError: ftp_set_option(): Argument #3 ($value) must be greater than 0 for the FTP_TIMEOUT_SEC option
+TypeError: ftp_set_option(): Argument #3 ($value) must be of type int for the FTP_TIMEOUT_SEC option, string given
+TypeError: ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_USEPASVADDRESS option, array given
+TypeError: ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_AUTOSEEK option, string given
+ValueError: ftp_set_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS
diff --git a/ext/ftp/tests/ftp_ssl_connect_error.phpt b/ext/ftp/tests/ftp_ssl_connect_error.phpt
index 65c7efbb23c4..a12a3d4add9b 100644
--- a/ext/ftp/tests/ftp_ssl_connect_error.phpt
+++ b/ext/ftp/tests/ftp_ssl_connect_error.phpt
@@ -18,7 +18,7 @@ echo "\n-- Testing ftp_ssl_connect() function timeout exception for value 0 --\n
try {
ftp_ssl_connect('totes.invalid', 21, 0);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
echo "===DONE===\n";
@@ -32,5 +32,5 @@ Warning: ftp_ssl_connect(): php_network_getaddresses: getaddrinfo for %s failed:
bool(false)
-- Testing ftp_ssl_connect() function timeout exception for value 0 --
-ftp_ssl_connect(): Argument #3 ($timeout) must be greater than 0
+ValueError: ftp_ssl_connect(): Argument #3 ($timeout) must be greater than 0
===DONE===
diff --git a/ext/ftp/tests/gh20601.phpt b/ext/ftp/tests/gh20601.phpt
index 3ece7736c3aa..f6013db497f2 100644
--- a/ext/ftp/tests/gh20601.phpt
+++ b/ext/ftp/tests/gh20601.phpt
@@ -12,8 +12,8 @@ if (PHP_OS_FAMILY === 'Windows') die("skip not for windows");
try {
ftp_connect('127.0.0.1', 1024, PHP_INT_MAX);
} catch (\ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-ftp_connect(): Argument #3 ($timeout) must be less than %d
+ValueError: ftp_connect(): Argument #3 ($timeout) must be less than %d
diff --git a/ext/ftp/tests/gh20601_set_option.phpt b/ext/ftp/tests/gh20601_set_option.phpt
index 3317d4b5f2a0..c722f4d16448 100644
--- a/ext/ftp/tests/gh20601_set_option.phpt
+++ b/ext/ftp/tests/gh20601_set_option.phpt
@@ -19,8 +19,8 @@ ftp_login($ftp, 'user', 'pass');
try {
ftp_set_option($ftp, FTP_TIMEOUT_SEC, PHP_INT_MAX);
} catch (\ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-ftp_set_option(): Argument #3 ($value) must be less than %d for the FTP_TIMEOUT_SEC option
+ValueError: ftp_set_option(): Argument #3 ($value) must be less than %d for the FTP_TIMEOUT_SEC option
diff --git a/ext/ftp/tests/gh20601_ssl.phpt b/ext/ftp/tests/gh20601_ssl.phpt
index 005f866e18e0..12c1c54ae59c 100644
--- a/ext/ftp/tests/gh20601_ssl.phpt
+++ b/ext/ftp/tests/gh20601_ssl.phpt
@@ -14,8 +14,8 @@ if (PHP_OS_FAMILY === 'Windows') die("skip not for windows");
try {
ftp_ssl_connect('127.0.0.1', 1024, PHP_INT_MAX);
} catch (\ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-ftp_ssl_connect(): Argument #3 ($timeout) must be less than %d
+ValueError: ftp_ssl_connect(): Argument #3 ($timeout) must be less than %d
diff --git a/ext/hash/tests/bug81714.phpt b/ext/hash/tests/bug81714.phpt
index a151bda6884e..1f8557021a26 100644
--- a/ext/hash/tests/bug81714.phpt
+++ b/ext/hash/tests/bug81714.phpt
@@ -7,8 +7,8 @@ hash_final($h);
try {
serialize($h);
} catch (Exception $ex) {
- var_dump($ex->getMessage());
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECTF--
-string(52) "HashContext for algorithm "md5" cannot be serialized"
+Exception: HashContext for algorithm "md5" cannot be serialized
diff --git a/ext/hash/tests/gh12186_1.phpt b/ext/hash/tests/gh12186_1.phpt
index 5e34b1dd78e8..afdfe5f7dbfe 100644
--- a/ext/hash/tests/gh12186_1.phpt
+++ b/ext/hash/tests/gh12186_1.phpt
@@ -9,9 +9,9 @@ hash_final($c);
try {
hash_copy($c);
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECTF--
-hash_copy(): Argument #1 ($context) must be a valid, non-finalized HashContext
+TypeError: hash_copy(): Argument #1 ($context) must be a valid, non-finalized HashContext
diff --git a/ext/hash/tests/gh12186_2.phpt b/ext/hash/tests/gh12186_2.phpt
index 64a12b15c391..46dc1232642b 100644
--- a/ext/hash/tests/gh12186_2.phpt
+++ b/ext/hash/tests/gh12186_2.phpt
@@ -9,9 +9,9 @@ hash_final($c);
try {
clone $c;
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECTF--
-Cannot clone a finalized HashContext
+ValueError: Cannot clone a finalized HashContext
diff --git a/ext/hash/tests/hash_equals.phpt b/ext/hash/tests/hash_equals.phpt
index 69e23eea0fa3..c01e7be8c858 100644
--- a/ext/hash/tests/hash_equals.phpt
+++ b/ext/hash/tests/hash_equals.phpt
@@ -9,7 +9,7 @@ function trycatch_dump(...$tests) {
var_dump($test());
}
catch (\Error $e) {
- echo '[' . get_class($e) . '] ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -39,9 +39,9 @@ bool(false)
bool(false)
bool(false)
bool(true)
-[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, int given
-[TypeError] hash_equals(): Argument #2 ($user_string) must be of type string, int given
-[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, int given
-[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, null given
-[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, null given
-[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, null given
+TypeError: hash_equals(): Argument #1 ($known_string) must be of type string, int given
+TypeError: hash_equals(): Argument #2 ($user_string) must be of type string, int given
+TypeError: hash_equals(): Argument #1 ($known_string) must be of type string, int given
+TypeError: hash_equals(): Argument #1 ($known_string) must be of type string, null given
+TypeError: hash_equals(): Argument #1 ($known_string) must be of type string, null given
+TypeError: hash_equals(): Argument #1 ($known_string) must be of type string, null given
diff --git a/ext/hash/tests/hash_error.phpt b/ext/hash/tests/hash_error.phpt
index b5c038809139..63e99de72932 100644
--- a/ext/hash/tests/hash_error.phpt
+++ b/ext/hash/tests/hash_error.phpt
@@ -9,7 +9,7 @@ echo "\n-- Testing hash() function with invalid hash algorithm --\n";
try {
hash('foo', '');
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
@@ -17,4 +17,4 @@ try {
*** Testing hash() : error conditions ***
-- Testing hash() function with invalid hash algorithm --
-hash(): Argument #1 ($algo) must be a valid hashing algorithm
+ValueError: hash(): Argument #1 ($algo) must be a valid hashing algorithm
diff --git a/ext/hash/tests/hash_file_error.phpt b/ext/hash/tests/hash_file_error.phpt
index 68ba55f4a373..a381d3bdd63c 100644
--- a/ext/hash/tests/hash_file_error.phpt
+++ b/ext/hash/tests/hash_file_error.phpt
@@ -16,7 +16,7 @@ echo "\n-- Testing hash_file() function with an unknown algorithm --\n";
try {
hash_file('foobar', $filename);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
echo "\n-- Testing hash_file() function with a non-existent file --\n";
@@ -34,7 +34,7 @@ unlink( $filename );
*** Testing hash_file() : error conditions ***
-- Testing hash_file() function with an unknown algorithm --
-hash_file(): Argument #1 ($algo) must be a valid hashing algorithm
+ValueError: hash_file(): Argument #1 ($algo) must be a valid hashing algorithm
-- Testing hash_file() function with a non-existent file --
diff --git a/ext/hash/tests/hash_hkdf_edges.phpt b/ext/hash/tests/hash_hkdf_edges.phpt
index 89b3d8af6354..77481802470e 100644
--- a/ext/hash/tests/hash_hkdf_edges.phpt
+++ b/ext/hash/tests/hash_hkdf_edges.phpt
@@ -16,7 +16,7 @@ try {
var_dump(hash_hkdf('jOaAt', $ikm));
}
catch (\Error $e) {
- echo '[Error] ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -26,4 +26,4 @@ Length < digestSize: 98b16391063ece
Length % digestSize != 0: 98b16391063ecee006a3ca8ee5776b1e5f
Algo name case-sensitivity: true
Non-crypto algo name case-sensitivity:
-[Error] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
diff --git a/ext/hash/tests/hash_hkdf_error.phpt b/ext/hash/tests/hash_hkdf_error.phpt
index 86aa10a02f35..f68d7a62fca1 100644
--- a/ext/hash/tests/hash_hkdf_error.phpt
+++ b/ext/hash/tests/hash_hkdf_error.phpt
@@ -11,7 +11,7 @@ function trycatch_dump(...$tests) {
var_dump($test());
}
catch (\Error $e) {
- echo '[' . get_class($e) . '] ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -48,19 +48,19 @@ trycatch_dump(
*** Testing hash_hkdf(): error conditions ***
-- Testing hash_hkdf() function with invalid hash algorithm --
-[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_hkdf() function with non-cryptographic hash algorithm --
-[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_hkdf() function with invalid parameters --
-[ValueError] hash_hkdf(): Argument #2 ($key) must not be empty
-[ValueError] hash_hkdf(): Argument #3 ($length) must be greater than or equal to 0
-[ValueError] hash_hkdf(): Argument #3 ($length) must be less than or equal to 5100
+ValueError: hash_hkdf(): Argument #2 ($key) must not be empty
+ValueError: hash_hkdf(): Argument #3 ($length) must be greater than or equal to 0
+ValueError: hash_hkdf(): Argument #3 ($length) must be less than or equal to 5100
diff --git a/ext/hash/tests/hash_hmac_error.phpt b/ext/hash/tests/hash_hmac_error.phpt
index 81c28ee46c05..ad92d4a26ceb 100644
--- a/ext/hash/tests/hash_hmac_error.phpt
+++ b/ext/hash/tests/hash_hmac_error.phpt
@@ -16,7 +16,7 @@ try {
var_dump(hash_hmac('foo', $data, $key));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n-- Testing hash_hmac() function with non-cryptographic hash algorithm --\n";
@@ -24,7 +24,7 @@ try {
var_dump(hash_hmac('crc32', $data, $key));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -32,7 +32,7 @@ catch (\Error $e) {
*** Testing hash_hmac() : error conditions ***
-- Testing hash_hmac() function with invalid hash algorithm --
-hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_hmac() function with non-cryptographic hash algorithm --
-hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
diff --git a/ext/hash/tests/hash_hmac_file_error.phpt b/ext/hash/tests/hash_hmac_file_error.phpt
index 3a4d85ee7e35..c882975fed24 100644
--- a/ext/hash/tests/hash_hmac_file_error.phpt
+++ b/ext/hash/tests/hash_hmac_file_error.phpt
@@ -13,7 +13,7 @@ try {
var_dump(hash_hmac_file('foo', $file, $key, TRUE));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n-- Testing hash_hmac_file() function with non-cryptographic hash algorithm --\n";
@@ -21,7 +21,7 @@ try {
var_dump(hash_hmac_file('crc32', $file, $key, TRUE));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n-- Testing hash_hmac_file() function with bad path --\n";
@@ -29,7 +29,7 @@ try {
var_dump(hash_hmac_file('md5', $file.chr(0).$file, $key, TRUE));
}
catch (ValueError $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -37,10 +37,10 @@ catch (ValueError $e) {
*** Testing hash() : error conditions ***
-- Testing hash_hmac_file() function with invalid hash algorithm --
-hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_hmac_file() function with non-cryptographic hash algorithm --
-hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_hmac_file() function with bad path --
-hash_hmac_file(): Argument #2 ($filename) must not contain any null bytes
+ValueError: hash_hmac_file(): Argument #2 ($filename) must not contain any null bytes
diff --git a/ext/hash/tests/hash_init_error.phpt b/ext/hash/tests/hash_init_error.phpt
index 560ad4f8e9ae..76fa392f6b21 100644
--- a/ext/hash/tests/hash_init_error.phpt
+++ b/ext/hash/tests/hash_init_error.phpt
@@ -9,7 +9,7 @@ try {
var_dump(hash_init('dummy'));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n-- Testing hash_init() function with HASH_HMAC and non-cryptographic algorithms --\n";
@@ -17,7 +17,7 @@ try {
var_dump(hash_init('crc32', HASH_HMAC));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n-- Testing hash_init() function with HASH_HMAC and no key --\n";
@@ -25,14 +25,14 @@ try {
var_dump(hash_init('md5', HASH_HMAC));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(hash_init('md5', HASH_HMAC, null));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
@@ -41,13 +41,13 @@ catch (\Error $e) {
*** Testing hash_init(): error conditions ***
-- Testing hash_init() function with unknown algorithms --
-hash_init(): Argument #1 ($algo) must be a valid hashing algorithm
+ValueError: hash_init(): Argument #1 ($algo) must be a valid hashing algorithm
-- Testing hash_init() function with HASH_HMAC and non-cryptographic algorithms --
-hash_init(): Argument #1 ($algo) must be a cryptographic hashing algorithm if HMAC is requested
+ValueError: hash_init(): Argument #1 ($algo) must be a cryptographic hashing algorithm if HMAC is requested
-- Testing hash_init() function with HASH_HMAC and no key --
-hash_init(): Argument #3 ($key) must not be empty when HMAC is requested
+ValueError: hash_init(): Argument #3 ($key) must not be empty when HMAC is requested
Deprecated: hash_init(): Passing null to parameter #3 ($key) of type string is deprecated in %s on line %d
-hash_init(): Argument #3 ($key) must not be empty when HMAC is requested
+ValueError: hash_init(): Argument #3 ($key) must not be empty when HMAC is requested
diff --git a/ext/hash/tests/hash_pbkdf2_error.phpt b/ext/hash/tests/hash_pbkdf2_error.phpt
index 35cda2b52fc6..d07a8caa2344 100644
--- a/ext/hash/tests/hash_pbkdf2_error.phpt
+++ b/ext/hash/tests/hash_pbkdf2_error.phpt
@@ -16,7 +16,7 @@ try {
var_dump(hash_pbkdf2('foo', $password, $salt, 1));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
@@ -25,7 +25,7 @@ try {
var_dump(hash_pbkdf2('crc32', $password, $salt, 1));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n-- Testing hash_pbkdf2() function with invalid iterations --\n";
@@ -33,14 +33,14 @@ try {
var_dump(hash_pbkdf2('md5', $password, $salt, 0));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(hash_pbkdf2('md5', $password, $salt, -1));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n-- Testing hash_pbkdf2() function with invalid length --\n";
@@ -48,7 +48,7 @@ try {
var_dump(hash_pbkdf2('md5', $password, $salt, 1, -1));
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -56,14 +56,14 @@ catch (\Error $e) {
*** Testing hash_pbkdf2() : error conditions ***
-- Testing hash_pbkdf2() function with invalid hash algorithm --
-hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_pbkdf2() function with non-cryptographic hash algorithm --
-hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+ValueError: hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_pbkdf2() function with invalid iterations --
-hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0
-hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0
+ValueError: hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0
+ValueError: hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0
-- Testing hash_pbkdf2() function with invalid length --
-hash_pbkdf2(): Argument #5 ($length) must be greater than or equal to 0
+ValueError: hash_pbkdf2(): Argument #5 ($length) must be greater than or equal to 0
diff --git a/ext/hash/tests/hash_serialize_002.phpt b/ext/hash/tests/hash_serialize_002.phpt
index 15ecf94c1e5e..40157bf3800c 100644
--- a/ext/hash/tests/hash_serialize_002.phpt
+++ b/ext/hash/tests/hash_serialize_002.phpt
@@ -18,7 +18,7 @@ foreach ($algos as $algo) {
$serial = serialize($ctx0);
assert(is_string($serial));
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -26,91 +26,91 @@ echo "Done\n";
?>
--EXPECT--
string(3) "md2"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(3) "md4"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(3) "md5"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(4) "sha1"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(6) "sha224"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(6) "sha256"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(6) "sha384"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "sha512/224"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "sha512/256"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(6) "sha512"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(8) "sha3-224"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(8) "sha3-256"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(8) "sha3-384"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(8) "sha3-512"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(9) "ripemd128"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(9) "ripemd160"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(9) "ripemd256"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(9) "ripemd320"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(9) "whirlpool"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "tiger128,3"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "tiger160,3"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "tiger192,3"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "tiger128,4"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "tiger160,4"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "tiger192,4"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(6) "snefru"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(9) "snefru256"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(4) "gost"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(11) "gost-crypto"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval128,3"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval160,3"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval192,3"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval224,3"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval256,3"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval128,4"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval160,4"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval192,4"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval224,4"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval256,4"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval128,5"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval160,5"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval192,5"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval224,5"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
string(10) "haval256,5"
-HashContext with HASH_HMAC option cannot be serialized
+Exception: HashContext with HASH_HMAC option cannot be serialized
Done
diff --git a/ext/hash/tests/hash_serialize_003.phpt b/ext/hash/tests/hash_serialize_003.phpt
index a687c2aeffbd..541a3169e53e 100644
--- a/ext/hash/tests/hash_serialize_003.phpt
+++ b/ext/hash/tests/hash_serialize_003.phpt
@@ -237,7 +237,7 @@ function test_serialization($serial, $hash, $algo) {
}
} catch (Throwable $e) {
echo "$algo: problem with serialization {$serial}\n";
- echo " ", $e->getMessage(), "\n", $e->getTraceAsString();
+ echo ' ', $e::class . ': ' . $e->getMessage(), "\n", $e->getTraceAsString();
}
}
diff --git a/ext/hash/tests/hash_serialize_004.phpt b/ext/hash/tests/hash_serialize_004.phpt
index ee5c08f973e2..6c6f99365756 100644
--- a/ext/hash/tests/hash_serialize_004.phpt
+++ b/ext/hash/tests/hash_serialize_004.phpt
@@ -8,7 +8,7 @@ $ctx = hash_init("sha256");
try {
$ctx->__unserialize($ctx->__serialize());
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// bad formats
@@ -26,20 +26,20 @@ foreach ([
$ctx = unserialize(base64_decode($serial));
echo "Unexpected success\n";
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
echo "Done\n";
?>
--EXPECT--
-HashContext::__unserialize called on initialized object
-Incomplete or ill-formed serialization data
-Incomplete or ill-formed serialization data
-Incomplete or ill-formed serialization data
-HashContext with HASH_HMAC option cannot be serialized
-Incomplete or ill-formed serialization data ("sha1" code -1)
-Incomplete or ill-formed serialization data ("sha1" code -1024)
-Incomplete or ill-formed serialization data ("sha1" code -1)
-Unknown hash algorithm
+Exception: HashContext::__unserialize called on initialized object
+Exception: Incomplete or ill-formed serialization data
+Exception: Incomplete or ill-formed serialization data
+Exception: Incomplete or ill-formed serialization data
+Exception: HashContext with HASH_HMAC option cannot be serialized
+Exception: Incomplete or ill-formed serialization data ("sha1" code -1)
+Exception: Incomplete or ill-formed serialization data ("sha1" code -1024)
+Exception: Incomplete or ill-formed serialization data ("sha1" code -1)
+Exception: Unknown hash algorithm
Done
diff --git a/ext/hash/tests/new-context.phpt b/ext/hash/tests/new-context.phpt
index dd8e92e029b6..345f53adfceb 100644
--- a/ext/hash/tests/new-context.phpt
+++ b/ext/hash/tests/new-context.phpt
@@ -6,8 +6,8 @@ Hash: Attempt to instantiate a HashContext directly
try {
new HashContext;
} catch (Error $e) {
- echo "Exception: {$e->getMessage()}\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Exception: Call to private HashContext::__construct() from global scope
+Error: Call to private HashContext::__construct() from global scope
diff --git a/ext/hash/tests/reuse.phpt b/ext/hash/tests/reuse.phpt
index b5cfc79c162d..9ca8f4ceda65 100644
--- a/ext/hash/tests/reuse.phpt
+++ b/ext/hash/tests/reuse.phpt
@@ -9,9 +9,9 @@ try {
hash_update($h, 'foo');
}
catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-hash_update(): Argument #1 ($context) must be a valid, non-finalized HashContext
+TypeError: hash_update(): Argument #1 ($context) must be a valid, non-finalized HashContext
diff --git a/ext/hash/tests/xxhash_secret.phpt b/ext/hash/tests/xxhash_secret.phpt
index 4cd6798ef769..768032169afa 100644
--- a/ext/hash/tests/xxhash_secret.phpt
+++ b/ext/hash/tests/xxhash_secret.phpt
@@ -18,19 +18,19 @@ foreach (["xxh3", "xxh128"] as $a) {
try {
$ctx = hash_init($a, options: ["seed" => 24, "secret" => $secret]);
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$ctx = hash_init($a, options: ["secret" => new StringableThrowingClass()]);
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$ctx = hash_init($a, options: ["secret" => str_repeat('a', 17)]);
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ctx = hash_init($a, options: ["secret" => $secret]);
@@ -47,15 +47,15 @@ foreach (["xxh3", "xxh128"] as $a) {
?>
--EXPECTF--
-string(67) "xxh3: Only one of seed or secret is to be passed for initialization"
+Error: xxh3: Only one of seed or secret is to be passed for initialization
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
-string(23) "exception in __toString"
-string(57) "xxh3: Secret length must be >= 136 bytes, 17 bytes passed"
+Exception: exception in __toString
+Error: xxh3: Secret length must be >= 136 bytes, 17 bytes passed
8028aa834c03557a == 8028aa834c03557a == true
-string(69) "xxh128: Only one of seed or secret is to be passed for initialization"
+Error: xxh128: Only one of seed or secret is to be passed for initialization
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
-string(23) "exception in __toString"
-string(59) "xxh128: Secret length must be >= 136 bytes, 17 bytes passed"
+Exception: exception in __toString
+Error: xxh128: Secret length must be >= 136 bytes, 17 bytes passed
54279097795e7218093a05d4d781cbb9 == 54279097795e7218093a05d4d781cbb9 == true
diff --git a/ext/hash/tests/xxhash_unserialize_memsize.phpt b/ext/hash/tests/xxhash_unserialize_memsize.phpt
index 6de78ee0711e..d287f0a368fd 100644
--- a/ext/hash/tests/xxhash_unserialize_memsize.phpt
+++ b/ext/hash/tests/xxhash_unserialize_memsize.phpt
@@ -9,7 +9,7 @@ try {
$hash = unserialize($str);
hash_update($hash, '');
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -19,9 +19,9 @@ try {
$hash = unserialize($str);
hash_update($hash, '');
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Incomplete or ill-formed serialization data ("xxh32" code -2000)
-Incomplete or ill-formed serialization data ("xxh64" code -2000)
+Exception: Incomplete or ill-formed serialization data ("xxh32" code -2000)
+Exception: Incomplete or ill-formed serialization data ("xxh64" code -2000)
diff --git a/ext/iconv/tests/bug78069.phpt b/ext/iconv/tests/bug78069.phpt
index 88cf6e35f82d..1c2fdd1a64c0 100644
--- a/ext/iconv/tests/bug78069.phpt
+++ b/ext/iconv/tests/bug78069.phpt
@@ -10,4 +10,4 @@ var_dump(count($hdr));
DONE
--EXPECT--
int(1)
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/iconv/tests/iconv_strpos.phpt b/ext/iconv/tests/iconv_strpos.phpt
index c32fe921e624..e423c694b391 100644
--- a/ext/iconv/tests/iconv_strpos.phpt
+++ b/ext/iconv/tests/iconv_strpos.phpt
@@ -14,7 +14,7 @@ function foo($haystk, $needle, $offset, $to_charset = false, $from_charset = fal
try {
var_dump(strpos($haystk, $needle, $offset));
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
if ($to_charset !== false) {
@@ -23,7 +23,7 @@ function foo($haystk, $needle, $offset, $to_charset = false, $from_charset = fal
var_dump(iconv_strpos($haystk, $needle, $offset));
}
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
}
foo("abecdbcdabef", "bcd", -1);
@@ -48,8 +48,8 @@ int(5)
int(5)
bool(false)
bool(false)
-strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
int(7)
int(7)
int(16)
diff --git a/ext/iconv/tests/iconv_strpos_variation5.phpt b/ext/iconv/tests/iconv_strpos_variation5.phpt
index 2cf4b947616f..ae7487a19e9f 100644
--- a/ext/iconv/tests/iconv_strpos_variation5.phpt
+++ b/ext/iconv/tests/iconv_strpos_variation5.phpt
@@ -32,13 +32,13 @@ for ($i = -30; $i <= 60; $i += 10) {
try {
var_dump(iconv_strpos($string_ascii, $needle_ascii, $i));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "--Multibyte String --\n";
try {
var_dump(iconv_strpos($string_mb, $needle_mb, $i, 'UTF-8'));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -49,9 +49,9 @@ echo "Done";
**-- Offset is: -30 --**
-- ASCII String --
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String --
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: -20 --**
-- ASCII String --
@@ -85,25 +85,25 @@ int(20)
**-- Offset is: 30 --**
-- ASCII String --
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String --
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 40 --**
-- ASCII String --
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String --
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 50 --**
-- ASCII String --
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String --
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 60 --**
-- ASCII String --
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String --
-iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Done
diff --git a/ext/ldap/tests/gh18902.phpt b/ext/ldap/tests/gh18902.phpt
index 329cbb59c1b1..0df0543a8f75 100644
--- a/ext/ldap/tests/gh18902.phpt
+++ b/ext/ldap/tests/gh18902.phpt
@@ -9,22 +9,22 @@ $conn = ldap_connect();
try {
ldap_exop($conn,"\0");
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
ldap_exop_sync($conn,"");
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
ldap_exop_sync($conn,"test\0");
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-ldap_exop(): Argument #2 ($request_oid) must not contain any null bytes
-ldap_exop_sync(): Argument #2 ($request_oid) must not be empty
-ldap_exop_sync(): Argument #2 ($request_oid) must not contain any null bytes
+ValueError: ldap_exop(): Argument #2 ($request_oid) must not contain any null bytes
+ValueError: ldap_exop_sync(): Argument #2 ($request_oid) must not be empty
+ValueError: ldap_exop_sync(): Argument #2 ($request_oid) must not contain any null bytes
diff --git a/ext/ldap/tests/gh21262.phpt b/ext/ldap/tests/gh21262.phpt
index 3e414a9cbb12..52336ee070d1 100644
--- a/ext/ldap/tests/gh21262.phpt
+++ b/ext/ldap/tests/gh21262.phpt
@@ -17,14 +17,14 @@ $entry_with_empty_array = [
try {
ldap_add($ldap, $valid_dn, $entry_with_empty_array);
} catch (ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
// ldap_mod_add() should still reject empty arrays
try {
ldap_mod_add($ldap, $valid_dn, $entry_with_empty_array);
} catch (ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
// ldap_modify() should accept empty arrays (delete attribute)
@@ -32,7 +32,7 @@ try {
@ldap_modify($ldap, $valid_dn, $entry_with_empty_array);
echo "ldap_modify: no ValueError thrown", PHP_EOL;
} catch (ValueError $e) {
- echo "ldap_modify: UNEXPECTED ValueError: ", $e->getMessage(), PHP_EOL;
+ echo 'ldap_modify: UNEXPECTED: ', $e::class, ': ', $e->getMessage(), PHP_EOL;
}
// ldap_mod_del() should accept empty arrays (delete attribute)
@@ -40,11 +40,11 @@ try {
@ldap_mod_del($ldap, $valid_dn, $entry_with_empty_array);
echo "ldap_mod_del: no ValueError thrown", PHP_EOL;
} catch (ValueError $e) {
- echo "ldap_mod_del: UNEXPECTED ValueError: ", $e->getMessage(), PHP_EOL;
+ echo 'ldap_mod_del: UNEXPECTED: ', $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-ldap_add(): Argument #3 ($entry) attribute "attribute2" must be a non-empty list of attribute values
-ldap_mod_add(): Argument #3 ($entry) attribute "attribute2" must be a non-empty list of attribute values
+ValueError: ldap_add(): Argument #3 ($entry) attribute "attribute2" must be a non-empty list of attribute values
+ValueError: ldap_mod_add(): Argument #3 ($entry) attribute "attribute2" must be a non-empty list of attribute values
ldap_modify: no ValueError thrown
ldap_mod_del: no ValueError thrown
diff --git a/ext/ldap/tests/ldap_connect_port_error.phpt b/ext/ldap/tests/ldap_connect_port_error.phpt
index 55d41d395b13..8809b84d8a0e 100644
--- a/ext/ldap/tests/ldap_connect_port_error.phpt
+++ b/ext/ldap/tests/ldap_connect_port_error.phpt
@@ -10,15 +10,15 @@ require "connect.inc";
try {
ldap_connect("nope://$host", 65536);
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
ldap_connect("nope://$host", 0);
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-ldap_connect(): Argument #2 ($port) must be between 1 and 65535
-ldap_connect(): Argument #2 ($port) must be between 1 and 65535
+ValueError: ldap_connect(): Argument #2 ($port) must be between 1 and 65535
+ValueError: ldap_connect(): Argument #2 ($port) must be between 1 and 65535
diff --git a/ext/ldap/tests/ldap_constructor.phpt b/ext/ldap/tests/ldap_constructor.phpt
index d405bd33d903..f48d14dfa983 100644
--- a/ext/ldap/tests/ldap_constructor.phpt
+++ b/ext/ldap/tests/ldap_constructor.phpt
@@ -8,8 +8,8 @@ ldap
try {
new LDAP\Connection();
} catch (Error $ex) {
- echo "Exception: ", $ex->getMessage(), "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-Exception: Cannot directly construct LDAP\Connection, use ldap_connect() instead
+Error: Cannot directly construct LDAP\Connection, use ldap_connect() instead
diff --git a/ext/ldap/tests/ldap_first_attribute_error.phpt b/ext/ldap/tests/ldap_first_attribute_error.phpt
index 2776838501d3..c84ca8607b7b 100644
--- a/ext/ldap/tests/ldap_first_attribute_error.phpt
+++ b/ext/ldap/tests/ldap_first_attribute_error.phpt
@@ -13,8 +13,8 @@ $link = ldap_connect($uri);
try {
var_dump(ldap_first_attribute($link, $link));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-ldap_first_attribute(): Argument #2 ($entry) must be of type LDAP\ResultEntry, LDAP\Connection given
+TypeError: ldap_first_attribute(): Argument #2 ($entry) must be of type LDAP\ResultEntry, LDAP\Connection given
diff --git a/ext/ldap/tests/ldap_get_set_invalid_option_error.phpt b/ext/ldap/tests/ldap_get_set_invalid_option_error.phpt
index 2079353e48c9..dacaa9c9836e 100644
--- a/ext/ldap/tests/ldap_get_set_invalid_option_error.phpt
+++ b/ext/ldap/tests/ldap_get_set_invalid_option_error.phpt
@@ -9,12 +9,12 @@ $ldap = ldap_connect('ldap://127.0.0.1:3333');
try {
var_dump(ldap_set_option($ldap, 999999, "bogus"));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(ldap_get_option($ldap, 999999, $value));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
diff --git a/ext/ldap/tests/ldap_list_read_search_parallel_programming_errors.phpt b/ext/ldap/tests/ldap_list_read_search_parallel_programming_errors.phpt
index 4f3567d9e00b..286b44706aa5 100644
--- a/ext/ldap/tests/ldap_list_read_search_parallel_programming_errors.phpt
+++ b/ext/ldap/tests/ldap_list_read_search_parallel_programming_errors.phpt
@@ -110,4 +110,4 @@ ValueError: ldap_list(): Argument #3 ($filter) must be the same size as argument
TypeError: ldap_list(): Argument #2 ($base) must be a list of strings, int given
TypeError: ldap_list(): Argument #3 ($filter) must be a list of strings, int given
ValueError: ldap_list(): Argument #2 ($base) must not contain null bytes
-ValueError: ldap_list(): Argument #3 ($filter) must not contain null bytes
\ No newline at end of file
+ValueError: ldap_list(): Argument #3 ($filter) must not contain null bytes
diff --git a/ext/ldap/tests/ldap_set_option_error.phpt b/ext/ldap/tests/ldap_set_option_error.phpt
index eda3dc512173..92b84a2e9174 100644
--- a/ext/ldap/tests/ldap_set_option_error.phpt
+++ b/ext/ldap/tests/ldap_set_option_error.phpt
@@ -29,7 +29,7 @@ foreach ($controls as $control) {
try {
var_dump(ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, $control));
} catch (Error $exception) {
- echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
}
diff --git a/ext/ldap/tests/ldap_sort_control_missing_attr.phpt b/ext/ldap/tests/ldap_sort_control_missing_attr.phpt
index 0d6c3921f008..606894b7f374 100644
--- a/ext/ldap/tests/ldap_sort_control_missing_attr.phpt
+++ b/ext/ldap/tests/ldap_sort_control_missing_attr.phpt
@@ -20,11 +20,11 @@ try {
],
]);
} catch (\ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "ok\n";
?>
--EXPECT--
-ldap_search(): Sort key list must have an "attr" key
+ValueError: ldap_search(): Sort key list must have an "attr" key
ok
diff --git a/ext/pcre/tests/002.phpt b/ext/pcre/tests/002.phpt
index 14d196402062..ac3e54db459c 100644
--- a/ext/pcre/tests/002.phpt
+++ b/ext/pcre/tests/002.phpt
@@ -6,7 +6,7 @@ preg_* with bogus vals
try {
preg_match_all('//', '', $dummy, 0xdead);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(preg_quote(''));
@@ -17,7 +17,7 @@ var_dump(preg_replace('/(.)/e', 'for ($', 'abc'));
?>
--EXPECTF--
-preg_match_all(): Argument #4 ($flags) must be a PREG_* constant
+ValueError: preg_match_all(): Argument #4 ($flags) must be a PREG_* constant
string(0) ""
string(12) "a${1b${1c${1"
diff --git a/ext/pcre/tests/bug21732.phpt b/ext/pcre/tests/bug21732.phpt
index 02a13713e2ed..6fcbf47e3058 100644
--- a/ext/pcre/tests/bug21732.phpt
+++ b/ext/pcre/tests/bug21732.phpt
@@ -12,12 +12,12 @@ class foo {
try {
var_dump(preg_replace('', array(), ''));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(preg_replace_callback("/(ab)(cd)(e)/", array(new foo(), "cb"), 'abcde'));
?>
--EXPECT--
-preg_replace(): Argument #1 ($pattern) must be of type array when argument #2 ($replacement) is an array, string given
+TypeError: preg_replace(): Argument #1 ($pattern) must be of type array when argument #2 ($replacement) is an array, string given
array(4) {
[0]=>
string(5) "abcde"
diff --git a/ext/pcre/tests/gh16189.phpt b/ext/pcre/tests/gh16189.phpt
index c77ab7699eed..6e7dbaaf3941 100644
--- a/ext/pcre/tests/gh16189.phpt
+++ b/ext/pcre/tests/gh16189.phpt
@@ -6,14 +6,14 @@ GH-16189 (preg_match/preg_match_all underflow on start_offset argument)
try {
preg_match( '/<(\w+)[\s\w\-]+ id="S44_i89ew">/', '