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

[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:18:48+01:00

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

Zend: applied fixers to improve test robustness (part 4/8) (#23312)

Changed paths:
  M  Zend/tests/function_arguments/variadic_argument_type_error.phpt
  M  Zend/tests/gc/bug54305.phpt
  M  Zend/tests/gc/bug80072.phpt
  M  Zend/tests/generators/bug79927.phpt
  M  Zend/tests/generators/dynamic_properties.phpt
  M  Zend/tests/generators/errors/count_error.phpt
  M  Zend/tests/generators/errors/resume_running_generator_error.phpt
  M  Zend/tests/generators/errors/resume_running_generator_error_002.phpt
  M  Zend/tests/generators/generator_throwing_during_function_call.phpt
  M  Zend/tests/generators/generator_throwing_exception.phpt
  M  Zend/tests/generators/generator_with_type_check_2.phpt
  M  Zend/tests/generators/get_return_and_finally.phpt
  M  Zend/tests/generators/get_return_errors.phpt
  M  Zend/tests/generators/gh11028_1.phpt
  M  Zend/tests/generators/gh11028_3.phpt
  M  Zend/tests/generators/throw_into_yield_from_array.phpt
  M  Zend/tests/generators/yield_from_non_iterable.phpt
  M  Zend/tests/generators/yield_from_valid_exception.phpt
  M  Zend/tests/get_called_class_001.phpt
  M  Zend/tests/get_class_basic.phpt
  M  Zend/tests/get_class_vars/get_class_vars_001.phpt
  M  Zend/tests/get_parent_class_basic.phpt
  M  Zend/tests/gh10169.phpt
  M  Zend/tests/gh10497_non_object.phpt
  M  Zend/tests/gh10634.phpt
  M  Zend/tests/gh12102_1.phpt
  M  Zend/tests/gh12102_3.phpt
  M  Zend/tests/gh14969.phpt
  M  Zend/tests/gh17162.phpt
  M  Zend/tests/gh18736.phpt
  M  Zend/tests/gh19304.phpt
  M  Zend/tests/gh19306.phpt
  M  Zend/tests/gh19326.phpt
  M  Zend/tests/gh19719.phpt
  M  Zend/tests/gh20564.phpt
  M  Zend/tests/gh23088.phpt
  M  Zend/tests/gh418106144.phpt
  M  Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt
  M  Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt
  M  Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt
  M  Zend/tests/global_to_string_exception.phpt
  M  Zend/tests/illegal_offset_unset_isset_empty.phpt
  M  Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt
  M  Zend/tests/in-de-crement/incdec_bool_exception.phpt
  M  Zend/tests/in-de-crement/incdec_strings_exception.phpt
  M  Zend/tests/in-de-crement/incdec_types.phpt
  M  Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt
  M  Zend/tests/in-de-crement/object_cannot_incdec.phpt
  M  Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt
  M  Zend/tests/in-de-crement/oss_fuzz_63802.phpt
  M  Zend/tests/in-de-crement/overloaded_access.phpt
  M  Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt
  M  Zend/tests/incompat_ctx_user.phpt
  M  Zend/tests/indexing_001.phpt
  M  Zend/tests/indirect_function_call/indirect_call_array_003.phpt
  M  Zend/tests/indirect_function_call/indirect_call_array_004.phpt
  M  Zend/tests/indirect_function_call/indirect_call_string_002.phpt
  M  Zend/tests/indirect_function_call/indirect_method_call_001.phpt
  M  Zend/tests/init_array_illegal_offset_type.phpt
  M  Zend/tests/int_static_prop_name.phpt
  M  Zend/tests/invalid_parent_const_ref_leak.phpt
  M  Zend/tests/isset/isset_array.phpt
  M  Zend/tests/lazy_objects/rfc/rfc_example_006.phpt
  M  Zend/tests/lazy_objects/typed_properties_001.phpt
  M  Zend/tests/live_range_phi_leak.phpt
  M  Zend/tests/magic_methods/bug26166.phpt
  M  Zend/tests/magic_methods/bug29368_2.phpt
  M  Zend/tests/magic_methods/bug45186.phpt
  M  Zend/tests/magic_methods/bug45186_2.phpt
  M  Zend/tests/magic_methods/bug76667.phpt
  M  Zend/tests/match/043.phpt
  M  Zend/tests/match/045.phpt
  M  Zend/tests/match/048.phpt
  M  Zend/tests/match/049.phpt
  M  Zend/tests/match/unmatched_enum.phpt
  M  Zend/tests/methods-on-non-objects-call-user-func.phpt
  M  Zend/tests/methods-on-non-objects-catch.phpt
  M  Zend/tests/methods-on-non-objects-usort.phpt
  M  Zend/tests/mod_001.phpt
  M  Zend/tests/mul_001.phpt
  M  Zend/tests/named_params/__invoke.phpt
  M  Zend/tests/named_params/assert.phpt
  M  Zend/tests/named_params/attributes.phpt
  M  Zend/tests/named_params/call_user_func.phpt
  M  Zend/tests/named_params/call_user_func_array.phpt


Diff:

diff --git a/Zend/tests/function_arguments/variadic_argument_type_error.phpt b/Zend/tests/function_arguments/variadic_argument_type_error.phpt
index 9041aadcadfd..eb602deaa723 100644
--- a/Zend/tests/function_arguments/variadic_argument_type_error.phpt
+++ b/Zend/tests/function_arguments/variadic_argument_type_error.phpt
@@ -7,17 +7,17 @@ function foo($foo, int ...$bar) {}
 
 try {
     foo(1, []);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 try {
     foo(1, 1, 1, []);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
-foo(): Argument #2 must be of type int, array given, called in %s on line %d
-foo(): Argument #4 must be of type int, array given, called in %s on line %d
+TypeError: foo(): Argument #2 must be of type int, array given, called in %s on line %d
+TypeError: foo(): Argument #4 must be of type int, array given, called in %s on line %d
diff --git a/Zend/tests/gc/bug54305.phpt b/Zend/tests/gc/bug54305.phpt
index 61e351306f78..36f3f898d95c 100644
--- a/Zend/tests/gc/bug54305.phpt
+++ b/Zend/tests/gc/bug54305.phpt
@@ -11,9 +11,9 @@ abstract class AbstractClass {
 $methodWithArgs = new ReflectionMethod('TestClass', 'methodWithArgs');
 try {
     echo $methodWithArgs++;
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Cannot increment ReflectionMethod
+TypeError: Cannot increment ReflectionMethod
diff --git a/Zend/tests/gc/bug80072.phpt b/Zend/tests/gc/bug80072.phpt
index d7bf1956cf60..a03bda77fbc9 100644
--- a/Zend/tests/gc/bug80072.phpt
+++ b/Zend/tests/gc/bug80072.phpt
@@ -6,12 +6,12 @@ Bug #80072: Cyclic unserialize in TMPVAR operand may leak
 try {
     $s = 'O:8:"stdClass":1:{s:1:"x";r:1;}';
     unserialize($s) % gc_collect_cycles();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $a[]=&$a == $a=&$b > gc_collect_cycles();
 
 ?>
 --EXPECT--
-Unsupported operand types: stdClass % int
+TypeError: Unsupported operand types: stdClass % int
diff --git a/Zend/tests/generators/bug79927.phpt b/Zend/tests/generators/bug79927.phpt
index df8f245ddfde..3b127a6ce510 100644
--- a/Zend/tests/generators/bug79927.phpt
+++ b/Zend/tests/generators/bug79927.phpt
@@ -11,8 +11,8 @@ $generator->next();
 $generator->next();
 try {
     $generator->rewind();
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo $generator->current(), "\n";
 
@@ -26,6 +26,6 @@ echo $generator2->current(), "\n";
 
 ?>
 --EXPECT--
-Cannot rewind a generator that was already run
+Exception: Cannot rewind a generator that was already run
 3
 4
diff --git a/Zend/tests/generators/dynamic_properties.phpt b/Zend/tests/generators/dynamic_properties.phpt
index 08ceb7f581c6..6fb6bcefbf38 100644
--- a/Zend/tests/generators/dynamic_properties.phpt
+++ b/Zend/tests/generators/dynamic_properties.phpt
@@ -10,10 +10,10 @@ function gen() {
 $gen = gen();
 try {
     $gen->prop = new stdClass;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot create dynamic property Generator::$prop
+Error: Cannot create dynamic property Generator::$prop
diff --git a/Zend/tests/generators/errors/count_error.phpt b/Zend/tests/generators/errors/count_error.phpt
index 03ca1eed6032..e912376c056d 100644
--- a/Zend/tests/generators/errors/count_error.phpt
+++ b/Zend/tests/generators/errors/count_error.phpt
@@ -9,10 +9,10 @@ $gen = gen();
 
 try {
     count($gen);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-count(): Argument #1 ($value) must be of type Countable|array, Generator given
+TypeError: count(): Argument #1 ($value) must be of type Countable|array, Generator given
diff --git a/Zend/tests/generators/errors/resume_running_generator_error.phpt b/Zend/tests/generators/errors/resume_running_generator_error.phpt
index 53e8611cf36c..c1a62dd75751 100644
--- a/Zend/tests/generators/errors/resume_running_generator_error.phpt
+++ b/Zend/tests/generators/errors/resume_running_generator_error.phpt
@@ -7,8 +7,8 @@ function gen() {
     $gen = yield;
     try {
         $gen->next();
-    } catch (Error $e) {
-        echo "\nException: " . $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     $gen->next();
 }
@@ -19,7 +19,7 @@ $gen->next();
 
 ?>
 --EXPECTF--
-Exception: Cannot resume an already running generator
+Error: Cannot resume an already running generator
 
 Fatal error: Uncaught Error: Cannot resume an already running generator in %s:%d
 Stack trace:
diff --git a/Zend/tests/generators/errors/resume_running_generator_error_002.phpt b/Zend/tests/generators/errors/resume_running_generator_error_002.phpt
index e71e32a886dc..8b0debf3bf8a 100644
--- a/Zend/tests/generators/errors/resume_running_generator_error_002.phpt
+++ b/Zend/tests/generators/errors/resume_running_generator_error_002.phpt
@@ -10,8 +10,8 @@ $gen = gen();
 try {
     $gen->send($gen);
 } catch (Throwable $e) {
-    echo $e->getMessage() . "\n";	
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Cannot resume an already running generator
+Error: Cannot resume an already running generator
diff --git a/Zend/tests/generators/generator_throwing_during_function_call.phpt b/Zend/tests/generators/generator_throwing_during_function_call.phpt
index bd0d2448b7d8..885251f58381 100644
--- a/Zend/tests/generators/generator_throwing_during_function_call.phpt
+++ b/Zend/tests/generators/generator_throwing_during_function_call.phpt
@@ -19,8 +19,8 @@ var_dump($gen->current());
 
 try {
     $gen->next();
-} catch (Exception $e) {
-    echo 'Caught exception with message "', $e->getMessage(), '"', "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 var_dump($gen->current());
@@ -28,5 +28,5 @@ var_dump($gen->current());
 ?>
 --EXPECT--
 string(3) "foo"
-Caught exception with message "test"
+Exception: test
 NULL
diff --git a/Zend/tests/generators/generator_throwing_exception.phpt b/Zend/tests/generators/generator_throwing_exception.phpt
index f537c3fc7726..48cdfa9eda82 100644
--- a/Zend/tests/generators/generator_throwing_exception.phpt
+++ b/Zend/tests/generators/generator_throwing_exception.phpt
@@ -15,8 +15,8 @@ var_dump($gen->current());
 
 try {
     $gen->next();
-} catch (Exception $e) {
-    echo 'Caught exception with message "', $e->getMessage(), '"', "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 var_dump($gen->current());
@@ -24,5 +24,5 @@ var_dump($gen->current());
 ?>
 --EXPECT--
 string(3) "foo"
-Caught exception with message "test"
+Exception: test
 NULL
diff --git a/Zend/tests/generators/generator_with_type_check_2.phpt b/Zend/tests/generators/generator_with_type_check_2.phpt
index 21e8ab8bedc0..d1b8bb6798d8 100644
--- a/Zend/tests/generators/generator_with_type_check_2.phpt
+++ b/Zend/tests/generators/generator_with_type_check_2.phpt
@@ -5,18 +5,18 @@ Generator wit type check
 function gen(array $a) { yield; }
 try {
     gen(42);
-} catch (TypeError $e) {
-    echo $e->getMessage()."\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     foreach (gen(42) as $val) {
         var_dump($val);
     }
-} catch (TypeError $e) {
-        echo $e->getMessage()."\n";
+} catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
-gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d
-gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d
+TypeError: gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d
+TypeError: gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d
diff --git a/Zend/tests/generators/get_return_and_finally.phpt b/Zend/tests/generators/get_return_and_finally.phpt
index 8ced4d0008b5..4892075f4d77 100644
--- a/Zend/tests/generators/get_return_and_finally.phpt
+++ b/Zend/tests/generators/get_return_and_finally.phpt
@@ -30,19 +30,19 @@ try {
     // This will throw an exception (from the finally)
     // during auto-priming, so fails
     var_dump($gen->getReturn());
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     // This fails, because the return value was discarded
     var_dump($gen->getReturn());
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
 Deprecated: Returning from a finally block is deprecated in %s on line %d
 int(42)
-gen2() throw
-Cannot get return value of a generator that hasn't returned
+Exception: gen2() throw
+Exception: Cannot get return value of a generator that hasn't returned
diff --git a/Zend/tests/generators/get_return_errors.phpt b/Zend/tests/generators/get_return_errors.phpt
index f8d50aa3ded2..9db84883e274 100644
--- a/Zend/tests/generators/get_return_errors.phpt
+++ b/Zend/tests/generators/get_return_errors.phpt
@@ -13,8 +13,8 @@ $gen = gen1();
 try {
     // Generator hasn't reached the "return" yet
     $gen->getReturn();
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 function gen2() {
@@ -26,14 +26,14 @@ function gen2() {
 $gen = gen2();
 try {
     $gen->next();
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     // Generator has been aborted as a result of an exception
     $gen->getReturn();
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 function gen3() {
@@ -46,8 +46,8 @@ $gen = gen3();
 try {
     // Generator throws during auto-priming of getReturn() call
     $gen->getReturn();
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 function gen4() {
@@ -58,22 +58,22 @@ function gen4() {
 $gen = gen4();
 try {
     $gen->throw(new Exception("gen4() throw"));
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     // Generator has been aborted as a result of an exception
     // that was injected using throw()
     $gen->getReturn();
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot get return value of a generator that hasn't returned
-gen2() throw
-Cannot get return value of a generator that hasn't returned
-gen3() throw
-gen4() throw
-Cannot get return value of a generator that hasn't returned
+Exception: Cannot get return value of a generator that hasn't returned
+Exception: gen2() throw
+Exception: Cannot get return value of a generator that hasn't returned
+Exception: gen3() throw
+Exception: gen4() throw
+Exception: Cannot get return value of a generator that hasn't returned
diff --git a/Zend/tests/generators/gh11028_1.phpt b/Zend/tests/generators/gh11028_1.phpt
index d1c07dc9de66..7bd6f1ce3890 100644
--- a/Zend/tests/generators/gh11028_1.phpt
+++ b/Zend/tests/generators/gh11028_1.phpt
@@ -15,7 +15,7 @@ function test($msg, $x) {
     try {
         var_dump([...generator($x)]);
     } catch (Throwable $e) {
-        echo $e->getMessage(), "\n";
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 
@@ -27,10 +27,10 @@ test("object", new stdClass);
 --EXPECTF--
 Deprecated: Returning from a finally block is deprecated in %s on line %d
 yield null
-Keys must be of type int|string during array unpacking
+Error: Keys must be of type int|string during array unpacking
 yield false
-Keys must be of type int|string during array unpacking
+Error: Keys must be of type int|string during array unpacking
 yield true
-Keys must be of type int|string during array unpacking
+Error: Keys must be of type int|string during array unpacking
 yield object
-Keys must be of type int|string during array unpacking
+Error: Keys must be of type int|string during array unpacking
diff --git a/Zend/tests/generators/gh11028_3.phpt b/Zend/tests/generators/gh11028_3.phpt
index c58e00dc09b1..d5eee0cfaad3 100644
--- a/Zend/tests/generators/gh11028_3.phpt
+++ b/Zend/tests/generators/gh11028_3.phpt
@@ -14,9 +14,9 @@ function generator() {
 try {
     var_dump([...generator()]);
 } catch (Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Deprecated: Returning from a finally block is deprecated in %s on line %d
-exception
+Exception: exception
diff --git a/Zend/tests/generators/throw_into_yield_from_array.phpt b/Zend/tests/generators/throw_into_yield_from_array.phpt
index aa9fa822061b..5cef784dfce4 100644
--- a/Zend/tests/generators/throw_into_yield_from_array.phpt
+++ b/Zend/tests/generators/throw_into_yield_from_array.phpt
@@ -19,8 +19,8 @@ function test($g) {
     var_dump($g->current());
     try {
         $g->throw(new Exception("Exception!"));
-    } catch (Exception $e) {
-        echo "{$e->getMessage()}\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump($g->current());
 }
@@ -35,9 +35,9 @@ test(yf(yielditer($data)));
 ?>
 --EXPECT--
 int(1)
-Exception!
+Exception: Exception!
 NULL
 
 int(1)
-Exception!
+Exception: Exception!
 NULL
diff --git a/Zend/tests/generators/yield_from_non_iterable.phpt b/Zend/tests/generators/yield_from_non_iterable.phpt
index 705bcaec3511..7b1d21afbe77 100644
--- a/Zend/tests/generators/yield_from_non_iterable.phpt
+++ b/Zend/tests/generators/yield_from_non_iterable.phpt
@@ -9,10 +9,10 @@ function gen() {
 
 try {
     gen()->current();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Can use "yield from" only with arrays and Traversables
+Error: Can use "yield from" only with arrays and Traversables
diff --git a/Zend/tests/generators/yield_from_valid_exception.phpt b/Zend/tests/generators/yield_from_valid_exception.phpt
index 0df541499cae..2ae43e9ad592 100644
--- a/Zend/tests/generators/yield_from_valid_exception.phpt
+++ b/Zend/tests/generators/yield_from_valid_exception.phpt
@@ -17,8 +17,8 @@ function gen() {
     try {
         // the fact that the yield from result is used is relevant.
         var_dump(yield from new FooBar);
-    } catch (Exception $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 
@@ -27,4 +27,4 @@ $x->current();
 
 ?>
 --EXPECT--
-Exception from valid()
+Exception: Exception from valid()
diff --git a/Zend/tests/get_called_class_001.phpt b/Zend/tests/get_called_class_001.phpt
index caa6d154d9c5..d9a6a090e305 100644
--- a/Zend/tests/get_called_class_001.phpt
+++ b/Zend/tests/get_called_class_001.phpt
@@ -5,10 +5,10 @@ Calling get_called_class() outside a class
 
 try {
     var_dump(get_called_class());
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-get_called_class() must be called from within a class
+Error: get_called_class() must be called from within a class
diff --git a/Zend/tests/get_class_basic.phpt b/Zend/tests/get_class_basic.phpt
index f6dcbccb6916..bcdfeb22df91 100644
--- a/Zend/tests/get_class_basic.phpt
+++ b/Zend/tests/get_class_basic.phpt
@@ -11,8 +11,8 @@ class foo {
     {
         try {
             var_dump(get_class(null));
-        } catch (TypeError $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
@@ -28,8 +28,8 @@ set_error_handler(function ($severity, $message, $file, $line) {
 });
 try {
     $f1->bar();
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 set_error_handler(null);
 
@@ -37,13 +37,13 @@ $f2->bar();
 
 try {
     var_dump(get_class());
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(get_class("qwerty"));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 var_dump(get_class($f1));
@@ -54,13 +54,13 @@ $f1->testNull();
 echo "Done\n";
 ?>
 --EXPECTF--
-Calling get_class() without arguments is deprecated
+Exception: Calling get_class() without arguments is deprecated
 
 Deprecated: Calling get_class() without arguments is deprecated in %s on line %d
 string(3) "foo"
-get_class() without arguments must be called from within a class
-get_class(): Argument #1 ($object) must be of type object, string given
+Error: get_class() without arguments must be called from within a class
+TypeError: get_class(): Argument #1 ($object) must be of type object, string given
 string(3) "foo"
 string(4) "foo2"
-get_class(): Argument #1 ($object) must be of type object, null given
+TypeError: get_class(): Argument #1 ($object) must be of type object, null given
 Done
diff --git a/Zend/tests/get_class_vars/get_class_vars_001.phpt b/Zend/tests/get_class_vars/get_class_vars_001.phpt
index a884409121c6..1f514b4aee3b 100644
--- a/Zend/tests/get_class_vars/get_class_vars_001.phpt
+++ b/Zend/tests/get_class_vars/get_class_vars_001.phpt
@@ -21,8 +21,8 @@ var_dump(get_class_vars('B'));
 
 try {
     get_class_vars("Unknown");
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -37,4 +37,4 @@ array(2) {
   ["aa"]=>
   int(4)
 }
-get_class_vars(): Argument #1 ($class) must be a valid class name, "Unknown" given
+TypeError: get_class_vars(): Argument #1 ($class) must be a valid class name, "Unknown" given
diff --git a/Zend/tests/get_parent_class_basic.phpt b/Zend/tests/get_parent_class_basic.phpt
index 8eabd64ca455..12071196d7ae 100644
--- a/Zend/tests/get_parent_class_basic.phpt
+++ b/Zend/tests/get_parent_class_basic.phpt
@@ -27,8 +27,8 @@ set_error_handler(function ($severity, $message, $file, $line) {
 });
 try {
     $foo->test();
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 set_error_handler(null);
 
@@ -44,40 +44,40 @@ var_dump(get_parent_class("i"));
 
 try {
     get_parent_class("");
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 try {
     get_parent_class("[[[[");
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 try {
     get_parent_class(" ");
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 var_dump(get_parent_class(new stdclass));
 
 try {
     get_parent_class(array());
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 try {
     get_parent_class(1);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 echo "Done\n";
 ?>
 --EXPECTF--
-Calling get_parent_class() without arguments is deprecated
+Exception: Calling get_parent_class() without arguments is deprecated
 
 Deprecated: Calling get_parent_class() without arguments is deprecated in %s on line %d
 bool(false)
@@ -90,10 +90,10 @@ bool(false)
 string(3) "foo"
 bool(false)
 bool(false)
-get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, "" given
-get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, "[[[[" given
-get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, " " given
+TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, "" given
+TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, "[[[[" given
+TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, " " given
 bool(false)
-get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given
-get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given
+TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given
+TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given
 Done
diff --git a/Zend/tests/gh10169.phpt b/Zend/tests/gh10169.phpt
index 674122ac5935..44f62b7dcd53 100644
--- a/Zend/tests/gh10169.phpt
+++ b/Zend/tests/gh10169.phpt
@@ -19,19 +19,19 @@ class B
 $a = new A();
 try {
     $a->prop = new B();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $a = new A();
 $a->prop = '';
 try {
     $a->prop = new B();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Object was released while assigning to property A::$prop
-Object was released while assigning to property A::$prop
+Error: Object was released while assigning to property A::$prop
+Error: Object was released while assigning to property A::$prop
diff --git a/Zend/tests/gh10497_non_object.phpt b/Zend/tests/gh10497_non_object.phpt
index 546e9718443d..837fdf827c4b 100644
--- a/Zend/tests/gh10497_non_object.phpt
+++ b/Zend/tests/gh10497_non_object.phpt
@@ -5,20 +5,20 @@ GH-10497: Writing to a property of a non-object constant reports a runtime error
 
 try {
     TRUE->prop = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     NULL->prop = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     PHP_INT_MAX->prop = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 class C {
@@ -33,47 +33,47 @@ class C {
 
 try {
     C::INT->prop = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     C::STR->prop = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     C::ARR->prop = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     C::fromSelf();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 // Other write contexts: compound assignment, unset() and by-reference arguments.
 try {
     C::INT->prop++;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     C::INT->prop .= 'x';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 function byRef(&$v) {}
 
 try {
     byRef(C::INT->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 // As for plain variables, unsetting a property of a non-object is a silent no-op.
@@ -85,27 +85,27 @@ var_dump(isset(C::INT->prop));
 
 try {
     __COMPILER_HALT_OFFSET__->prop = 1;
-} catch (Error $e) {
-    echo $e::class, $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 __halt_compiler();
 
 ?>
 --EXPECT--
-Attempt to assign property "prop" on true
-Attempt to assign property "prop" on null
-Attempt to assign property "prop" on int
-Attempt to assign property "prop" on int
-Attempt to assign property "prop" on string
-Attempt to assign property "prop" on array
-Attempt to assign property "prop" on int
-Attempt to increment/decrement property "prop" on int
-Attempt to assign property "prop" on int
-Attempt to modify property "prop" on int
+Error: Attempt to assign property "prop" on true
+Error: Attempt to assign property "prop" on null
+Error: Attempt to assign property "prop" on int
+Error: Attempt to assign property "prop" on int
+Error: Attempt to assign property "prop" on string
+Error: Attempt to assign property "prop" on array
+Error: Attempt to assign property "prop" on int
+Error: Attempt to increment/decrement property "prop" on int
+Error: Attempt to assign property "prop" on int
+Error: Attempt to modify property "prop" on int
 unset() did not error
 bool(true)
 int(5)
 string(3) "str"
 bool(false)
-ErrorAttempt to assign property "prop" on int
+Error: Attempt to assign property "prop" on int
diff --git a/Zend/tests/gh10634.phpt b/Zend/tests/gh10634.phpt
index 41407bf307d7..cd36411b3792 100644
--- a/Zend/tests/gh10634.phpt
+++ b/Zend/tests/gh10634.phpt
@@ -6,7 +6,7 @@ function test_input($input) {
     try {
         eval($input);
     } catch(Throwable $e) {
-        var_dump($e->getMessage());
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 
@@ -17,8 +17,8 @@ test_input("y&#  ");
 test_input("y&//");
 ?>
 --EXPECT--
-string(36) "Unterminated comment starting line 1"
-string(36) "Unterminated comment starting line 1"
-string(36) "syntax error, unexpected end of file"
-string(36) "syntax error, unexpected end of file"
-string(36) "syntax error, unexpected end of file"
+ParseError: Unterminated comment starting line 1
+ParseError: Unterminated comment starting line 1
+ParseError: syntax error, unexpected end of file
+ParseError: syntax error, unexpected end of file
+ParseError: syntax error, unexpected end of file
diff --git a/Zend/tests/gh12102_1.phpt b/Zend/tests/gh12102_1.phpt
index 1d548d6b28f3..84fb628525d8 100644
--- a/Zend/tests/gh12102_1.phpt
+++ b/Zend/tests/gh12102_1.phpt
@@ -7,8 +7,8 @@ function test() {
     byVal(func_get_args()[0]);
     try {
         byRef(func_get_args()[0]);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 
@@ -27,4 +27,4 @@ test('y');
 ?>
 --EXPECT--
 string(1) "y"
-Cannot use temporary expression in write context
+Error: Cannot use temporary expression in write context
diff --git a/Zend/tests/gh12102_3.phpt b/Zend/tests/gh12102_3.phpt
index 741bce5ab1ba..99c51d5188c4 100644
--- a/Zend/tests/gh12102_3.phpt
+++ b/Zend/tests/gh12102_3.phpt
@@ -7,8 +7,8 @@ function test() {
     byVal(C[0]);
     try {
         byRef(C[0]);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 
@@ -29,4 +29,4 @@ test('y');
 ?>
 --EXPECT--
 string(3) "foo"
-Cannot use temporary expression in write context
+Error: Cannot use temporary expression in write context
diff --git a/Zend/tests/gh14969.phpt b/Zend/tests/gh14969.phpt
index dedbaa7456e0..a69a739f0e37 100644
--- a/Zend/tests/gh14969.phpt
+++ b/Zend/tests/gh14969.phpt
@@ -20,7 +20,7 @@ $d = new D();
 try {
     $d->prop = $c;
 } catch (Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($d);
 
@@ -29,18 +29,18 @@ $d->prop = 'foo';
 try {
     $d->prop = $c;
 } catch (Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($d);
 
 ?>
 --EXPECTF--
-C::__toString
+Exception: C::__toString
 object(D)#%d (0) {
   ["prop"]=>
   uninitialized(string)
 }
-C::__toString
+Exception: C::__toString
 object(D)#2 (1) {
   ["prop"]=>
   string(3) "foo"
diff --git a/Zend/tests/gh17162.phpt b/Zend/tests/gh17162.phpt
index bdf6ddbb36ba..fb416cae26a3 100644
--- a/Zend/tests/gh17162.phpt
+++ b/Zend/tests/gh17162.phpt
@@ -13,9 +13,9 @@ $box = [new Test];
 // but any function that uses zend_try_array_init() would work.
 try {
     getimagesize("dummy", $box);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Attempt to assign property "value" on null
+Error: Attempt to assign property "value" on null
diff --git a/Zend/tests/gh18736.phpt b/Zend/tests/gh18736.phpt
index f397ee39a310..385ab0f99edb 100644
--- a/Zend/tests/gh18736.phpt
+++ b/Zend/tests/gh18736.phpt
@@ -15,10 +15,10 @@ function &test(): int {
 try {
     $x = &test();
     var_dump($x);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-test(): Return value must be of type int, string returned
+TypeError: test(): Return value must be of type int, string returned
diff --git a/Zend/tests/gh19304.phpt b/Zend/tests/gh19304.phpt
index 47e20af64623..f3f7fab3f1fe 100644
--- a/Zend/tests/gh19304.phpt
+++ b/Zend/tests/gh19304.phpt
@@ -9,10 +9,10 @@ $foo = new class {
 
 try {
     $foo->v = 0;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot assign int to property class@anonymous::$v of type self
+TypeError: Cannot assign int to property class@anonymous::$v of type self
diff --git a/Zend/tests/gh19306.phpt b/Zend/tests/gh19306.phpt
index e19735d94c84..9f98dd4cc6e2 100644
--- a/Zend/tests/gh19306.phpt
+++ b/Zend/tests/gh19306.phpt
@@ -26,7 +26,7 @@ echo "Fiber suspended\n";
 try {
     $a->next();
 } catch (Throwable $t) {
-    echo $t->getMessage(), "\n";
+    echo $t::class, ': ', $t->getMessage(), "\n";
 }
 echo "Destroying fiber\n";
 $fiber = null;
@@ -35,6 +35,6 @@ echo "Shutdown\n";
 --EXPECT--
 Fiber start
 Fiber suspended
-Cannot resume an already running generator
+Error: Cannot resume an already running generator
 Destroying fiber
 Shutdown
diff --git a/Zend/tests/gh19326.phpt b/Zend/tests/gh19326.phpt
index 335fdd382ea6..630d7ce2e8b0 100644
--- a/Zend/tests/gh19326.phpt
+++ b/Zend/tests/gh19326.phpt
@@ -25,12 +25,12 @@ $fiber->start();
 
 try {
     $b->throw(new Exception('test'));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $fiber->resume();
 
 ?>
 --EXPECT--
-Cannot resume an already running generator
+Error: Cannot resume an already running generator
diff --git a/Zend/tests/gh19719.phpt b/Zend/tests/gh19719.phpt
index 715e847846fe..9042b4139abf 100644
--- a/Zend/tests/gh19719.phpt
+++ b/Zend/tests/gh19719.phpt
@@ -12,10 +12,10 @@ function takesInt(int $x) {}
 
 try {
     takesInt('42');
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
-takesInt(): Argument #1 ($x) must be of type int, string given, called in %s on line %d
+TypeError: takesInt(): Argument #1 ($x) must be of type int, string given, called in %s on line %d
diff --git a/Zend/tests/gh20564.phpt b/Zend/tests/gh20564.phpt
index 53311d952de7..6962c7f19bd9 100644
--- a/Zend/tests/gh20564.phpt
+++ b/Zend/tests/gh20564.phpt
@@ -16,9 +16,9 @@ class A {
 try {
     (new A)->test();
 } catch (Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-array_map(): Argument #1 ($callback) must be a valid callback or null, class "B" not found
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class "B" not found
diff --git a/Zend/tests/gh23088.phpt b/Zend/tests/gh23088.phpt
index 59153a1f2ba3..a979f47d7848 100644
--- a/Zend/tests/gh23088.phpt
+++ b/Zend/tests/gh23088.phpt
@@ -24,17 +24,17 @@ for ($i = 0; $i < 20000; $i++) {
 
 try {
     var_dump($a == $b);
-} catch (Error $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     var_dump($a === $b);
-} catch (Error $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Maximum call stack size reached during comparison
-Maximum call stack size reached during comparison
+Error: Maximum call stack size reached during comparison
+Error: Maximum call stack size reached during comparison
diff --git a/Zend/tests/gh418106144.phpt b/Zend/tests/gh418106144.phpt
index 9357b0a179b1..c2d689c7ec13 100644
--- a/Zend/tests/gh418106144.phpt
+++ b/Zend/tests/gh418106144.phpt
@@ -11,10 +11,10 @@ function test($y=new Foo>''){
 }
 try {
     test();
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Foo::__toString(): Return value must be of type string, none returned
+TypeError: Foo::__toString(): Return value must be of type string, none returned
diff --git a/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt b/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt
index d0e9ddcba410..b306eb884c76 100644
--- a/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt
+++ b/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt
@@ -17,10 +17,10 @@ $foo = new Foo();
 
 try {
     $foo->foo()->baz ??= 1;
-} catch (Exception $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Hello
+Exception: Hello
diff --git a/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt b/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt
index 4115d9eae26f..e4516a1eece1 100644
--- a/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt
+++ b/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt
@@ -15,10 +15,10 @@ $foo = new Foo();
 
 try {
     $foo->foo()->prop ??= 'foo';
-} catch (Error $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot assign string to property Foo::$prop of type int
+TypeError: Cannot assign string to property Foo::$prop of type int
diff --git a/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt b/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt
index f2808afbf84d..3aa8d89fb318 100644
--- a/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt
+++ b/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt
@@ -13,10 +13,10 @@ function newFoo() {
 
 try {
     newFoo()->prop ??= 'foo';
-} catch (Error $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot assign string to property Foo::$prop of type int
+TypeError: Cannot assign string to property Foo::$prop of type int
diff --git a/Zend/tests/global_to_string_exception.phpt b/Zend/tests/global_to_string_exception.phpt
index 0c55a8c3d624..25ea7cc4c786 100644
--- a/Zend/tests/global_to_string_exception.phpt
+++ b/Zend/tests/global_to_string_exception.phpt
@@ -5,10 +5,10 @@ To string conversion failure in global
 
 try {
     global ${new stdClass};
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
diff --git a/Zend/tests/illegal_offset_unset_isset_empty.phpt b/Zend/tests/illegal_offset_unset_isset_empty.phpt
index ee837f0b6143..2a78387f4c63 100644
--- a/Zend/tests/illegal_offset_unset_isset_empty.phpt
+++ b/Zend/tests/illegal_offset_unset_isset_empty.phpt
@@ -6,22 +6,22 @@ Using unset(), isset(), empty() with an illegal array offset throws
 $ary = [];
 try {
     unset($ary[[]]);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     isset($ary[[]]);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     empty($ary[[]]);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot unset offset of type array on array
-Cannot access offset of type array in isset or empty
-Cannot access offset of type array in isset or empty
+TypeError: Cannot unset offset of type array on array
+TypeError: Cannot access offset of type array in isset or empty
+TypeError: Cannot access offset of type array in isset or empty
diff --git a/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt b/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt
index 21b4a9b01684..1384661d25c5 100644
--- a/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt
+++ b/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt
@@ -13,64 +13,64 @@ $nf = new NumericCastableNoOperations(58.3);
 /* Check normal arithmetic */
 try {
     var_dump($l - 1);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     var_dump($f - 1);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     var_dump($nl - 1);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     var_dump($nf - 1);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 /* Decrement */
 try {
     $l--;
     var_dump($l);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $f--;
     var_dump($f);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $nl--;
     var_dump($nl);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $nf--;
     var_dump($nf);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Unsupported operand types: LongCastableNoOperations - int
-Unsupported operand types: FloatCastableNoOperations - int
+TypeError: Unsupported operand types: LongCastableNoOperations - int
+TypeError: Unsupported operand types: FloatCastableNoOperations - int
 int(51)
 float(57.3)
-Cannot decrement LongCastableNoOperations
-Cannot decrement FloatCastableNoOperations
+TypeError: Cannot decrement LongCastableNoOperations
+TypeError: Cannot decrement FloatCastableNoOperations
 int(51)
 float(57.3)
diff --git a/Zend/tests/in-de-crement/incdec_bool_exception.phpt b/Zend/tests/in-de-crement/incdec_bool_exception.phpt
index f819af1e2395..3ebad74c0a00 100644
--- a/Zend/tests/in-de-crement/incdec_bool_exception.phpt
+++ b/Zend/tests/in-de-crement/incdec_bool_exception.phpt
@@ -11,18 +11,18 @@ $values = [false, true];
 foreach ($values as $value) {
     try {
         $value++;
-    } catch (\Exception $e) {
-        echo $e->getMessage(), PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         $value--;
-    } catch (\Exception $e) {
-        echo $e->getMessage(), PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 ?>
 --EXPECT--
-Increment on type bool has no effect, this will change in the next major version of PHP
-Decrement on type bool has no effect, this will change in the next major version of PHP
-Increment on type bool has no effect, this will change in the next major version of PHP
-Decrement on type bool has no effect, this will change in the next major version of PHP
+Exception: Increment on type bool has no effect, this will change in the next major version of PHP
+Exception: Decrement on type bool has no effect, this will change in the next major version of PHP
+Exception: Increment on type bool has no effect, this will change in the next major version of PHP
+Exception: Decrement on type bool has no effect, this will change in the next major version of PHP
diff --git a/Zend/tests/in-de-crement/incdec_strings_exception.phpt b/Zend/tests/in-de-crement/incdec_strings_exception.phpt
index 5acbb1041222..c6a1891c991a 100644
--- a/Zend/tests/in-de-crement/incdec_strings_exception.phpt
+++ b/Zend/tests/in-de-crement/incdec_strings_exception.phpt
@@ -28,48 +28,48 @@ $values = [
 foreach ($values as $value) {
     try {
         $value++;
-    } catch (\Exception $e) {
-        echo $e->getMessage(), PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump($value);
     try {
         $value--;
-    } catch (\Exception $e) {
-        echo $e->getMessage(), PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump($value);
 }
 ?>
 --EXPECT--
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
 string(0) ""
-Deprecated: Decrement on empty string is deprecated as non-numeric
+Exception: Deprecated: Decrement on empty string is deprecated as non-numeric
 string(0) ""
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
 string(1) " "
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
 string(1) " "
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
 string(4) "199A"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
 string(4) "199A"
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
 string(4) "A199"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
 string(4) "A199"
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
 string(4) "199Z"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
 string(4) "199Z"
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
 string(4) "Z199"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
 string(4) "Z199"
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
 string(11) "Hello world"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
 string(11) "Hello world"
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
 string(4) "🐘"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
 string(4) "🐘"
diff --git a/Zend/tests/in-de-crement/incdec_types.phpt b/Zend/tests/in-de-crement/incdec_types.phpt
index 755b63957ef3..9b99b9baa45d 100644
--- a/Zend/tests/in-de-crement/incdec_types.phpt
+++ b/Zend/tests/in-de-crement/incdec_types.phpt
@@ -9,13 +9,13 @@ $types = [[], new stdClass(), fopen(__FILE__, 'r')];
 foreach ($types as $type) {
     try {
         $type++;
-    } catch (\TypeError $e) {
-        echo $e->getMessage(), PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         $type--;
-    } catch (\TypeError $e) {
-        echo $e->getMessage(), PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 
@@ -40,12 +40,12 @@ foreach ($values as $value) {
 }
 ?>
 --EXPECTF--
-Cannot increment array
-Cannot decrement array
-Cannot increment stdClass
-Cannot decrement stdClass
-Cannot increment resource
-Cannot decrement resource
+TypeError: Cannot increment array
+TypeError: Cannot decrement array
+TypeError: Cannot increment stdClass
+TypeError: Cannot decrement stdClass
+TypeError: Cannot increment resource
+TypeError: Cannot decrement resource
 Using increment:
 Initial value:NULL
 Result value:int(1)
diff --git a/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt b/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt
index cf08055383ed..8ee4cd33856a 100644
--- a/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt
+++ b/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt
@@ -13,64 +13,64 @@ $nf = new NumericCastableNoOperations(58.3);
 /* Check normal arithmetic */
 try {
     var_dump($l + 1);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     var_dump($f + 1);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     var_dump($nl + 1);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     var_dump($nf + 1);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 /* Decrement */
 try {
     $l++;
     var_dump($l);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $f++;
     var_dump($f);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $nl++;
     var_dump($nl);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     $nf++;
     var_dump($nf);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Unsupported operand types: LongCastableNoOperations + int
-Unsupported operand types: FloatCastableNoOperations + int
+TypeError: Unsupported operand types: LongCastableNoOperations + int
+TypeError: Unsupported operand types: FloatCastableNoOperations + int
 int(53)
 float(59.3)
-Cannot increment LongCastableNoOperations
-Cannot increment FloatCastableNoOperations
+TypeError: Cannot increment LongCastableNoOperations
+TypeError: Cannot increment FloatCastableNoOperations
 int(53)
 float(59.3)
diff --git a/Zend/tests/in-de-crement/object_cannot_incdec.phpt b/Zend/tests/in-de-crement/object_cannot_incdec.phpt
index 39a41d61dd3e..cfa5cca2dd50 100644
--- a/Zend/tests/in-de-crement/object_cannot_incdec.phpt
+++ b/Zend/tests/in-de-crement/object_cannot_incdec.phpt
@@ -7,39 +7,39 @@ $o = new Foo;
 
 try {
     $o++;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($o);
 }
 try {
     $o--;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($o);
 }
 try {
     ++$o;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($o);
 }
 try {
     --$o;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($o);
 }
 ?>
 --EXPECT--
-Cannot increment Foo
+TypeError: Cannot increment Foo
 object(Foo)#1 (0) {
 }
-Cannot decrement Foo
+TypeError: Cannot decrement Foo
 object(Foo)#1 (0) {
 }
-Cannot increment Foo
+TypeError: Cannot increment Foo
 object(Foo)#1 (0) {
 }
-Cannot decrement Foo
+TypeError: Cannot decrement Foo
 object(Foo)#1 (0) {
 }
diff --git a/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt b/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt
index b4c193a67182..370fe8603fd9 100644
--- a/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt
+++ b/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt
@@ -7,39 +7,39 @@ $o = new Foo;
 
 try {
     $y = $o++;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($o);
 }
 try {
     $y = $o--;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($o);
 }
 try {
     $y = ++$o;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($o);
 }
 try {
     $y = --$o;
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($o);
 }
 ?>
 --EXPECT--
-Cannot increment Foo
+TypeError: Cannot increment Foo
 object(Foo)#1 (0) {
 }
-Cannot decrement Foo
+TypeError: Cannot decrement Foo
 object(Foo)#1 (0) {
 }
-Cannot increment Foo
+TypeError: Cannot increment Foo
 object(Foo)#1 (0) {
 }
-Cannot decrement Foo
+TypeError: Cannot decrement Foo
 object(Foo)#1 (0) {
 }
diff --git a/Zend/tests/in-de-crement/oss_fuzz_63802.phpt b/Zend/tests/in-de-crement/oss_fuzz_63802.phpt
index 51b4c8f1fd72..96b50d1022f2 100644
--- a/Zend/tests/in-de-crement/oss_fuzz_63802.phpt
+++ b/Zend/tests/in-de-crement/oss_fuzz_63802.phpt
@@ -21,14 +21,14 @@ foreach (['pre', 'post'] as $prePost) {
     foreach (['inc', 'dec'] as $incDec) {
         try {
             $foo->{$prePost . ucfirst($incDec)}();
-        } catch (TypeError $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
 ?>
 --EXPECT--
-Cannot increment Foo
-Cannot decrement Foo
-Cannot increment Foo
-Cannot decrement Foo
+TypeError: Cannot increment Foo
+TypeError: Cannot decrement Foo
+TypeError: Cannot increment Foo
+TypeError: Cannot decrement Foo
diff --git a/Zend/tests/in-de-crement/overloaded_access.phpt b/Zend/tests/in-de-crement/overloaded_access.phpt
index 56a5c2b1d47a..feb15c60c6cf 100644
--- a/Zend/tests/in-de-crement/overloaded_access.phpt
+++ b/Zend/tests/in-de-crement/overloaded_access.phpt
@@ -22,15 +22,15 @@ $foo = new Foo;
 try {
 	$foo[0]++;
 } catch (Throwable $ex) {
-	echo $ex->getMessage() . "\n";
+	echo $ex::class, ': ', $ex->getMessage(), "\n";
 }
 $foo = new Foo;
 try {
 	$foo[0]--;
 } catch (Throwable $ex) {
-	echo $ex->getMessage() . "\n";
+	echo $ex::class, ': ', $ex->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Cannot increment array
-Cannot decrement array
+TypeError: Cannot increment array
+TypeError: Cannot decrement array
diff --git a/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt b/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt
index d435c9fb4029..8b8b0a1fe71f 100644
--- a/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt
+++ b/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt
@@ -14,12 +14,12 @@ unset($c->a);
 
 try {
     (++$c->a);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($c->a);
 ?>
 --EXPECT--
-Cannot increment stdClass
+TypeError: Cannot increment stdClass
 object(stdClass)#2 (0) {
 }
diff --git a/Zend/tests/incompat_ctx_user.phpt b/Zend/tests/incompat_ctx_user.phpt
index 3fe0456175f0..a50c769b3da7 100644
--- a/Zend/tests/incompat_ctx_user.phpt
+++ b/Zend/tests/incompat_ctx_user.phpt
@@ -13,8 +13,8 @@ $b = new B;
 try {
     $b->bar();
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Exception: Non-static method A::foo() cannot be called statically
+Error: Non-static method A::foo() cannot be called statically
diff --git a/Zend/tests/indexing_001.phpt b/Zend/tests/indexing_001.phpt
index 66b20da03a03..acb1ab10874b 100644
--- a/Zend/tests/indexing_001.phpt
+++ b/Zend/tests/indexing_001.phpt
@@ -9,8 +9,8 @@ $testvalues=array(null, 0, 1, true, false,'',' ',0.1,array());
 foreach ($testvalues as $testvalue) {
     try {
         $testvalue['foo']=$array;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump($testvalue);
 }
@@ -21,8 +21,8 @@ $testvalues=array(null, 0, 1, true, false,0.1,array());
 foreach ($testvalues as $testvalue) {
     try {
         $testvalue['foo']=&$array;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump($testvalue);
 }
@@ -33,8 +33,8 @@ $testvalues=array(null, 0, 1, true, false,0.1,array());
 foreach ($testvalues as $testvalue) {
     try {
         $testvalue[]=$array;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump ($testvalue);
 }
@@ -45,8 +45,8 @@ $testvalues=array(null, 0, 1, true, false,0.1,array());
 foreach ($testvalues as $testvalue) {
     try {
         $testvalue[]=&$array;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump ($testvalue);
 }
@@ -61,11 +61,11 @@ array(1) {
     int(1)
   }
 }
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 int(0)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 int(1)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 bool(true)
 
 Deprecated: Automatic conversion of false to array is deprecated in %s
@@ -76,11 +76,11 @@ array(1) {
     int(1)
   }
 }
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
 string(0) ""
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
 string(1) " "
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 float(0.1)
 array(1) {
   ["foo"]=>
@@ -98,11 +98,11 @@ array(1) {
     int(1)
   }
 }
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 int(0)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 int(1)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 bool(true)
 
 Deprecated: Automatic conversion of false to array is deprecated in %s
@@ -113,7 +113,7 @@ array(1) {
     int(1)
   }
 }
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 float(0.1)
 array(1) {
   ["foo"]=>
@@ -130,11 +130,11 @@ array(1) {
     int(1)
   }
 }
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 int(0)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 int(1)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 bool(true)
 
 Deprecated: Automatic conversion of false to array is deprecated in %s
@@ -145,7 +145,7 @@ array(1) {
     int(1)
   }
 }
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 float(0.1)
 array(1) {
   [0]=>
@@ -163,11 +163,11 @@ array(1) {
     int(1)
   }
 }
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 int(0)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 int(1)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 bool(true)
 
 Deprecated: Automatic conversion of false to array is deprecated in %s
@@ -178,7 +178,7 @@ array(1) {
     int(1)
   }
 }
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 float(0.1)
 array(1) {
   [0]=>
diff --git a/Zend/tests/indirect_function_call/indirect_call_array_003.phpt b/Zend/tests/indirect_function_call/indirect_call_array_003.phpt
index 603b3bfc299b..30d84109ce31 100644
--- a/Zend/tests/indirect_function_call/indirect_call_array_003.phpt
+++ b/Zend/tests/indirect_function_call/indirect_call_array_003.phpt
@@ -20,7 +20,7 @@ $arr = array('foo', 'abc');
 try {
     $arr();
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 $foo = new foo;
 $arr = array($foo, 'abc');
@@ -31,7 +31,7 @@ $arr();
 --EXPECTF--
 From foo::__callStatic:
 string(3) "abc"
-Exception: Using $this when not in object context
+Error: Using $this when not in object context
 From foo::__call:
 string(3) "abc"
 object(foo)#%d (0) {
diff --git a/Zend/tests/indirect_function_call/indirect_call_array_004.phpt b/Zend/tests/indirect_function_call/indirect_call_array_004.phpt
index e8520efd12b0..c1992a289082 100644
--- a/Zend/tests/indirect_function_call/indirect_call_array_004.phpt
+++ b/Zend/tests/indirect_function_call/indirect_call_array_004.phpt
@@ -23,8 +23,8 @@ $arr = array('foo', 'abc');
 try {
     $arr();
 }
-catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 $arr = array('foo', '123');
@@ -32,8 +32,8 @@ $arr = array('foo', '123');
 try {
     $arr();
 }
-catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 
@@ -45,8 +45,8 @@ $arr = array($foo, 'abc');
 try {
     $arr();
 }
-catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 
@@ -56,16 +56,16 @@ $arr = array($foo, '123');
 try {
     $arr();
 }
-catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-foo
+Exception: foo
 From foo::__callStatic:
-123
+Exception: 123
 ------
-foo
+Exception: foo
 From foo::__call:
-123
+Exception: 123
diff --git a/Zend/tests/indirect_function_call/indirect_call_string_002.phpt b/Zend/tests/indirect_function_call/indirect_call_string_002.phpt
index 7704c1cd9a4d..2c5c22a29ada 100644
--- a/Zend/tests/indirect_function_call/indirect_call_string_002.phpt
+++ b/Zend/tests/indirect_function_call/indirect_call_string_002.phpt
@@ -22,65 +22,65 @@ $callback();
 $callback = ['', 'method'];
 try {
     $callback();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 // Test Class::method syntax with empty class name
 $callback = '::method';
 try {
     $callback();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 // Test array syntax with empty class and method name
 $callback = ['', ''];
 try {
     $callback();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 // Test Class::method syntax with empty class and method name
 $callback = '::';
 try {
     $callback();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 // Test string ending in single colon
 $callback = 'Class:';
 try {
     $callback();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 // Test string beginning in single colon
 $callback = ':method';
 try {
     $callback();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 // Test single colon
 $callback = ':';
 try {
     $callback();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
 string(0) ""
 string(0) ""
-Class "" not found
-Class "" not found
-Class "" not found
-Class "" not found
-Call to undefined function Class:()
-Call to undefined function :method()
-Call to undefined function :()
+Error: Class "" not found
+Error: Class "" not found
+Error: Class "" not found
+Error: Class "" not found
+Error: Call to undefined function Class:()
+Error: Call to undefined function :method()
+Error: Call to undefined function :()
diff --git a/Zend/tests/indirect_function_call/indirect_method_call_001.phpt b/Zend/tests/indirect_function_call/indirect_method_call_001.phpt
index 39967fdb267d..394e0277919f 100644
--- a/Zend/tests/indirect_function_call/indirect_method_call_001.phpt
+++ b/Zend/tests/indirect_function_call/indirect_method_call_001.phpt
@@ -11,10 +11,10 @@ class foo {
 
 try {
     $X = (new foo)->Inexistent(3);
-} catch (Exception $e) {
-    var_dump($e->getMessage()); // foobar
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n"; // foobar
 }
 
 ?>
 --EXPECT--
-string(6) "foobar"
+Exception: foobar
diff --git a/Zend/tests/init_array_illegal_offset_type.phpt b/Zend/tests/init_array_illegal_offset_type.phpt
index ee41c0217ad7..a7575fe15543 100644
--- a/Zend/tests/init_array_illegal_offset_type.phpt
+++ b/Zend/tests/init_array_illegal_offset_type.phpt
@@ -7,9 +7,9 @@ function test() {
 }
 try {
     test();
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Cannot access offset of type stdClass on array
+TypeError: Cannot access offset of type stdClass on array
diff --git a/Zend/tests/int_static_prop_name.phpt b/Zend/tests/int_static_prop_name.phpt
index e29e2514bb97..27a3c521aa5f 100644
--- a/Zend/tests/int_static_prop_name.phpt
+++ b/Zend/tests/int_static_prop_name.phpt
@@ -16,20 +16,20 @@ var_dump(${(int) $n});
 
 try {
     var_dump(Foo::${42});
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     var_dump(Foo::${(int) 42});
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     var_dump(Foo::${(int) $n});
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -37,6 +37,6 @@ try {
 int(24)
 int(24)
 int(24)
-Access to undeclared static property Foo::$42
-Access to undeclared static property Foo::$42
-Access to undeclared static property Foo::$42
+Error: Access to undeclared static property Foo::$42
+Error: Access to undeclared static property Foo::$42
+Error: Access to undeclared static property Foo::$42
diff --git a/Zend/tests/invalid_parent_const_ref_leak.phpt b/Zend/tests/invalid_parent_const_ref_leak.phpt
index ed728f7d45e4..cf102c14e985 100644
--- a/Zend/tests/invalid_parent_const_ref_leak.phpt
+++ b/Zend/tests/invalid_parent_const_ref_leak.phpt
@@ -9,10 +9,10 @@ class A {
 
 try {
     A::B;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Cannot access "parent" when current class scope has no parent
+Error: Cannot access "parent" when current class scope has no parent
diff --git a/Zend/tests/isset/isset_array.phpt b/Zend/tests/isset/isset_array.phpt
index 48e908a36d56..f74498b7c479 100644
--- a/Zend/tests/isset/isset_array.phpt
+++ b/Zend/tests/isset/isset_array.phpt
@@ -24,14 +24,14 @@ var_dump(isset($array[STDIN]));
 
 try {
     isset($array[[]]);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 
 try {
     isset($array[new stdClass()]);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
@@ -48,5 +48,5 @@ bool(false)
 
 Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
 bool(false)
-Cannot access offset of type array in isset or empty
-Cannot access offset of type stdClass in isset or empty
+TypeError: Cannot access offset of type array in isset or empty
+TypeError: Cannot access offset of type stdClass in isset or empty
diff --git a/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt b/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt
index c46756718649..15cf5fdad65c 100644
--- a/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt
+++ b/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt
@@ -32,8 +32,8 @@ var_dump($object2);
 
 try {
     var_dump($object1->propB);
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 // The state of both objects is unchanged
@@ -52,7 +52,7 @@ lazy ghost object(MyClass)#%d (1) {
   ["propA"]=>
   string(8) "object-2"
 }
-initializer exception
+Exception: initializer exception
 lazy ghost object(MyClass)#%d (1) {
   ["propA"]=>
   string(8) "object-1"
diff --git a/Zend/tests/lazy_objects/typed_properties_001.phpt b/Zend/tests/lazy_objects/typed_properties_001.phpt
index 1f457531d87c..06b7689900b6 100644
--- a/Zend/tests/lazy_objects/typed_properties_001.phpt
+++ b/Zend/tests/lazy_objects/typed_properties_001.phpt
@@ -20,14 +20,14 @@ $test = $reflector->newLazyProxy(function () {
 $ref = "foobar";
 try {
     $test->$name =& $ref;
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test);
 
 ?>
 --EXPECTF--
-Cannot assign string to property Test::$prop of type int
+TypeError: Cannot assign string to property Test::$prop of type int
 lazy proxy object(Test)#%d (1) {
   ["instance"]=>
   object(Test)#%d (0) {
diff --git a/Zend/tests/live_range_phi_leak.phpt b/Zend/tests/live_range_phi_leak.phpt
index f07258405301..d5d70f0a3c1a 100644
--- a/Zend/tests/live_range_phi_leak.phpt
+++ b/Zend/tests/live_range_phi_leak.phpt
@@ -11,9 +11,9 @@ function test($k) {
 }
 try {
     test(new stdClass);
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Test
+Exception: Test
diff --git a/Zend/tests/magic_methods/bug26166.phpt b/Zend/tests/magic_methods/bug26166.phpt
index 3e5c6daa21d4..7e1c48790800 100644
--- a/Zend/tests/magic_methods/bug26166.phpt
+++ b/Zend/tests/magic_methods/bug26166.phpt
@@ -40,8 +40,8 @@ class NoneTest
 $o = new NoneTest;
 try {
     echo $o;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 echo "===THROW===\n";
@@ -56,14 +56,14 @@ class ErrorTest
 $o = new ErrorTest;
 try {
     echo $o;
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
 Hello World!
 ===NONE===
-NoneTest::__toString(): Return value must be of type string, none returned
+TypeError: NoneTest::__toString(): Return value must be of type string, none returned
 ===THROW===
-This is an error!
+Exception: This is an error!
diff --git a/Zend/tests/magic_methods/bug29368_2.phpt b/Zend/tests/magic_methods/bug29368_2.phpt
index e13d6da88467..fda92130c504 100644
--- a/Zend/tests/magic_methods/bug29368_2.phpt
+++ b/Zend/tests/magic_methods/bug29368_2.phpt
@@ -12,10 +12,10 @@ class Bomb {
 try {
     $x = new ReflectionMethod(new Bomb(), "foo");
 } catch (Throwable $e) {
-    echo $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "ok\n";
 ?>
 --EXPECT--
-bomb!
+Exception: bomb!
 ok
diff --git a/Zend/tests/magic_methods/bug45186.phpt b/Zend/tests/magic_methods/bug45186.phpt
index 9e0078d77002..6722ea397186 100644
--- a/Zend/tests/magic_methods/bug45186.phpt
+++ b/Zend/tests/magic_methods/bug45186.phpt
@@ -33,8 +33,8 @@ call_user_func(array('BAR','x'));
 call_user_func('BAR::www');
 try {
     call_user_func('self::y');
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -58,4 +58,4 @@ string(1) "y"
 ok
 __callstatic:
 string(3) "www"
-call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active
diff --git a/Zend/tests/magic_methods/bug45186_2.phpt b/Zend/tests/magic_methods/bug45186_2.phpt
index e85528ce8b00..bea4427ade40 100644
--- a/Zend/tests/magic_methods/bug45186_2.phpt
+++ b/Zend/tests/magic_methods/bug45186_2.phpt
@@ -28,13 +28,13 @@ $x->test();
 call_user_func(array('BAR','x'));
 try {
     call_user_func('BAR::www');
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     call_user_func('self::y');
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -56,5 +56,5 @@ Deprecated: Use of "self" in callables is deprecated in %s on line %d
 __call:
 string(1) "y"
 ok
-call_user_func(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "www"
-call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "www"
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active
diff --git a/Zend/tests/magic_methods/bug76667.phpt b/Zend/tests/magic_methods/bug76667.phpt
index 03bd490a0409..d27ea5e18d53 100644
--- a/Zend/tests/magic_methods/bug76667.phpt
+++ b/Zend/tests/magic_methods/bug76667.phpt
@@ -18,12 +18,12 @@ class T {
 $x = new T;
 try {
     $x->x = 1;
-} catch (\DivisionByZeroError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Warning: Undefined variable $undefined in %s on line %d
 
 Warning: Attempt to read property "1" on null in %s on line %d
-Division by zero
+DivisionByZeroError: Division by zero
diff --git a/Zend/tests/match/043.phpt b/Zend/tests/match/043.phpt
index 03ff0cbf36d6..32ec8bcac38a 100644
--- a/Zend/tests/match/043.phpt
+++ b/Zend/tests/match/043.phpt
@@ -8,8 +8,8 @@ class Beep {}
 function test(mixed $var) {
     try {
         match($var) {};
-    } catch (UnhandledMatchError $e) {
-        print $e->getMessage() . PHP_EOL;
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 
@@ -27,14 +27,14 @@ test(str_repeat('e', 100));
 test(str_repeat("e\n", 100));
 ?>
 --EXPECT--
-Unhandled match case NULL
-Unhandled match case 1
-Unhandled match case 5.5
-Unhandled match case 5.0
-Unhandled match case 'foo'
-Unhandled match case true
-Unhandled match case false
-Unhandled match case of type array
-Unhandled match case of type Beep
-Unhandled match case 'eeeeeeeeeeeeeee...'
-Unhandled match case 'e\ne\ne\ne\ne\ne\ne\ne...'
+UnhandledMatchError: Unhandled match case NULL
+UnhandledMatchError: Unhandled match case 1
+UnhandledMatchError: Unhandled match case 5.5
+UnhandledMatchError: Unhandled match case 5.0
+UnhandledMatchError: Unhandled match case 'foo'
+UnhandledMatchError: Unhandled match case true
+UnhandledMatchError: Unhandled match case false
+UnhandledMatchError: Unhandled match case of type array
+UnhandledMatchError: Unhandled match case of type Beep
+UnhandledMatchError: Unhandled match case 'eeeeeeeeeeeeeee...'
+UnhandledMatchError: Unhandled match case 'e\ne\ne\ne\ne\ne\ne\ne...'
diff --git a/Zend/tests/match/045.phpt b/Zend/tests/match/045.phpt
index da8991cf595c..77b6e58d7a34 100644
--- a/Zend/tests/match/045.phpt
+++ b/Zend/tests/match/045.phpt
@@ -10,9 +10,9 @@ function test() {
 }
 try {
     test();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Undefined constant "x"
+Error: Undefined constant "x"
diff --git a/Zend/tests/match/048.phpt b/Zend/tests/match/048.phpt
index e5c6bb2e0bcb..008b83fbc1a0 100644
--- a/Zend/tests/match/048.phpt
+++ b/Zend/tests/match/048.phpt
@@ -10,8 +10,8 @@ class Beep {}
 function test(mixed $var) {
     try {
         match($var) {};
-    } catch (UnhandledMatchError $e) {
-        print $e->getMessage() . PHP_EOL;
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 
@@ -29,14 +29,14 @@ test(str_repeat('e', 100));
 test(str_repeat("e\n", 100));
 ?>
 --EXPECT--
-Unhandled match case NULL
-Unhandled match case 1
-Unhandled match case 5.5
-Unhandled match case 5.0
-Unhandled match case of type string
-Unhandled match case true
-Unhandled match case false
-Unhandled match case of type array
-Unhandled match case of type Beep
-Unhandled match case of type string
-Unhandled match case of type string
+UnhandledMatchError: Unhandled match case NULL
+UnhandledMatchError: Unhandled match case 1
+UnhandledMatchError: Unhandled match case 5.5
+UnhandledMatchError: Unhandled match case 5.0
+UnhandledMatchError: Unhandled match case of type string
+UnhandledMatchError: Unhandled match case true
+UnhandledMatchError: Unhandled match case false
+UnhandledMatchError: Unhandled match case of type array
+UnhandledMatchError: Unhandled match case of type Beep
+UnhandledMatchError: Unhandled match case of type string
+UnhandledMatchError: Unhandled match case of type string
diff --git a/Zend/tests/match/049.phpt b/Zend/tests/match/049.phpt
index 2a2385f704ff..23933003d5bb 100644
--- a/Zend/tests/match/049.phpt
+++ b/Zend/tests/match/049.phpt
@@ -10,8 +10,8 @@ class Beep {}
 function test(mixed $var) {
     try {
         match($var) {};
-    } catch (UnhandledMatchError $e) {
-        print $e->getMessage() . PHP_EOL;
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 
@@ -29,14 +29,14 @@ test(str_repeat('e', 100));
 test(str_repeat("e\n", 100));
 ?>
 --EXPECT--
-Unhandled match case of type null
-Unhandled match case of type int
-Unhandled match case of type float
-Unhandled match case of type float
-Unhandled match case of type string
-Unhandled match case of type bool
-Unhandled match case of type bool
-Unhandled match case of type array
-Unhandled match case of type Beep
-Unhandled match case of type string
-Unhandled match case of type string
+UnhandledMatchError: Unhandled match case of type null
+UnhandledMatchError: Unhandled match case of type int
+UnhandledMatchError: Unhandled match case of type float
+UnhandledMatchError: Unhandled match case of type float
+UnhandledMatchError: Unhandled match case of type string
+UnhandledMatchError: Unhandled match case of type bool
+UnhandledMatchError: Unhandled match case of type bool
+UnhandledMatchError: Unhandled match case of type array
+UnhandledMatchError: Unhandled match case of type Beep
+UnhandledMatchError: Unhandled match case of type string
+UnhandledMatchError: Unhandled match case of type string
diff --git a/Zend/tests/match/unmatched_enum.phpt b/Zend/tests/match/unmatched_enum.phpt
index 93f368a316b6..e3238f034937 100644
--- a/Zend/tests/match/unmatched_enum.phpt
+++ b/Zend/tests/match/unmatched_enum.phpt
@@ -12,10 +12,10 @@ try {
     match (Foo::Bar) {
         Foo::Baz => 42,
     };
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-Unhandled match case Foo::Bar
+UnhandledMatchError: Unhandled match case Foo::Bar
diff --git a/Zend/tests/methods-on-non-objects-call-user-func.phpt b/Zend/tests/methods-on-non-objects-call-user-func.phpt
index 7a8ab5a2647b..4463d97263a2 100644
--- a/Zend/tests/methods-on-non-objects-call-user-func.phpt
+++ b/Zend/tests/methods-on-non-objects-call-user-func.phpt
@@ -5,9 +5,9 @@ call_user_func() in combination with "Call to a member function method() on a no
 $comparator = null;
 try {
     var_dump(call_user_func([$comparator, 'compare'], 1, 2));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
diff --git a/Zend/tests/methods-on-non-objects-catch.phpt b/Zend/tests/methods-on-non-objects-catch.phpt
index b090437084ff..5e7c02e7a1c0 100644
--- a/Zend/tests/methods-on-non-objects-catch.phpt
+++ b/Zend/tests/methods-on-non-objects-catch.phpt
@@ -9,12 +9,11 @@ set_error_handler(function($code, $message) {
 $x= null;
 try {
     var_dump($x->method());
-} catch (Error $e) {
-  var_dump($e->getCode(), $e->getMessage());
+} catch (Throwable $e) {
+  echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), "\n";
 }
 echo "Alive\n";
 ?>
 --EXPECTF--
-int(0)
-string(%d) "Call to a member function method() on null"
+Error: 0: Call to a member function method() on null
 Alive
diff --git a/Zend/tests/methods-on-non-objects-usort.phpt b/Zend/tests/methods-on-non-objects-usort.phpt
index 8a89023b7e81..5f3306d5bcea 100644
--- a/Zend/tests/methods-on-non-objects-usort.phpt
+++ b/Zend/tests/methods-on-non-objects-usort.phpt
@@ -11,8 +11,8 @@ $list= [1, 4, 2, 3, -1];
 usort($list, function($a, $b) use ($comparator) {
   try {
       return $comparator->compare($a, $b);
-  } catch (Error $e) {
-      var_dump($e->getCode(), $e->getMessage());
+  } catch (Throwable $e) {
+      echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), "\n";
       return 0;
   }
 });
@@ -20,14 +20,10 @@ var_dump($list);
 echo "Alive\n";
 ?>
 --EXPECT--
-int(0)
-string(43) "Call to a member function compare() on null"
-int(0)
-string(43) "Call to a member function compare() on null"
-int(0)
-string(43) "Call to a member function compare() on null"
-int(0)
-string(43) "Call to a member function compare() on null"
+Error: 0: Call to a member function compare() on null
+Error: 0: Call to a member function compare() on null
+Error: 0: Call to a member function compare() on null
+Error: 0: Call to a member function compare() on null
 array(5) {
   [0]=>
   int(1)
diff --git a/Zend/tests/mod_001.phpt b/Zend/tests/mod_001.phpt
index 5c543a26192c..a836044df9a1 100644
--- a/Zend/tests/mod_001.phpt
+++ b/Zend/tests/mod_001.phpt
@@ -9,12 +9,12 @@ $b = array();
 try {
     $c = $a % $b;
     var_dump($c);
-} catch (TypeError $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 echo "Done\n";
 ?>
 --EXPECTF--
-Exception: Unsupported operand types: array % array
+TypeError: Unsupported operand types: array % array
 Done
diff --git a/Zend/tests/mul_001.phpt b/Zend/tests/mul_001.phpt
index ddb657685302..fee2d0c9c627 100644
--- a/Zend/tests/mul_001.phpt
+++ b/Zend/tests/mul_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/named_params/__invoke.phpt b/Zend/tests/named_params/__invoke.phpt
index 6ebbac0f07f4..717ad657380c 100644
--- a/Zend/tests/named_params/__invoke.phpt
+++ b/Zend/tests/named_params/__invoke.phpt
@@ -21,8 +21,8 @@ $test(b: 'B', a: 'A');
 $test(b: 'B');
 try {
     $test(b: 'B', c: 'C');
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "\n";
 
@@ -38,15 +38,15 @@ $test3(b: 'B', a: 'A');
 $test3(b: 'B');
 try {
     $test3(b: 'B', c: 'C');
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
 a: A, b: B
 a: a, b: B
-Unknown named parameter $c
+Error: Unknown named parameter $c
 
 a: A, b: B
 array(1) {
@@ -61,4 +61,4 @@ array(1) {
 
 a: A, b: B
 a: a, b: B
-Unknown named parameter $c
+Error: Unknown named parameter $c
diff --git a/Zend/tests/named_params/assert.phpt b/Zend/tests/named_params/assert.phpt
index 40a92a2f1fec..58ba7605a370 100644
--- a/Zend/tests/named_params/assert.phpt
+++ b/Zend/tests/named_params/assert.phpt
@@ -6,25 +6,25 @@ Calling assert with named params
 assert(assertion: true);
 try {
     assert(assertion: false);
-} catch (AssertionError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 assert(assertion: true, description: "Description");
 try {
     assert(assertion: false, description: "Description");
-} catch (AssertionError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     assert(description: "Description");
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-assert(assertion: false)
-Description
-Named parameter $description overwrites previous argument
+AssertionError: assert(assertion: false)
+AssertionError: Description
+Error: Named parameter $description overwrites previous argument
diff --git a/Zend/tests/named_params/attributes.phpt b/Zend/tests/named_params/attributes.phpt
index 94d2fad19f4d..caee975632a2 100644
--- a/Zend/tests/named_params/attributes.phpt
+++ b/Zend/tests/named_params/attributes.phpt
@@ -26,8 +26,8 @@ var_dump($attr->newInstance());
 $attr = (new ReflectionClass(Test2::class))->getAttributes()[0];
 try {
     var_dump($attr->newInstance());
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
@@ -47,4 +47,4 @@ object(MyAttribute)#1 (3) {
   ["c"]=>
   string(1) "C"
 }
-Named parameter $a overwrites previous argument
+Error: Named parameter $a overwrites previous argument
diff --git a/Zend/tests/named_params/call_user_func.phpt b/Zend/tests/named_params/call_user_func.phpt
index 50f2ed588e92..74b6e6707a19 100644
--- a/Zend/tests/named_params/call_user_func.phpt
+++ b/Zend/tests/named_params/call_user_func.phpt
@@ -36,18 +36,18 @@ call_user_func($test_ref, ref: null);
 var_dump(call_user_func('call_user_func', $test, c: 'D'));
 try {
     call_user_func($test_required, b: 'B');
-} catch (ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(call_user_func('array_slice', [1, 2, 3, 4, 5], length: 2));
-} catch (ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(call_user_func('array_slice', [1, 2, 3, 4, 'x' => 5], 3, preserve_keys: true));
-} catch (ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "\n";
 
@@ -82,8 +82,8 @@ array(2) {
 Warning: {closure:%s:%d}(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
 a = a, b = b, c = D
 NULL
-{closure:%s:%d}(): Argument #1 ($a) not passed
-array_slice(): Argument #2 ($offset) not passed
+ArgumentCountError: {closure:%s:%d}(): Argument #1 ($a) not passed
+ArgumentCountError: array_slice(): Argument #2 ($offset) not passed
 array(2) {
   [3]=>
   int(4)
diff --git a/Zend/tests/named_params/call_user_func_array.phpt b/Zend/tests/named_params/call_user_func_array.phpt
index ebee06ea6af7..b708c63ad80c 100644
--- a/Zend/tests/named_params/call_user_func_array.phpt
+++ b/Zend/tests/named_params/call_user_func_array.phpt
@@ -17,13 +17,13 @@ namespace {
     call_user_func_array($test_variadic, ['A', 'c' => 'C']);
     try {
         call_user_func_array($test, ['d' => 'D']);
-    } catch (\Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         call_user_func_array($test, ['c' => 'C', 'A']);
-    } catch (\Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     echo "\n";
 }
@@ -35,13 +35,13 @@ namespace Foo {
     call_user_func_array($test_variadic, ['A', 'c' => 'C']);
     try {
         call_user_func_array($test, ['d' => 'D']);
-    } catch (\Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         call_user_func_array($test, ['c' => 'C', 'A']);
-    } catch (\Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 
@@ -56,8 +56,8 @@ array(2) {
   ["c"]=>
   string(1) "C"
 }
-Unknown named parameter $d
-Cannot use positional argument after named argument
+Error: Unknown named parameter $d
+Error: Cannot use positional argument after named argument
 
 a = A, b = B, c = c
 a = A, b = B, c = c
@@ -68,5 +68,5 @@ array(2) {
   ["c"]=>
   string(1) "C"
 }
-Unknown named parameter $d
-Cannot use positional argument after named argument
+Error: Unknown named parameter $d
+Error: Cannot use positional argument after named argument
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.