[PHP-CVS] [php-src] master: Zend: applied fixers to improve test robustness (part 6/8) (#23314)

[email protected] (NickSdot via GitHub)
Newsgroups php.cvs
Message-ID <[email protected]>
Author: NickSdot (NickSdot)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-08-22T14:22:45+01:00

Commit: https://github.com/php/php-src/commit/d88731692f1f9c7b0785a8f1aeae99a5a647bbbf
Raw diff: https://github.com/php/php-src/commit/d88731692f1f9c7b0785a8f1aeae99a5a647bbbf.diff

Zend: applied fixers to improve test robustness (part 6/8) (#23314)

Changed paths:
  M  Zend/tests/readonly_props/readonly_clone_error6.phpt
  M  Zend/tests/readonly_props/readonly_clone_error7.phpt
  M  Zend/tests/readonly_props/readonly_clone_success4.phpt
  M  Zend/tests/readonly_props/readonly_coercion_type_error.phpt
  M  Zend/tests/readonly_props/readonly_containing_object.phpt
  M  Zend/tests/readonly_props/readonly_modification.phpt
  M  Zend/tests/readonly_props/unset.phpt
  M  Zend/tests/readonly_props/visibility_change.phpt
  M  Zend/tests/recursive_array_comparison.phpt
  M  Zend/tests/recv_init_ref_type.phpt
  M  Zend/tests/require_once_warning_to_exception.phpt
  M  Zend/tests/require_parse_exception.phpt
  M  Zend/tests/required_param_after_optional_named_args.phpt
  M  Zend/tests/restrict_globals/invalid_pass_by_ref.phpt
  M  Zend/tests/return_types/028.phpt
  M  Zend/tests/return_types/bug70557.phpt
  M  Zend/tests/return_types/never_disallowed5.phpt
  M  Zend/tests/self_and.phpt
  M  Zend/tests/self_instanceof_outside_class.phpt
  M  Zend/tests/self_method_or_prop_outside_class.phpt
  M  Zend/tests/self_mod.phpt
  M  Zend/tests/self_or.phpt
  M  Zend/tests/self_xor.phpt
  M  Zend/tests/serialize/bug64354.phpt
  M  Zend/tests/serialize/bug71841.phpt
  M  Zend/tests/shift_001.phpt
  M  Zend/tests/shift_002.phpt
  M  Zend/tests/stack_limit/stack_limit_001.phpt
  M  Zend/tests/stack_limit/stack_limit_002.phpt
  M  Zend/tests/stack_limit/stack_limit_003.phpt
  M  Zend/tests/stack_limit/stack_limit_006.phpt
  M  Zend/tests/stack_limit/stack_limit_007.phpt
  M  Zend/tests/stack_limit/stack_limit_008.phpt
  M  Zend/tests/stack_limit/stack_limit_011.phpt
  M  Zend/tests/stack_limit/stack_limit_014.phpt
  M  Zend/tests/static_method_non_existing_class.phpt
  M  Zend/tests/static_variables/static_variables_destructor.phpt
  M  Zend/tests/static_variables/static_variables_throwing_initializer.phpt
  M  Zend/tests/string_offset_as_object.phpt
  M  Zend/tests/string_offset_errors.phpt
  M  Zend/tests/strlen_deprecation_to_exception.phpt
  M  Zend/tests/strncasecmp_basic.phpt
  M  Zend/tests/strncmp_basic.phpt
  M  Zend/tests/sub_001.phpt
  M  Zend/tests/switch/bug80046.phpt
  M  Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt
  M  Zend/tests/this-reserved/this_in_extract.phpt
  M  Zend/tests/throw/001.phpt
  M  Zend/tests/throw/002.phpt
  M  Zend/tests/throwing_overloaded_compound_assign_op.phpt
  M  Zend/tests/traits/gh_17728.phpt
  M  Zend/tests/traits/trait_type_errors.phpt
  M  Zend/tests/trigger_error_basic.phpt
  M  Zend/tests/try/bug70228_3.phpt
  M  Zend/tests/try/bug70228_4.phpt
  M  Zend/tests/try/bug70228_5.phpt
  M  Zend/tests/try/bug72213.phpt
  M  Zend/tests/try/bug72213_2.phpt
  M  Zend/tests/try/catch_finally_006.phpt
  M  Zend/tests/try/try_finally_002.phpt
  M  Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt
  M  Zend/tests/type_coercion/gh22112.phpt
  M  Zend/tests/type_coercion/settype/settype_resource.phpt
  M  Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt
  M  Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt
  M  Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt
  M  Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt
  M  Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt
  M  Zend/tests/type_declarations/dnf_types/gh9516.phpt
  M  Zend/tests/type_declarations/internal_function_strict_mode.phpt
  M  Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt
  M  Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt
  M  Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt
  M  Zend/tests/type_declarations/intersection_types/parameter.phpt
  M  Zend/tests/type_declarations/intersection_types/typed_reference.phpt
  M  Zend/tests/type_declarations/iterable/iterable_001.phpt
  M  Zend/tests/type_declarations/iterable/iterable_003.phpt
  M  Zend/tests/type_declarations/literal_types/false_no_coercion.phpt
  M  Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt
  M  Zend/tests/type_declarations/literal_types/true_no_coercion.phpt
  M  Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt
  M  Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt
  M  Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt
  M  Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt
  M  Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt
  M  Zend/tests/type_declarations/scalar_basic.phpt
  M  Zend/tests/type_declarations/scalar_constant_defaults.phpt


Diff:

diff --git a/Zend/tests/readonly_props/readonly_clone_error6.phpt b/Zend/tests/readonly_props/readonly_clone_error6.phpt
index 16a04d802a11..f4ed5db4bb23 100644
--- a/Zend/tests/readonly_props/readonly_clone_error6.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error6.phpt
@@ -21,14 +21,14 @@ var_dump($foo);
 
 try {
     $foo->__clone();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $foo->__clone();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 var_dump($foo);
@@ -39,8 +39,8 @@ object(Foo)#%d (%d) {
   ["bar"]=>
   int(0)
 }
-Cannot modify readonly property Foo::$bar
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
 object(Foo)#%d (%d) {
   ["bar"]=>
   int(0)
diff --git a/Zend/tests/readonly_props/readonly_clone_error7.phpt b/Zend/tests/readonly_props/readonly_clone_error7.phpt
index e34ad9eb3d71..6925daf86fd9 100644
--- a/Zend/tests/readonly_props/readonly_clone_error7.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error7.phpt
@@ -18,16 +18,16 @@ $foo = new Foo([]);
 // First call fills the cache slot
 try {
     var_dump(clone $foo);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(clone $foo);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot indirectly modify readonly property Foo::$bar
-Cannot indirectly modify readonly property Foo::$bar
+Error: Cannot indirectly modify readonly property Foo::$bar
+Error: Cannot indirectly modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_props/readonly_clone_success4.phpt b/Zend/tests/readonly_props/readonly_clone_success4.phpt
index 40b7a29e3126..ab13e88a5c36 100644
--- a/Zend/tests/readonly_props/readonly_clone_success4.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_success4.phpt
@@ -12,8 +12,8 @@ class Foo {
     {
         try {
             $this->bar = "foo";
-        } catch (Error $e) {
-            echo $e->getMessage() . "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
 
         $this->bar = 2;
@@ -27,12 +27,12 @@ var_dump(clone $foo);
 
 ?>
 --EXPECTF--
-Cannot assign string to property Foo::$bar of type int
+TypeError: Cannot assign string to property Foo::$bar of type int
 object(Foo)#%d (%d) {
   ["bar"]=>
   int(2)
 }
-Cannot assign string to property Foo::$bar of type int
+TypeError: Cannot assign string to property Foo::$bar of type int
 object(Foo)#%d (%d) {
   ["bar"]=>
   int(2)
diff --git a/Zend/tests/readonly_props/readonly_coercion_type_error.phpt b/Zend/tests/readonly_props/readonly_coercion_type_error.phpt
index d41211d8e998..36ad807f2424 100644
--- a/Zend/tests/readonly_props/readonly_coercion_type_error.phpt
+++ b/Zend/tests/readonly_props/readonly_coercion_type_error.phpt
@@ -10,8 +10,8 @@ class Foo {
         $this->bar = 'bar';
         try {
             $this->bar = 42;
-        } catch (Error $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
@@ -20,4 +20,4 @@ new Foo();
 
 ?>
 --EXPECTF--
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_props/readonly_containing_object.phpt b/Zend/tests/readonly_props/readonly_containing_object.phpt
index 996b0ee3d44b..bf6a88c8b30a 100644
--- a/Zend/tests/readonly_props/readonly_containing_object.phpt
+++ b/Zend/tests/readonly_props/readonly_containing_object.phpt
@@ -17,18 +17,18 @@ $test->prop->foo += 1;
 $test->prop->foo++;
 try {
     $test->prop += 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop++;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     --$test->prop;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test->prop);
 
@@ -44,9 +44,9 @@ var_dump($test->prop);
 
 ?>
 --EXPECT--
-Unsupported operand types: stdClass + int
-Cannot modify readonly property Test::$prop
-Cannot modify readonly property Test::$prop
+TypeError: Unsupported operand types: stdClass + int
+Error: Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
 object(stdClass)#2 (1) {
   ["foo"]=>
   int(3)
diff --git a/Zend/tests/readonly_props/readonly_modification.phpt b/Zend/tests/readonly_props/readonly_modification.phpt
index bd04a203be19..d251e5c37c9e 100644
--- a/Zend/tests/readonly_props/readonly_modification.phpt
+++ b/Zend/tests/readonly_props/readonly_modification.phpt
@@ -20,63 +20,63 @@ $test = new Test;
 var_dump($test->prop); // Read.
 try {
     $test->prop = 2;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop += 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop++;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     ++$test->prop;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $ref =& $test->prop;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop =& $ref;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     byRef($test->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 var_dump($test->prop2); // Read.
 try {
     $test->prop2[] = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop2[0][] = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
 int(1)
-Cannot modify readonly property Test::$prop
-Cannot modify readonly property Test::$prop
-Cannot modify readonly property Test::$prop
-Cannot modify readonly property Test::$prop
-Cannot indirectly modify readonly property Test::$prop
-Cannot indirectly modify readonly property Test::$prop
-Cannot indirectly modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
+Error: Cannot indirectly modify readonly property Test::$prop
+Error: Cannot indirectly modify readonly property Test::$prop
+Error: Cannot indirectly modify readonly property Test::$prop
 array(0) {
 }
-Cannot indirectly modify readonly property Test::$prop2
-Cannot indirectly modify readonly property Test::$prop2
+Error: Cannot indirectly modify readonly property Test::$prop2
+Error: Cannot indirectly modify readonly property Test::$prop2
diff --git a/Zend/tests/readonly_props/unset.phpt b/Zend/tests/readonly_props/unset.phpt
index 823c021f6122..7d6db9fc5abb 100644
--- a/Zend/tests/readonly_props/unset.phpt
+++ b/Zend/tests/readonly_props/unset.phpt
@@ -14,8 +14,8 @@ class Test {
 $test = new Test(1);
 try {
     unset($test->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 class Test2 {
@@ -39,8 +39,8 @@ var_dump($test->prop); // Call __get.
 var_dump($test->prop); // Don't call __get.
 try {
     unset($test->prop); // Unset initialized, illegal.
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 class Test3 {
@@ -50,8 +50,8 @@ class Test3 {
 $test = new Test3;
 try {
     unset($test->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 class Test4 {
@@ -60,8 +60,8 @@ class Test4 {
     public function __construct() {
         try {
             unset($this->prop);
-        } catch (Error $e) {
-            echo $e::class, ': ', $e->getMessage(), PHP_EOL;
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 
@@ -74,19 +74,19 @@ $test = new Test4;
 var_dump($test->prop); // Don't call __get.
 try {
     unset($test->prop);
-} catch (Error $e) {
-    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test->prop); // Still don't call __get.
 
 ?>
 --EXPECT--
-Cannot unset readonly property Test::$prop
+Error: Cannot unset readonly property Test::$prop
 Test2::__get
 int(1)
 int(1)
-Cannot unset readonly property Test2::$prop
-Cannot unset protected(set) readonly property Test3::$prop from global scope
+Error: Cannot unset readonly property Test2::$prop
+Error: Cannot unset protected(set) readonly property Test3::$prop from global scope
 Error: Cannot unset readonly property Test4::$prop
 int(1)
 Error: Cannot unset readonly property Test4::$prop
diff --git a/Zend/tests/readonly_props/visibility_change.phpt b/Zend/tests/readonly_props/visibility_change.phpt
index f4a32f3cdaaf..6e06efd61e67 100644
--- a/Zend/tests/readonly_props/visibility_change.phpt
+++ b/Zend/tests/readonly_props/visibility_change.phpt
@@ -17,8 +17,8 @@ class B extends A {
 $a = new A();
 try {
     var_dump($a->prop);
-} catch (Error $error) {
-    echo $error->getMessage() . "\n";
+} catch (Throwable $error) {
+    echo $error::class, ': ', $error->getMessage(), "\n";
 }
 
 $b = new B();
@@ -26,5 +26,5 @@ var_dump($b->prop);
 
 ?>
 --EXPECT--
-Cannot access protected property A::$prop
+Error: Cannot access protected property A::$prop
 int(42)
diff --git a/Zend/tests/recursive_array_comparison.phpt b/Zend/tests/recursive_array_comparison.phpt
index 53cc9736030d..c136f400ae39 100644
--- a/Zend/tests/recursive_array_comparison.phpt
+++ b/Zend/tests/recursive_array_comparison.phpt
@@ -5,17 +5,17 @@ Comparison of a recursive array throws a catchable error
 $a = [&$a];
 try {
     $a === [[]];
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     [[]] === $a;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($a === $a);
 ?>
 --EXPECT--
-Nesting level too deep - recursive dependency?
-Nesting level too deep - recursive dependency?
+Error: Nesting level too deep - recursive dependency?
+Error: Nesting level too deep - recursive dependency?
 bool(true)
diff --git a/Zend/tests/recv_init_ref_type.phpt b/Zend/tests/recv_init_ref_type.phpt
index 29b96d379f8d..3a72d265305f 100644
--- a/Zend/tests/recv_init_ref_type.phpt
+++ b/Zend/tests/recv_init_ref_type.phpt
@@ -9,10 +9,10 @@ function test(array &$foo = []) {
 try {
     $bar = 42;
     test($bar);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
-test(): Argument #1 ($foo) must be of type array, int given, called in %s on line %d
+TypeError: test(): Argument #1 ($foo) must be of type array, int given, called in %s on line %d
diff --git a/Zend/tests/require_once_warning_to_exception.phpt b/Zend/tests/require_once_warning_to_exception.phpt
index bc706622438f..2eb33e035cdd 100644
--- a/Zend/tests/require_once_warning_to_exception.phpt
+++ b/Zend/tests/require_once_warning_to_exception.phpt
@@ -10,10 +10,10 @@ set_error_handler("exception_error_handler");
 
 try {
     $results = require_once 'does-not-exist.php';
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 };
 
 ?>
 --EXPECT--
-require_once(): Failed to open stream: No such file or directory
+Exception: require_once(): Failed to open stream: No such file or directory
diff --git a/Zend/tests/require_parse_exception.phpt b/Zend/tests/require_parse_exception.phpt
index d64efe178671..331786bcaa15 100644
--- a/Zend/tests/require_parse_exception.phpt
+++ b/Zend/tests/require_parse_exception.phpt
@@ -8,8 +8,8 @@ allow_url_include=1
 function test_parse_error($code) {
     try {
         require 'data://text/plain;base64,' . base64_encode($code);
-    } catch (ParseError $e) {
-        echo $e->getMessage(), " on line ", $e->getLine(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n";
     }
 }
 
@@ -43,9 +43,9 @@ var_dump("\u{ffffff}");');
 ?>
 --EXPECT--
 Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
-Unclosed '{' on line 2
-Unclosed '{' on line 3
-syntax error, unexpected end of file, expecting "(" on line 2
-Invalid numeric literal on line 2
-Invalid UTF-8 codepoint escape sequence on line 2
-Invalid UTF-8 codepoint escape sequence: Codepoint too large on line 2
+ParseError: Unclosed '{' on line 2
+ParseError: Unclosed '{' on line 3
+ParseError: syntax error, unexpected end of file, expecting "(" on line 2
+ParseError: Invalid numeric literal on line 2
+ParseError: Invalid UTF-8 codepoint escape sequence on line 2
+ParseError: Invalid UTF-8 codepoint escape sequence: Codepoint too large on line 2
diff --git a/Zend/tests/required_param_after_optional_named_args.phpt b/Zend/tests/required_param_after_optional_named_args.phpt
index 19060ab108b0..c96d51ff0083 100644
--- a/Zend/tests/required_param_after_optional_named_args.phpt
+++ b/Zend/tests/required_param_after_optional_named_args.phpt
@@ -7,11 +7,11 @@ function test($a = 1, $b) {
 }
 try {
     test(b: 2);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
 Deprecated: test(): Optional parameter $a declared before required parameter $b is implicitly treated as a required parameter in %s on line %d
-test(): Argument #1 ($a) not passed
+ArgumentCountError: test(): Argument #1 ($a) not passed
diff --git a/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt b/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt
index afb099b6812d..afa8a0e75bba 100644
--- a/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt
+++ b/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt
@@ -6,18 +6,18 @@ $GLOBALS must be passed by reference (runtime error)
 function by_ref(&$ref) {}
 try {
     by_ref($GLOBALS);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     by_ref2($GLOBALS);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 function by_ref2(&$ref) {}
 
 ?>
 --EXPECT--
-by_ref(): Argument #1 ($ref) could not be passed by reference
-by_ref2(): Argument #1 ($ref) could not be passed by reference
+Error: by_ref(): Argument #1 ($ref) could not be passed by reference
+Error: by_ref2(): Argument #1 ($ref) could not be passed by reference
diff --git a/Zend/tests/return_types/028.phpt b/Zend/tests/return_types/028.phpt
index 802dd7708dfe..efc356e1d10e 100644
--- a/Zend/tests/return_types/028.phpt
+++ b/Zend/tests/return_types/028.phpt
@@ -11,10 +11,10 @@ function foo(): stdClass {
 
 try {
     foo();
-} catch (Error $e) {
-    echo $e->getMessage(), " in ", $e->getFile(), " on line ", $e->getLine();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
 }
 
 ?>
 --EXPECTF--
-foo(): Return value must be of type stdClass, array returned in %s on line %d
+TypeError: foo(): Return value must be of type stdClass, array returned in %s on line %d
diff --git a/Zend/tests/return_types/bug70557.phpt b/Zend/tests/return_types/bug70557.phpt
index 1795a2a26a79..f804678f83d8 100644
--- a/Zend/tests/return_types/bug70557.phpt
+++ b/Zend/tests/return_types/bug70557.phpt
@@ -9,9 +9,9 @@ function getNumber() : int {
 
 try {
     getNumber();
-} catch (TypeError $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(62) "getNumber(): Return value must be of type int, string returned"
+TypeError: getNumber(): Return value must be of type int, string returned
diff --git a/Zend/tests/return_types/never_disallowed5.phpt b/Zend/tests/return_types/never_disallowed5.phpt
index 26887cd46833..c6ca9a5def02 100644
--- a/Zend/tests/return_types/never_disallowed5.phpt
+++ b/Zend/tests/return_types/never_disallowed5.phpt
@@ -13,9 +13,9 @@ class Foo {
 
 try {
     Foo::bar();
-} catch (TypeError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Foo::bar(): never-returning method must not implicitly return
+TypeError: Foo::bar(): never-returning method must not implicitly return
diff --git a/Zend/tests/self_and.phpt b/Zend/tests/self_and.phpt
index f3662c575c48..76b370a35780 100644
--- a/Zend/tests/self_and.phpt
+++ b/Zend/tests/self_and.phpt
@@ -15,8 +15,8 @@ var_dump($s);
 try {
     $s1 &= 11;
     var_dump($s1);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $s2 &= 33;
@@ -32,7 +32,7 @@ echo "Done\n";
 ?>
 --EXPECTF--
 int(18)
-Unsupported operand types: string & int
+TypeError: Unsupported operand types: string & int
 
 Warning: A non-numeric value encountered in %s on line %d
 int(33)
diff --git a/Zend/tests/self_instanceof_outside_class.phpt b/Zend/tests/self_instanceof_outside_class.phpt
index ecb593a6a580..ffee9a84675e 100644
--- a/Zend/tests/self_instanceof_outside_class.phpt
+++ b/Zend/tests/self_instanceof_outside_class.phpt
@@ -6,12 +6,12 @@ instanceof self outside a class
 $fn = function() {
     try {
         new stdClass instanceof self;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 };
 $fn();
 
 ?>
 --EXPECT--
-Cannot access "self" when no class scope is active
+Error: Cannot access "self" when no class scope is active
diff --git a/Zend/tests/self_method_or_prop_outside_class.phpt b/Zend/tests/self_method_or_prop_outside_class.phpt
index feaeccf25f95..c534dcf62af8 100644
--- a/Zend/tests/self_method_or_prop_outside_class.phpt
+++ b/Zend/tests/self_method_or_prop_outside_class.phpt
@@ -7,30 +7,30 @@ $fn = function() {
     $str = "foo";
     try {
         self::${$str . "bar"};
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         unset(self::${$str . "bar"});
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         isset(self::${$str . "bar"});
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         self::{$str . "bar"}();
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 };
 $fn();
 
 ?>
 --EXPECT--
-Cannot access "self" when no class scope is active
-Cannot access "self" when no class scope is active
-Cannot access "self" when no class scope is active
-Cannot access "self" when no class scope is active
+Error: Cannot access "self" when no class scope is active
+Error: Cannot access "self" when no class scope is active
+Error: Cannot access "self" when no class scope is active
+Error: Cannot access "self" when no class scope is active
diff --git a/Zend/tests/self_mod.phpt b/Zend/tests/self_mod.phpt
index 7d469f800239..feaa34517772 100644
--- a/Zend/tests/self_mod.phpt
+++ b/Zend/tests/self_mod.phpt
@@ -13,8 +13,8 @@ var_dump($s);
 try {
     $s1 %= 11;
     var_dump($s1);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $s2 %= 33;
@@ -24,7 +24,7 @@ echo "Done\n";
 ?>
 --EXPECTF--
 int(13)
-Unsupported operand types: string % int
+TypeError: Unsupported operand types: string % int
 
 Warning: A non-numeric value encountered in %s on line %d
 int(3)
diff --git a/Zend/tests/self_or.phpt b/Zend/tests/self_or.phpt
index 61f1f4203b08..5ad5d8dbaee8 100644
--- a/Zend/tests/self_or.phpt
+++ b/Zend/tests/self_or.phpt
@@ -15,8 +15,8 @@ var_dump($s);
 try {
     $s1 |= 11;
     var_dump($s1);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $s2 |= 33;
@@ -32,7 +32,7 @@ echo "Done\n";
 ?>
 --EXPECTF--
 int(127)
-Unsupported operand types: string | int
+TypeError: Unsupported operand types: string | int
 
 Warning: A non-numeric value encountered in %s on line %d
 int(45345)
diff --git a/Zend/tests/self_xor.phpt b/Zend/tests/self_xor.phpt
index 4bff3f6d508e..8262d185f7e8 100644
--- a/Zend/tests/self_xor.phpt
+++ b/Zend/tests/self_xor.phpt
@@ -15,8 +15,8 @@ var_dump($s);
 try {
     $s1 ^= 11;
     var_dump($s1);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $s2 ^= 33;
@@ -32,7 +32,7 @@ echo "Done\n";
 ?>
 --EXPECTF--
 int(109)
-Unsupported operand types: string ^ int
+TypeError: Unsupported operand types: string ^ int
 
 Warning: A non-numeric value encountered in %s on line %d
 int(45312)
diff --git a/Zend/tests/serialize/bug64354.phpt b/Zend/tests/serialize/bug64354.phpt
index 11b0aa31e247..fde6dd5cc01a 100644
--- a/Zend/tests/serialize/bug64354.phpt
+++ b/Zend/tests/serialize/bug64354.phpt
@@ -16,10 +16,10 @@ $data = array(new B);
 
 try {
     serialize($data);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Deprecated: B implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
-string(9) "serialize"
+Exception: serialize
diff --git a/Zend/tests/serialize/bug71841.phpt b/Zend/tests/serialize/bug71841.phpt
index f32b0e9b231f..75b1269eb9f1 100644
--- a/Zend/tests/serialize/bug71841.phpt
+++ b/Zend/tests/serialize/bug71841.phpt
@@ -5,41 +5,41 @@ Bug #71841 (EG(error_zval) is not handled well)
 $z = unserialize('O:1:"A":0:{}');
 try {
     var_dump($z->e.=0);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(++$z->x);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump($z->y++);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $y = array(PHP_INT_MAX => 0);
 try {
     var_dump($y[] .= 0);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(++$y[]);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump($y[]++);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
diff --git a/Zend/tests/shift_001.phpt b/Zend/tests/shift_001.phpt
index f441cf2dcf8b..e66bb5306a30 100644
--- a/Zend/tests/shift_001.phpt
+++ b/Zend/tests/shift_001.phpt
@@ -13,8 +13,8 @@ var_dump($s);
 try {
     $s1 <<= 1;
     var_dump($s1);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $s2 <<= 3;
@@ -24,7 +24,7 @@ echo "Done\n";
 ?>
 --EXPECTF--
 int(492)
-Unsupported operand types: string << int
+TypeError: Unsupported operand types: string << int
 
 Warning: A non-numeric value encountered in %s on line %d
 int(362760)
diff --git a/Zend/tests/shift_002.phpt b/Zend/tests/shift_002.phpt
index 0bdc9b3eeb3c..3434c9332e6d 100644
--- a/Zend/tests/shift_002.phpt
+++ b/Zend/tests/shift_002.phpt
@@ -13,8 +13,8 @@ var_dump($s);
 try {
     $s1 >>= 1;
     var_dump($s1);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $s2 >>= 3;
@@ -24,7 +24,7 @@ echo "Done\n";
 ?>
 --EXPECTF--
 int(30)
-Unsupported operand types: string >> int
+TypeError: Unsupported operand types: string >> int
 
 Warning: A non-numeric value encountered in %s on line %d
 int(5668)
diff --git a/Zend/tests/stack_limit/stack_limit_001.phpt b/Zend/tests/stack_limit/stack_limit_001.phpt
index 73cc3c08fe9d..2142364de4f4 100644
--- a/Zend/tests/stack_limit/stack_limit_001.phpt
+++ b/Zend/tests/stack_limit/stack_limit_001.phpt
@@ -35,20 +35,20 @@ function replace() {
 
 try {
     new Test1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     clone new Test2;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     replace();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -63,6 +63,6 @@ array(4) {
   ["EG(stack_limit)"]=>
   string(%d) "0x%x"
 }
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_002.phpt b/Zend/tests/stack_limit/stack_limit_002.phpt
index 64a11e1b2638..059eecb9c4f0 100644
--- a/Zend/tests/stack_limit/stack_limit_002.phpt
+++ b/Zend/tests/stack_limit/stack_limit_002.phpt
@@ -34,20 +34,20 @@ function replace() {
 $fiber = new Fiber(function (): void {
     try {
         new Test1;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 
     try {
         clone new Test2;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 
     try {
         replace();
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 });
 
@@ -65,6 +65,6 @@ array(4) {
   ["EG(stack_limit)"]=>
   string(%d) "0x%x"
 }
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_003.phpt b/Zend/tests/stack_limit/stack_limit_003.phpt
index 9956c761cb18..1d0d7c089649 100644
--- a/Zend/tests/stack_limit/stack_limit_003.phpt
+++ b/Zend/tests/stack_limit/stack_limit_003.phpt
@@ -33,20 +33,20 @@ function replace() {
 
 try {
     new Test1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     clone new Test2;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     replace();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -61,6 +61,6 @@ array(4) {
   ["EG(stack_limit)"]=>
   string(%d) "0x%x"
 }
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_006.phpt b/Zend/tests/stack_limit/stack_limit_006.phpt
index d8d6251cf0c6..4e187a513a3c 100644
--- a/Zend/tests/stack_limit/stack_limit_006.phpt
+++ b/Zend/tests/stack_limit/stack_limit_006.phpt
@@ -292,20 +292,20 @@ function replace() {
 
 try {
     new Test1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     clone new Test2;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     replace();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -320,6 +320,6 @@ array(4) {
   ["EG(stack_limit)"]=>
   string(%d) "0x%x"
 }
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_007.phpt b/Zend/tests/stack_limit/stack_limit_007.phpt
index d34e244234c2..58478cc5a1c8 100644
--- a/Zend/tests/stack_limit/stack_limit_007.phpt
+++ b/Zend/tests/stack_limit/stack_limit_007.phpt
@@ -18,8 +18,8 @@ function replace() {
         try {
             $tryExecuted = true;
             return replace();
-        } catch (Error $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
             // We should not enter the catch block if we haven't executed at
             // least one op in the try block
             printf("Try executed: %d\n", $tryExecuted ?? 0);
@@ -41,5 +41,5 @@ array(4) {
   ["EG(stack_limit)"]=>
   string(%d) "0x%x"
 }
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
 Try executed: 1
diff --git a/Zend/tests/stack_limit/stack_limit_008.phpt b/Zend/tests/stack_limit/stack_limit_008.phpt
index db61fb15e52c..e52f2f350ad2 100644
--- a/Zend/tests/stack_limit/stack_limit_008.phpt
+++ b/Zend/tests/stack_limit/stack_limit_008.phpt
@@ -21,8 +21,8 @@ function replace() {
             echo "Will throw:\n";
             try {
                 return replace2();
-            } catch (Error $e) {
-                echo $e->getMessage();
+            } catch (Throwable $e) {
+                echo $e::class, ': ', $e->getMessage(), "\n";
             }
         }
     }, 'x');
@@ -55,4 +55,4 @@ array(4) {
   string(%d) "0x%x"
 }
 Will throw:
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_011.phpt b/Zend/tests/stack_limit/stack_limit_011.phpt
index 762f67184f6a..15aa89d78c6e 100644
--- a/Zend/tests/stack_limit/stack_limit_011.phpt
+++ b/Zend/tests/stack_limit/stack_limit_011.phpt
@@ -34,8 +34,8 @@ function replace() {
 
 try {
     replace();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     echo 'Previous: ', $e->getPrevious()->getMessage(), "\n";
 }
 
@@ -51,5 +51,5 @@ array(4) {
   ["EG(stack_limit)"]=>
   string(%d) "0x%x"
 }
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
 Previous: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_014.phpt b/Zend/tests/stack_limit/stack_limit_014.phpt
index 144c64ad39ea..d9e87f4de790 100644
--- a/Zend/tests/stack_limit/stack_limit_014.phpt
+++ b/Zend/tests/stack_limit/stack_limit_014.phpt
@@ -15,8 +15,8 @@ memory_limit=1G
 
 try {
     require __DIR__.'/stack_limit_014.inc';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
diff --git a/Zend/tests/static_method_non_existing_class.phpt b/Zend/tests/static_method_non_existing_class.phpt
index 752655d22782..6917a4de3e90 100644
--- a/Zend/tests/static_method_non_existing_class.phpt
+++ b/Zend/tests/static_method_non_existing_class.phpt
@@ -6,10 +6,10 @@ Calling a static method on a non-existing class
 $str = "foo";
 try {
     Test::{$str . "bar"}();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Class "Test" not found
+Error: Class "Test" not found
diff --git a/Zend/tests/static_variables/static_variables_destructor.phpt b/Zend/tests/static_variables/static_variables_destructor.phpt
index 9128c86e6b1b..8377db2f74ca 100644
--- a/Zend/tests/static_variables/static_variables_destructor.phpt
+++ b/Zend/tests/static_variables/static_variables_destructor.phpt
@@ -24,13 +24,13 @@ function foo(bool $throw) {
 
 try {
     foo(true);
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 foo(false);
 
 ?>
 --EXPECT--
 bar() called
-__destruct() called
+Exception: __destruct() called
 int(42)
diff --git a/Zend/tests/static_variables/static_variables_throwing_initializer.phpt b/Zend/tests/static_variables/static_variables_throwing_initializer.phpt
index 9e4752c24f5c..c5b5a1223c71 100644
--- a/Zend/tests/static_variables/static_variables_throwing_initializer.phpt
+++ b/Zend/tests/static_variables/static_variables_throwing_initializer.phpt
@@ -10,12 +10,12 @@ function foo($throw) {
 
 try {
     var_dump(foo(true));
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(foo(false));
 
 ?>
 --EXPECT--
-Throwing from foo()
+Exception: Throwing from foo()
 int(42)
diff --git a/Zend/tests/string_offset_as_object.phpt b/Zend/tests/string_offset_as_object.phpt
index 6fdebe936088..f5d477ef1b3b 100644
--- a/Zend/tests/string_offset_as_object.phpt
+++ b/Zend/tests/string_offset_as_object.phpt
@@ -6,58 +6,58 @@ Using string offset as object
 $str = "x";
 try {
     $str[0]->bar = "xyz";
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $str[0]->bar[1] = "bang";
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $str[0]->bar += 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $str[0]->bar = &$b;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     ++$str[0]->bar;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     --$str[0]->bar;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $str[0]->bar++;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $str[0]->bar--;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     unset($str[0]->bar);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
diff --git a/Zend/tests/string_offset_errors.phpt b/Zend/tests/string_offset_errors.phpt
index 726dc41f0653..60c5399f5a60 100644
--- a/Zend/tests/string_offset_errors.phpt
+++ b/Zend/tests/string_offset_errors.phpt
@@ -15,25 +15,25 @@ function &gen() {
 
 try {
     test();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $str = "foo";
     $str[0] =& $str[1];
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     foreach (gen() as $v) {}
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot create references to/from string offsets
-Cannot create references to/from string offsets
-Cannot create references to/from string offsets
+Error: Cannot create references to/from string offsets
+Error: Cannot create references to/from string offsets
+Error: Cannot create references to/from string offsets
diff --git a/Zend/tests/strlen_deprecation_to_exception.phpt b/Zend/tests/strlen_deprecation_to_exception.phpt
index 7b616f3b6432..e7622db355ba 100644
--- a/Zend/tests/strlen_deprecation_to_exception.phpt
+++ b/Zend/tests/strlen_deprecation_to_exception.phpt
@@ -8,10 +8,10 @@ set_error_handler(function($_, $msg) {
 });
 try {
     strlen(null);
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-strlen(): Passing null to parameter #1 ($string) of type string is deprecated
+Exception: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
diff --git a/Zend/tests/strncasecmp_basic.phpt b/Zend/tests/strncasecmp_basic.phpt
index 54eb6fb5209b..fc150741ada3 100644
--- a/Zend/tests/strncasecmp_basic.phpt
+++ b/Zend/tests/strncasecmp_basic.phpt
@@ -5,8 +5,8 @@ strncasecmp() tests
 
 try {
     var_dump(strncasecmp("", "", -1));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 var_dump(strncasecmp("aef", "dfsgbdf", 0));
@@ -19,7 +19,7 @@ var_dump(strncasecmp("01", "01", 1000));
 
 ?>
 --EXPECT--
-strncasecmp(): Argument #3 ($length) must be greater than or equal to 0
+ValueError: strncasecmp(): Argument #3 ($length) must be greater than or equal to 0
 int(0)
 int(-3)
 int(0)
diff --git a/Zend/tests/strncmp_basic.phpt b/Zend/tests/strncmp_basic.phpt
index bb40946f240a..6f93ed23f939 100644
--- a/Zend/tests/strncmp_basic.phpt
+++ b/Zend/tests/strncmp_basic.phpt
@@ -6,8 +6,8 @@ strncmp() tests
 var_dump(strncmp("", "", 100));
 try {
     var_dump(strncmp("aef", "dfsgbdf", -1));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(strncmp("fghjkl", "qwer", 0));
 var_dump(strncmp("qwerty", "qwerty123", 6));
@@ -16,7 +16,7 @@ var_dump(strncmp("qwerty", "qwerty123", 7));
 ?>
 --EXPECT--
 int(0)
-strncmp(): Argument #3 ($length) must be greater than or equal to 0
+ValueError: strncmp(): Argument #3 ($length) must be greater than or equal to 0
 int(0)
 int(0)
 int(-1)
diff --git a/Zend/tests/sub_001.phpt b/Zend/tests/sub_001.phpt
index 92e3ff0021f0..bf134a7f2366 100644
--- a/Zend/tests/sub_001.phpt
+++ b/Zend/tests/sub_001.phpt
@@ -8,8 +8,8 @@ $b = array(1);
 
 try {
     var_dump($a - $b);
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $c = $a - $b;
@@ -18,7 +18,7 @@ var_dump($c);
 echo "Done\n";
 ?>
 --EXPECTF--
-Exception: Unsupported operand types: array - array
+TypeError: Unsupported operand types: array - array
 
 Fatal error: Uncaught TypeError: Unsupported operand types: array - array in %s:%d
 Stack trace:
diff --git a/Zend/tests/switch/bug80046.phpt b/Zend/tests/switch/bug80046.phpt
index 87a493c20308..9964826c5eca 100644
--- a/Zend/tests/switch/bug80046.phpt
+++ b/Zend/tests/switch/bug80046.phpt
@@ -13,10 +13,10 @@ function test($foo) {
 }
 try {
     test('Foo');
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Default
+Exception: Default
diff --git a/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt b/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt
index 95d2fc1233d4..950c092c2684 100644
--- a/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt
+++ b/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt
@@ -11,10 +11,10 @@ class Foo {
 
 try {
     Foo::test();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Access to undeclared static property Foo::$property
+Error: Access to undeclared static property Foo::$property
diff --git a/Zend/tests/this-reserved/this_in_extract.phpt b/Zend/tests/this-reserved/this_in_extract.phpt
index 2e3f7b497fdb..5db09b7d700a 100644
--- a/Zend/tests/this-reserved/this_in_extract.phpt
+++ b/Zend/tests/this-reserved/this_in_extract.phpt
@@ -5,15 +5,15 @@ $this re-assign in extract()
 function foo() {
     try {
         extract(["this"=>42, "a"=>24]);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump($a);
 }
 foo();
 ?>
 --EXPECTF--
-Cannot re-assign $this
+Error: Cannot re-assign $this
 
 Warning: Undefined variable $a in %s on line %d
 NULL
diff --git a/Zend/tests/throw/001.phpt b/Zend/tests/throw/001.phpt
index ba2406c6d388..906e812d29bd 100644
--- a/Zend/tests/throw/001.phpt
+++ b/Zend/tests/throw/001.phpt
@@ -6,93 +6,93 @@ throw expression
 try {
     $result = true && throw new Exception("true && throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = false && throw new Exception("false && throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = true and throw new Exception("true and throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = false and throw new Exception("false and throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = true || throw new Exception("true || throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = false || throw new Exception("false || throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = true or throw new Exception("true or throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = false or throw new Exception("false or throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = null ?? throw new Exception("null ?? throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = "foo" ?? throw new Exception('"foo" ?? throw');
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = null ?: throw new Exception("null ?: throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = "foo" ?: throw new Exception('"foo" ?: throw');
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $callable = fn() => throw new Exception("fn() => throw");
     var_dump("not yet");
     $callable();
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $result = "bar";
@@ -106,28 +106,28 @@ try {
         throw new Exception("exception 1"),
         throw new Exception("exception 2")
     );
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = true ? true : throw new Exception("true ? true : throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $result = false ? true : throw new Exception("false ? true : throw");
     var_dump($result);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     throw new Exception() + 1;
 } catch (Throwable $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
@@ -143,31 +143,31 @@ var_dump($exception->getMessage());
 
 try {
     throw null ?? new Exception('throw null ?? new Exception();');
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-string(13) "true && throw"
+Exception: true && throw
 bool(false)
-string(14) "true and throw"
+Exception: true and throw
 bool(false)
 bool(true)
-string(14) "false || throw"
+Exception: false || throw
 bool(true)
-string(14) "false or throw"
-string(13) "null ?? throw"
+Exception: false or throw
+Exception: null ?? throw
 string(3) "foo"
-string(13) "null ?: throw"
+Exception: null ?: throw
 string(3) "foo"
 string(7) "not yet"
-string(13) "fn() => throw"
+Exception: fn() => throw
 string(3) "bar"
-string(11) "exception 1"
+Exception: exception 1
 bool(true)
-string(20) "false ? true : throw"
-string(42) "Unsupported operand types: Exception + int"
+Exception: false ? true : throw
+TypeError: Unsupported operand types: Exception + int
 string(35) "throw $exception = new Exception();"
 string(37) "throw $exception ??= new Exception();"
-string(30) "throw null ?? new Exception();"
+Exception: throw null ?? new Exception();
diff --git a/Zend/tests/throw/002.phpt b/Zend/tests/throw/002.phpt
index e80dfbb7d14d..b38bc7c717f8 100644
--- a/Zend/tests/throw/002.phpt
+++ b/Zend/tests/throw/002.phpt
@@ -23,62 +23,62 @@ class Foo {
 
 try {
     (new Foo())->throwException();
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     Foo::staticThrowException();
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     throw true ? new Exception('Ternary true 1') : new Exception('Ternary true 2');
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     throw false ? new Exception('Ternary false 1') : new Exception('Ternary false 2');
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $exception1 = new Exception('Coalesce non-null 1');
     $exception2 = new Exception('Coalesce non-null 2');
     throw $exception1 ?? $exception2;
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $exception1 = null;
     $exception2 = new Exception('Coalesce null 2');
     throw $exception1 ?? $exception2;
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     throw $exception = new Exception('Assignment');
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $exception = null;
     throw $exception ??= new Exception('Coalesce assignment null');
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $exception = new Exception('Coalesce assignment non-null 1');
     throw $exception ??= new Exception('Coalesce assignment non-null 2');
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $andConditionalTest = function ($condition1, $condition2) {
@@ -89,40 +89,40 @@ $andConditionalTest = function ($condition1, $condition2) {
 
 try {
     $andConditionalTest(false, false);
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $andConditionalTest(false, true);
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $andConditionalTest(true, false);
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $andConditionalTest(true, true);
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Not found
-Static not found
-Ternary true 1
-Ternary false 2
-Coalesce non-null 1
-Coalesce null 2
-Assignment
-Coalesce assignment null
-Coalesce assignment non-null 1
-And in conditional 2
-And in conditional 2
-And in conditional 2
-And in conditional 1
+Exception: Not found
+Exception: Static not found
+Exception: Ternary true 1
+Exception: Ternary false 2
+Exception: Coalesce non-null 1
+Exception: Coalesce null 2
+Exception: Assignment
+Exception: Coalesce assignment null
+Exception: Coalesce assignment non-null 1
+Exception: And in conditional 2
+Exception: And in conditional 2
+Exception: And in conditional 2
+Exception: And in conditional 1
diff --git a/Zend/tests/throwing_overloaded_compound_assign_op.phpt b/Zend/tests/throwing_overloaded_compound_assign_op.phpt
index 39c38627076c..7f127701ee6e 100644
--- a/Zend/tests/throwing_overloaded_compound_assign_op.phpt
+++ b/Zend/tests/throwing_overloaded_compound_assign_op.phpt
@@ -15,22 +15,22 @@ $test = new ArrayObject;
 $test[0] = 42;
 try {
     $test[0] %= 0;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test);
 
 $test2 = new Test;
 try {
     $test2->prop %= 0;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test2);
 
 ?>
 --EXPECT--
-Modulo by zero
+DivisionByZeroError: Modulo by zero
 object(ArrayObject)#1 (1) {
   ["storage":"ArrayObject":private]=>
   array(1) {
@@ -38,7 +38,7 @@ object(ArrayObject)#1 (1) {
     int(42)
   }
 }
-Modulo by zero
+DivisionByZeroError: Modulo by zero
 object(Test)#3 (1) {
   ["prop"]=>
   int(42)
diff --git a/Zend/tests/traits/gh_17728.phpt b/Zend/tests/traits/gh_17728.phpt
index ef458a8e8d5e..a42231f6004d 100644
--- a/Zend/tests/traits/gh_17728.phpt
+++ b/Zend/tests/traits/gh_17728.phpt
@@ -15,10 +15,10 @@ trait Foo {
 
 try {
     Foo::bar();
-} catch (ErrorException $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Calling static trait method Foo::bar is deprecated, it should only be called on a class using the trait
+ErrorException: Calling static trait method Foo::bar is deprecated, it should only be called on a class using the trait
diff --git a/Zend/tests/traits/trait_type_errors.phpt b/Zend/tests/traits/trait_type_errors.phpt
index d3c7c0582fb1..7d6a2d598026 100644
--- a/Zend/tests/traits/trait_type_errors.phpt
+++ b/Zend/tests/traits/trait_type_errors.phpt
@@ -22,22 +22,22 @@ class P extends C {
 $c = new C;
 try {
     $c->test1("foo");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $c->test2("foo");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $c->test3("foo");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
-C::test1(): Return value must be of type int, string returned
-C::test2(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d
-C::test3(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d
+TypeError: C::test1(): Return value must be of type int, string returned
+TypeError: C::test2(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d
+TypeError: C::test3(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d
diff --git a/Zend/tests/trigger_error_basic.phpt b/Zend/tests/trigger_error_basic.phpt
index d492590bcd92..f8d5209f9e0e 100644
--- a/Zend/tests/trigger_error_basic.phpt
+++ b/Zend/tests/trigger_error_basic.phpt
@@ -7,13 +7,13 @@ var_dump(trigger_error("error"));
 
 try {
     var_dump(trigger_error("error", -1));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(trigger_error("error", 0));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 var_dump(trigger_error("error", E_USER_WARNING));
@@ -23,8 +23,8 @@ var_dump(trigger_error("error", E_USER_DEPRECATED));
 --EXPECTF--
 Notice: error in %s on line %d
 bool(true)
-trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
-trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
+ValueError: trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
+ValueError: trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
 
 Warning: error in %s on line %d
 bool(true)
diff --git a/Zend/tests/try/bug70228_3.phpt b/Zend/tests/try/bug70228_3.phpt
index 80a0f379765b..d29d0cd89b1f 100644
--- a/Zend/tests/try/bug70228_3.phpt
+++ b/Zend/tests/try/bug70228_3.phpt
@@ -19,14 +19,14 @@ function test() {
 
 try {
     var_dump(test());
-} catch (Exception $e) {
+} catch (Throwable $e) {
     do {
-        echo $e->getMessage() . "\n";
+        echo $e::class, ': ', $e->getMessage(), "\n";
         $e = $e->getPrevious();
     } while ($e);
 }
 ?>
 --EXPECTF--
 Deprecated: Returning from a finally block is deprecated in %s on line %d
-2
-1
+Exception: 2
+Exception: 1
diff --git a/Zend/tests/try/bug70228_4.phpt b/Zend/tests/try/bug70228_4.phpt
index 7e0fd78707d7..245433209de2 100644
--- a/Zend/tests/try/bug70228_4.phpt
+++ b/Zend/tests/try/bug70228_4.phpt
@@ -21,13 +21,13 @@ function test() {
 
 try {
     var_dump(test());
-} catch (Exception $e) {
+} catch (Throwable $e) {
     do {
-        echo $e->getMessage() . "\n";
+        echo $e::class, ': ', $e->getMessage(), "\n";
         $e = $e->getPrevious();
     } while ($e);
 }
 ?>
 --EXPECTF--
 Deprecated: Returning from a finally block is deprecated in %s on line %d
-1
+Exception: 1
diff --git a/Zend/tests/try/bug70228_5.phpt b/Zend/tests/try/bug70228_5.phpt
index 29cbf4910de1..b5aa085d5278 100644
--- a/Zend/tests/try/bug70228_5.phpt
+++ b/Zend/tests/try/bug70228_5.phpt
@@ -12,9 +12,9 @@ function test() {
 
 try {
     test();
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-ops
+Exception: ops
diff --git a/Zend/tests/try/bug72213.phpt b/Zend/tests/try/bug72213.phpt
index 50555f53e419..ba53b3bb037d 100644
--- a/Zend/tests/try/bug72213.phpt
+++ b/Zend/tests/try/bug72213.phpt
@@ -15,11 +15,11 @@ function test() {
 
 try {
     test();
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($e->getPrevious()->getMessage());
 }
 ?>
 --EXPECT--
-string(1) "b"
+Exception: b
 string(1) "a"
diff --git a/Zend/tests/try/bug72213_2.phpt b/Zend/tests/try/bug72213_2.phpt
index a9b5f1490b2d..df5b8aad484b 100644
--- a/Zend/tests/try/bug72213_2.phpt
+++ b/Zend/tests/try/bug72213_2.phpt
@@ -18,9 +18,9 @@ function test() {
 
 try {
     test();
-} catch (Exception $e) {
-    echo "caught {$e->getMessage()}\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-caught 1
+Exception: 1
diff --git a/Zend/tests/try/catch_finally_006.phpt b/Zend/tests/try/catch_finally_006.phpt
index 463ce377f0a3..fca1371fb671 100644
--- a/Zend/tests/try/catch_finally_006.phpt
+++ b/Zend/tests/try/catch_finally_006.phpt
@@ -17,9 +17,9 @@ function foo ($a) {
 
 try {
    var_dump(foo("para"));
-} catch (Exception $e) {
+} catch (Throwable $e) {
     "caught exception" . PHP_EOL;
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
diff --git a/Zend/tests/try/try_finally_002.phpt b/Zend/tests/try/try_finally_002.phpt
index 99a34f62fbd7..a857f1e48a29 100644
--- a/Zend/tests/try/try_finally_002.phpt
+++ b/Zend/tests/try/try_finally_002.phpt
@@ -12,12 +12,12 @@ function foo () {
 
 try {
   foo();
-} catch (Exception $e) {
+} catch (Throwable $e) {
   do {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
   } while ($e = $e->getPrevious());
 }
 ?>
 --EXPECT--
-string(7) "finally"
-string(3) "try"
+Exception: finally
+Exception: try
diff --git a/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt b/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt
index 3f720ba2b47f..d1fee2ce2c42 100644
--- a/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt
+++ b/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt
@@ -11,10 +11,10 @@ set_error_handler(function($_, $msg) {
 
 try {
     test(0.5);
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Implicit conversion from float 0.5 to int loses precision
+Exception: Implicit conversion from float 0.5 to int loses precision
diff --git a/Zend/tests/type_coercion/gh22112.phpt b/Zend/tests/type_coercion/gh22112.phpt
index 84fdc393a828..68e097894b56 100644
--- a/Zend/tests/type_coercion/gh22112.phpt
+++ b/Zend/tests/type_coercion/gh22112.phpt
@@ -19,17 +19,17 @@ $nan = fdiv(0, 0);
 
 try {
     take_bool($nan);
-} catch (Exception $e) {
-    echo "bool: ", $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo 'bool: ', $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     take_string($nan);
-} catch (Exception $e) {
-    echo "string: ", $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo 'string: ', $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-bool: unexpected NAN value was coerced to bool
-string: unexpected NAN value was coerced to string
+bool: Exception: unexpected NAN value was coerced to bool
+string: Exception: unexpected NAN value was coerced to string
diff --git a/Zend/tests/type_coercion/settype/settype_resource.phpt b/Zend/tests/type_coercion/settype/settype_resource.phpt
index fa9ca739fa90..355b2362b85c 100644
--- a/Zend/tests/type_coercion/settype/settype_resource.phpt
+++ b/Zend/tests/type_coercion/settype/settype_resource.phpt
@@ -32,8 +32,8 @@ $vars = array(
 foreach ($vars as $var) {
     try {
         settype($var, "resource");
-    } catch (ValueError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
     var_dump($var);
 }
@@ -41,22 +41,22 @@ foreach ($vars as $var) {
 echo "Done\n";
 ?>
 --EXPECTF--
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 string(6) "string"
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 string(7) "8754456"
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 string(0) ""
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 string(1) "%0"
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 int(9876545)
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 float(0.1)
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 array(0) {
 }
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 array(3) {
   [0]=>
   int(1)
@@ -65,15 +65,15 @@ array(3) {
   [2]=>
   int(3)
 }
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 bool(false)
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 bool(true)
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 NULL
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 resource(%d) of type (stream)
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 object(test)#%d (0) {
 }
 Done
diff --git a/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt b/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt
index 17921e5ae530..73fea49fb208 100644
--- a/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt
+++ b/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt
@@ -18,4 +18,4 @@ var_dump($nan);
 --EXPECT--
 float(NAN)
 unexpected NAN value was coerced to string
-string(3) "NAN"
\ No newline at end of file
+string(3) "NAN"
diff --git a/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt b/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt
index 26911bddb7eb..64e1fc6ad056 100644
--- a/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt
+++ b/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt
@@ -7,12 +7,12 @@ try {
     assert(false && function () {
         (void) somefunc();
     });
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-assert(false && function () {
+AssertionError: assert(false && function () {
     (void)somefunc();
 })
diff --git a/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt b/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt
index 6375c60ab71b..72c2eb0f6d00 100644
--- a/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt
+++ b/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt
@@ -40,13 +40,13 @@ var_dump($o);
 
 try {
     bar1();
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     bar2();
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -59,5 +59,5 @@ object(B)#%d (0) {
 }
 object(B)#%d (0) {
 }
-bar1(): Return value must be of type (X&Y)|(W&Z), C returned
-bar2(): Return value must be of type (W&Z)|(X&Y), C returned
+TypeError: bar1(): Return value must be of type (X&Y)|(W&Z), C returned
+TypeError: bar2(): Return value must be of type (W&Z)|(X&Y), C returned
diff --git a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt
index e9089c130b49..e5eaed0fd63e 100644
--- a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt
+++ b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt
@@ -39,23 +39,23 @@ $test->prop2 = $n;
 $c = new C();
 try {
     $test->foo1($c);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->foo2($c);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop1 = $c;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop2 = $c;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -67,8 +67,8 @@ object(A)#2 (0) {
 }
 NULL
 NULL
-Test::foo1(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d
-Test::foo2(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d
-Cannot assign C to property Test::$prop1 of type (X&Y)|null
-Cannot assign C to property Test::$prop2 of type (X&Y)|null
+TypeError: Test::foo1(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d
+TypeError: Test::foo2(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d
+TypeError: Cannot assign C to property Test::$prop1 of type (X&Y)|null
+TypeError: Cannot assign C to property Test::$prop2 of type (X&Y)|null
 ===DONE===
diff --git a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt
index 4c9a5f95e30d..40c53e044dbd 100644
--- a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt
+++ b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt
@@ -60,43 +60,43 @@ $test->prop4 = $b;
 $c = new C();
 try {
     $test->foo1($c);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->foo2($c);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->bar1($c);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->bar2($c);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop1 = $c;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop2 = $c;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop3 = $c;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop4 = $c;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -116,12 +116,12 @@ object(B)#3 (0) {
 }
 object(B)#3 (0) {
 }
-Test::foo1(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d
-Test::foo2(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d
-Test::bar1(): Argument #1 ($v) must be of type B|(X&Y), C given, called in %s on line %d
-Test::bar2(): Argument #1 ($v) must be of type (X&Y)|B, C given, called in %s on line %d
-Cannot assign C to property Test::$prop1 of type (X&Y)|int
-Cannot assign C to property Test::$prop2 of type (X&Y)|int
-Cannot assign C to property Test::$prop3 of type (X&Y)|B
-Cannot assign C to property Test::$prop4 of type B|(X&Y)
+TypeError: Test::foo1(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d
+TypeError: Test::foo2(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d
+TypeError: Test::bar1(): Argument #1 ($v) must be of type B|(X&Y), C given, called in %s on line %d
+TypeError: Test::bar2(): Argument #1 ($v) must be of type (X&Y)|B, C given, called in %s on line %d
+TypeError: Cannot assign C to property Test::$prop1 of type (X&Y)|int
+TypeError: Cannot assign C to property Test::$prop2 of type (X&Y)|int
+TypeError: Cannot assign C to property Test::$prop3 of type (X&Y)|B
+TypeError: Cannot assign C to property Test::$prop4 of type B|(X&Y)
 ===DONE===
diff --git a/Zend/tests/type_declarations/dnf_types/gh9516.phpt b/Zend/tests/type_declarations/dnf_types/gh9516.phpt
index 3d91932ebd45..db400d2535c7 100644
--- a/Zend/tests/type_declarations/dnf_types/gh9516.phpt
+++ b/Zend/tests/type_declarations/dnf_types/gh9516.phpt
@@ -25,28 +25,28 @@ try {
     $t->method1(new A_);
     echo 'Fail', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method1(new B_);
     echo 'Fail', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method1(new AB_);
     echo 'Pass', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method1(new D_);
     echo 'Pass', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 // Lets try in reverse?
@@ -54,28 +54,28 @@ try {
     $t->method2(new A_);
     echo 'Fail', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method2(new B_);
     echo 'Fail', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method2(new AB_);
     echo 'Pass', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method2(new D_);
     echo 'Pass', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 /* Single before intersection */
@@ -83,28 +83,28 @@ try {
     $t->method3(new A_);
     echo 'Fail', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method3(new B_);
     echo 'Fail', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method3(new AB_);
     echo 'Pass', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method3(new D_);
     echo 'Pass', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 // Lets try in reverse?
@@ -112,46 +112,46 @@ try {
     $t->method4(new A_);
     echo 'Fail', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method4(new B_);
     echo 'Fail', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method4(new AB_);
     echo 'Pass', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 try {
     $t->method4(new D_);
     echo 'Pass', \PHP_EOL;
 } catch (\Throwable $throwable) {
-    echo $throwable->getMessage(), \PHP_EOL;
+    echo $throwable::class, ': ', $throwable->getMessage(), "\n";
 }
 
 
 ?>
 --EXPECTF--
-T::method1(): Argument #1 ($arg) must be of type (A&B)|D, A_ given, called in %s on line %d
-T::method1(): Argument #1 ($arg) must be of type (A&B)|D, B_ given, called in %s on line %d
+TypeError: T::method1(): Argument #1 ($arg) must be of type (A&B)|D, A_ given, called in %s on line %d
+TypeError: T::method1(): Argument #1 ($arg) must be of type (A&B)|D, B_ given, called in %s on line %d
 Pass
 Pass
-T::method2(): Argument #1 ($arg) must be of type (B&A)|D, A_ given, called in %s on line %d
-T::method2(): Argument #1 ($arg) must be of type (B&A)|D, B_ given, called in %s on line %d
+TypeError: T::method2(): Argument #1 ($arg) must be of type (B&A)|D, A_ given, called in %s on line %d
+TypeError: T::method2(): Argument #1 ($arg) must be of type (B&A)|D, B_ given, called in %s on line %d
 Pass
 Pass
-T::method3(): Argument #1 ($arg) must be of type D|(A&B), A_ given, called in %s on line %d
-T::method3(): Argument #1 ($arg) must be of type D|(A&B), B_ given, called in %s on line %d
+TypeError: T::method3(): Argument #1 ($arg) must be of type D|(A&B), A_ given, called in %s on line %d
+TypeError: T::method3(): Argument #1 ($arg) must be of type D|(A&B), B_ given, called in %s on line %d
 Pass
 Pass
-T::method4(): Argument #1 ($arg) must be of type D|(B&A), A_ given, called in %s on line %d
-T::method4(): Argument #1 ($arg) must be of type D|(B&A), B_ given, called in %s on line %d
+TypeError: T::method4(): Argument #1 ($arg) must be of type D|(B&A), A_ given, called in %s on line %d
+TypeError: T::method4(): Argument #1 ($arg) must be of type D|(B&A), B_ given, called in %s on line %d
 Pass
 Pass
diff --git a/Zend/tests/type_declarations/internal_function_strict_mode.phpt b/Zend/tests/type_declarations/internal_function_strict_mode.phpt
index 5b2ad90abfea..da9ce52ce163 100644
--- a/Zend/tests/type_declarations/internal_function_strict_mode.phpt
+++ b/Zend/tests/type_declarations/internal_function_strict_mode.phpt
@@ -7,29 +7,29 @@ declare(strict_types=1);
 echo "*** Trying Ord With Integer" . PHP_EOL;
 try {
     var_dump(ord(1));
-} catch (TypeError $e) {
-    echo "*** Caught " . $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 echo "*** Trying Array Map With Invalid Callback" . PHP_EOL;
 try {
     array_map([null, "bar"], []);
-} catch (TypeError $e) {
-    echo "*** Caught " . $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 echo "*** Trying Strlen With Float" . PHP_EOL;
 try {
     var_dump(strlen(1.5));
-} catch (TypeError $e) {
-    echo "*** Caught " . $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
 *** Trying Ord With Integer
-*** Caught ord(): Argument #1 ($character) must be of type string, int given
+TypeError: ord(): Argument #1 ($character) must be of type string, int given
 *** Trying Array Map With Invalid Callback
-*** Caught array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object
 *** Trying Strlen With Float
-*** Caught strlen(): Argument #1 ($string) must be of type string, float given
+TypeError: strlen(): Argument #1 ($string) must be of type string, float given
diff --git a/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt b/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt
index 568e6e25afad..7490bcd8434d 100644
--- a/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt
+++ b/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt
@@ -28,8 +28,8 @@ $tc = new TestChild();
 $o = new A();
 try {
     $o->prop = $tp;
-} catch (TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $o->prop = $tc;
@@ -46,7 +46,7 @@ var_dump($r);
 
 ?>
 --EXPECTF--
-Cannot assign TestParent to property A::$prop of type X&Y&Z
+TypeError: Cannot assign TestParent to property A::$prop of type X&Y&Z
 object(TestChild)#%d (0) {
 }
 object(TestParent)#%d (0) {
diff --git a/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt b/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt
index 83af5e96ccfa..c268720d4c2a 100644
--- a/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt
+++ b/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt
@@ -9,11 +9,11 @@ function foo(X&Y $foo = null) {
 
 try {
     foo(5);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
 Deprecated: foo(): Implicitly marking parameter $foo as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d
-foo(): Argument #1 ($foo) must be of type (X&Y)|null, int given, called in %s on line %d
+TypeError: foo(): Argument #1 ($foo) must be of type (X&Y)|null, int given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt b/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt
index e724e1b15f50..5123be36f130 100644
--- a/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt
+++ b/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt
@@ -24,8 +24,8 @@ function bar(X&Y $o): void {
 try {
     $o = foo();
     var_dump($o);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $c = new Collection();
@@ -33,18 +33,18 @@ $a = new A();
 
 try {
     $c->intersect = $a;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     bar($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
-foo(): Return value must be of type X&Y, A returned
-Cannot assign A to property Collection::$intersect of type X&Y
-bar(): Argument #1 ($o) must be of type X&Y, A given, called in %s on line %d
+TypeError: foo(): Return value must be of type X&Y, A returned
+TypeError: Cannot assign A to property Collection::$intersect of type X&Y
+TypeError: bar(): Argument #1 ($o) must be of type X&Y, A given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/intersection_types/parameter.phpt b/Zend/tests/type_declarations/intersection_types/parameter.phpt
index d1c7de224365..2de2d5b91edc 100644
--- a/Zend/tests/type_declarations/intersection_types/parameter.phpt
+++ b/Zend/tests/type_declarations/intersection_types/parameter.phpt
@@ -17,12 +17,12 @@ foo(new Foo());
 
 try {
     foo(new Bar());
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
 object(Foo)#1 (0) {
 }
-foo(): Argument #1 ($bar) must be of type A&B, Bar given, called in %s on line %d
+TypeError: foo(): Argument #1 ($bar) must be of type A&B, Bar given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/intersection_types/typed_reference.phpt b/Zend/tests/type_declarations/intersection_types/typed_reference.phpt
index 2ceb34f256ff..b16dfad4025b 100644
--- a/Zend/tests/type_declarations/intersection_types/typed_reference.phpt
+++ b/Zend/tests/type_declarations/intersection_types/typed_reference.phpt
@@ -21,10 +21,10 @@ $test->z =& $r;
 
 try {
     $r = new B;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot assign B to reference held by property Test::$z of type X&Z
+TypeError: Cannot assign B to reference held by property Test::$z of type X&Z
diff --git a/Zend/tests/type_declarations/iterable/iterable_001.phpt b/Zend/tests/type_declarations/iterable/iterable_001.phpt
index 7c127c8e1dfd..c264908fbb54 100644
--- a/Zend/tests/type_declarations/iterable/iterable_001.phpt
+++ b/Zend/tests/type_declarations/iterable/iterable_001.phpt
@@ -20,7 +20,7 @@ test(new ArrayIterator([1, 2, 3]));
 try {
     test(1);
 } catch (Throwable $e) {
-    echo $e->getMessage();
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
@@ -47,4 +47,4 @@ object(ArrayIterator)#1 (1) {
     int(3)
   }
 }
-test(): Argument #1 ($iterable) must be of type Traversable|array, int given, called in %s on line %d
+TypeError: test(): Argument #1 ($iterable) must be of type Traversable|array, int given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/iterable/iterable_003.phpt b/Zend/tests/type_declarations/iterable/iterable_003.phpt
index a2c96995da37..978f177fc4b4 100644
--- a/Zend/tests/type_declarations/iterable/iterable_003.phpt
+++ b/Zend/tests/type_declarations/iterable/iterable_003.phpt
@@ -20,7 +20,7 @@ var_dump(bar());
 try {
     baz();
 } catch (Throwable $e) {
-    echo $e->getMessage();
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -31,4 +31,4 @@ object(Generator)#%d (1) {
   ["function"]=>
   string(17) "{closure:bar():7}"
 }
-baz(): Return value must be of type Traversable|array, int returned
+TypeError: baz(): Return value must be of type Traversable|array, int returned
diff --git a/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt b/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt
index 61900f993c0e..86eb1aee258a 100644
--- a/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt
+++ b/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt
@@ -7,22 +7,22 @@ function test(false $v) { var_dump($v); }
 
 try {
     test(0);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     test('');
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     test([]);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
-test(): Argument #1 ($v) must be of type false, int given, called in %s on line %d
-test(): Argument #1 ($v) must be of type false, string given, called in %s on line %d
-test(): Argument #1 ($v) must be of type false, array given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type false, int given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type false, string given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type false, array given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt b/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt
index 726245705ffc..34480f91f1e2 100644
--- a/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt
+++ b/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt
@@ -21,11 +21,11 @@ $c = new C();
 var_dump($p->foo(0));
 try {
     var_dump($c->foo(0));
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
 bool(false)
-C::foo(): Return value must be of type array|false, int returned
+TypeError: C::foo(): Return value must be of type array|false, int returned
diff --git a/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt b/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt
index 85d6c90cd057..72e9ae889802 100644
--- a/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt
+++ b/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt
@@ -7,28 +7,28 @@ function test(true $v) { var_dump($v); }
 
 try {
     test(1);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     test('1');
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     test([1]);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     test(new stdClass());
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
-test(): Argument #1 ($v) must be of type true, int given, called in %s on line %d
-test(): Argument #1 ($v) must be of type true, string given, called in %s on line %d
-test(): Argument #1 ($v) must be of type true, array given, called in %s on line %d
-test(): Argument #1 ($v) must be of type true, stdClass given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type true, int given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type true, string given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type true, array given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type true, stdClass given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt b/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt
index 7eebe1e3571f..a0ed9bf12d82 100644
--- a/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt
+++ b/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt
@@ -21,11 +21,11 @@ $c = new C();
 var_dump($p->foo(1));
 try {
     var_dump($c->foo(1));
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
 bool(true)
-C::foo(): Return value must be of type array|true, int returned
+TypeError: C::foo(): Return value must be of type array|true, int returned
diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt
index 8a2c60002054..edd4d59f580e 100644
--- a/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt
+++ b/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt
@@ -27,10 +27,10 @@ $foo = new Foo();
 
 try {
     $foo->property1;
-} catch (Error $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Typed property Foo::$property1 must not be accessed before initialization
+Error: Typed property Foo::$property1 must not be accessed before initialization
diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt
index e83023d54cf2..720e9cdc13af 100644
--- a/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt
+++ b/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt
@@ -26,10 +26,10 @@ $foo = new Foo();
 
 try {
     $foo->property1;
-} catch (Error $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Typed property Foo::$property1 must not be accessed before initialization
+Error: Typed property Foo::$property1 must not be accessed before initialization
diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt
index 2bd775af0a47..7712f5e3a0e4 100644
--- a/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt
+++ b/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt
@@ -10,10 +10,10 @@ function foo(): mixed
 
 try {
     foo();
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-foo(): Return value must be of type mixed, none returned
+TypeError: foo(): Return value must be of type mixed, none returned
diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt
index 52bd99beb6cd..2e5efe16baae 100644
--- a/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt
+++ b/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt
@@ -9,10 +9,10 @@ function foo(): mixed
 
 try {
     foo();
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-foo(): Return value must be of type mixed, none returned
+TypeError: foo(): Return value must be of type mixed, none returned
diff --git a/Zend/tests/type_declarations/scalar_basic.phpt b/Zend/tests/type_declarations/scalar_basic.phpt
index 352c48f8a9e0..e6559a941742 100644
--- a/Zend/tests/type_declarations/scalar_basic.phpt
+++ b/Zend/tests/type_declarations/scalar_basic.phpt
@@ -52,8 +52,8 @@ foreach ($functions as $type => $function) {
         var_dump($value);
         try {
             var_dump($function($value));
-        } catch (\TypeError $e) {
-            echo "*** Caught " . $e->getMessage() . PHP_EOL;
+        } catch (\Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
@@ -76,19 +76,19 @@ E_DEPRECATED: Implicit conversion from float 1.5 to int loses precision on line
 int(1)
 
 *** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
 
 *** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
 
 *** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
 
 *** Trying int(%d)
 int(%d)
 
 *** Trying float(NAN)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
 
 *** Trying bool(true)
 int(1)
@@ -97,22 +97,22 @@ int(1)
 int(0)
 
 *** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
 
 *** Trying array(0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
 
 *** Trying object(stdClass)#%s (0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
 
 *** Trying object(StringCapable)#%s (0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d
 
 *** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
 
 Testing 'float' type:
 
@@ -129,13 +129,13 @@ float(1)
 float(1.5)
 
 *** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
 
 *** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
 
 *** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
 
 *** Trying int(%d)
 float(%s)
@@ -150,22 +150,22 @@ float(1)
 float(0)
 
 *** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
 
 *** Trying array(0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
 
 *** Trying object(stdClass)#%s (0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
 
 *** Trying object(StringCapable)#%s (0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d
 
 *** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
 
 Testing 'string' type:
 
@@ -204,22 +204,22 @@ string(1) "1"
 string(0) ""
 
 *** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
 
 *** Trying array(0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
 
 *** Trying object(stdClass)#%s (0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
 
 *** Trying object(StringCapable)#%s (0) {
 }
 string(6) "foobar"
 
 *** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
 
 Testing 'bool' type:
 
@@ -258,21 +258,21 @@ bool(true)
 bool(false)
 
 *** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
 
 *** Trying array(0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
 
 *** Trying object(stdClass)#%s (0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
 
 *** Trying object(StringCapable)#%s (0) {
 }
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d
 
 *** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
 
 Done
diff --git a/Zend/tests/type_declarations/scalar_constant_defaults.phpt b/Zend/tests/type_declarations/scalar_constant_defaults.phpt
index 5e3826de7dcb..10dbab93e7aa 100644
--- a/Zend/tests/type_declarations/scalar_constant_defaults.phpt
+++ b/Zend/tests/type_declarations/scalar_constant_defaults.phpt
@@ -64,15 +64,15 @@ var_dump(string_add_val());
 echo "Testing int with default null constant" . PHP_EOL;
 try {
     var_dump(int_val_default_null());
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 echo "Testing int with null null constant" . PHP_EOL;
 try {
     var_dump(int_val_default_null(null));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 echo "Testing nullable int with default null constant" . PHP_EOL;
@@ -96,9 +96,9 @@ float(10.7)
 Testing string add val
 string(14) "this is a test"
 Testing int with default null constant
-int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d
+TypeError: int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d
 Testing int with null null constant
-int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d
+TypeError: int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d
 Testing nullable int with default null constant
 NULL
 Testing nullable int with null null constant
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.