Commit bd044a29bf1 for php.net

commit bd044a29bf1664625db030f4179ef54a8db53082
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date:   Sat Aug 22 20:11:35 2026 +0700

    Zend: applied fixers to improve test robustness (part 1/8) (#23308)

diff --git a/Zend/tests/access_modifiers/access_modifiers_008.phpt b/Zend/tests/access_modifiers/access_modifiers_008.phpt
index 1cce8767d85..57c555bb634 100644
--- a/Zend/tests/access_modifiers/access_modifiers_008.phpt
+++ b/Zend/tests/access_modifiers/access_modifiers_008.phpt
@@ -33,18 +33,18 @@ static public function test() {
         try {
             echo A::mp() . "\n";
         } catch (\Throwable $e) {
-            echo $e->getMessage() . "\n";
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
         echo B1::ma() . "\n"; // protected method defined also in A
         try {
             echo B1::mp() . "\n"; // protected method defined also in A but as private
         } catch (\Throwable $e) {
-            echo $e->getMessage() . "\n";
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
         try {
             echo B1::mb() . "\n";
         } catch (\Throwable $e) {
-            echo $e->getMessage() . "\n";
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
@@ -54,7 +54,7 @@ static public function test() {
 ?>
 --EXPECT--
 A::ma()
-Call to private method A::mp() from scope B2
+Error: Call to private method A::mp() from scope B2
 B1::ma()
-Call to protected method B1::mp() from scope B2
-Call to protected method B1::mb() from scope B2
+Error: Call to protected method B1::mp() from scope B2
+Error: Call to protected method B1::mb() from scope B2
diff --git a/Zend/tests/add_002.phpt b/Zend/tests/add_002.phpt
index 9077ece0858..627e210d0f1 100644
--- a/Zend/tests/add_002.phpt
+++ b/Zend/tests/add_002.phpt
@@ -10,8 +10,8 @@

 try {
     var_dump($a + $o);
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $c = $a + $o;
@@ -20,7 +20,7 @@
 echo "Done\n";
 ?>
 --EXPECTF--
-Exception: Unsupported operand types: array + stdClass
+TypeError: Unsupported operand types: array + stdClass

 Fatal error: Uncaught TypeError: Unsupported operand types: array + stdClass in %s:%d
 Stack trace:
diff --git a/Zend/tests/add_003.phpt b/Zend/tests/add_003.phpt
index 6d27863e893..6472a050bf9 100644
--- a/Zend/tests/add_003.phpt
+++ b/Zend/tests/add_003.phpt
@@ -10,8 +10,8 @@

 try {
     var_dump($o + $a);
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $c = $o + $a;
@@ -20,7 +20,7 @@
 echo "Done\n";
 ?>
 --EXPECTF--
-Exception: Unsupported operand types: stdClass + array
+TypeError: Unsupported operand types: stdClass + array

 Fatal error: Uncaught TypeError: Unsupported operand types: stdClass + array in %s:%d
 Stack trace:
diff --git a/Zend/tests/add_004.phpt b/Zend/tests/add_004.phpt
index 2f16f10eaf5..dbdd26cad75 100644
--- a/Zend/tests/add_004.phpt
+++ b/Zend/tests/add_004.phpt
@@ -7,8 +7,8 @@

 try {
     var_dump($a + 5);
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $c = $a + 5;
@@ -17,7 +17,7 @@
 echo "Done\n";
 ?>
 --EXPECTF--
-Exception: Unsupported operand types: array + int
+TypeError: Unsupported operand types: array + int

 Fatal error: Uncaught TypeError: Unsupported operand types: array + int in %s:%d
 Stack trace:
diff --git a/Zend/tests/add_006.phpt b/Zend/tests/add_006.phpt
index 09945f3fce6..f51397cbec7 100644
--- a/Zend/tests/add_006.phpt
+++ b/Zend/tests/add_006.phpt
@@ -14,8 +14,8 @@
 try {
     $c = $i + $s1;
     var_dump($c);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 $c = $i + $s2;
 var_dump($c);
@@ -29,8 +29,8 @@
 try {
     $c = $s1 + $i;
     var_dump($c);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $c = $s2 + $i;
@@ -45,13 +45,13 @@
 echo "Done\n";
 ?>
 --EXPECTF--
-Unsupported operand types: int + string
+TypeError: Unsupported operand types: int + string

 Warning: A non-numeric value encountered in %s on line %d
 int(951858)
 int(48550510)
 float(75661.68)
-Unsupported operand types: string + int
+TypeError: Unsupported operand types: string + int

 Warning: A non-numeric value encountered in %s on line %d
 int(951858)
diff --git a/Zend/tests/add_007.phpt b/Zend/tests/add_007.phpt
index a2beddfaed4..fb3d5522d5f 100644
--- a/Zend/tests/add_007.phpt
+++ b/Zend/tests/add_007.phpt
@@ -9,8 +9,8 @@

 try {
     var_dump($a + $s1);
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $c = $a + $s1;
@@ -19,7 +19,7 @@
 echo "Done\n";
 ?>
 --EXPECTF--
-Exception: Unsupported operand types: array + string
+TypeError: Unsupported operand types: array + string

 Fatal error: Uncaught TypeError: Unsupported operand types: array + string in %s:%d
 Stack trace:
diff --git a/Zend/tests/arg_unpack/invalid_type.phpt b/Zend/tests/arg_unpack/invalid_type.phpt
index a0e64937152..32c624eee2d 100644
--- a/Zend/tests/arg_unpack/invalid_type.phpt
+++ b/Zend/tests/arg_unpack/invalid_type.phpt
@@ -9,29 +9,29 @@ function test(...$args) {

 try {
     test(...null);
-} catch (Error $e) {
-    echo $e::class . ": " . $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     test(...42);
-} catch (Error $e) {
-    echo $e::class . ": " . $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     test(...new stdClass);
-} catch (Error $e) {
-    echo $e::class . ": " . $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     test(1, 2, 3, ..."foo", ...[4, 5]);
-} catch (Error $e) {
-    echo $e::class . ": " . $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     test(1, 2, 3, ...new StdClass, ...3.14, ...[4, 5]);
-} catch (Error $e) {
-    echo $e::class . ": " . $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
diff --git a/Zend/tests/arg_unpack/non_integer_keys.phpt b/Zend/tests/arg_unpack/non_integer_keys.phpt
index 88e1747df9c..daf7d3c58a7 100644
--- a/Zend/tests/arg_unpack/non_integer_keys.phpt
+++ b/Zend/tests/arg_unpack/non_integer_keys.phpt
@@ -12,10 +12,10 @@ function gen() {

 try {
     foo(...gen());
-} catch (Error $ex) {
-    echo "Exception: " . $ex->getMessage() . "\n";
+} catch (Throwable $ex) {
+    echo $ex::class, ': ', $ex->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Exception: Keys must be of type int|string during argument unpacking
+Error: Keys must be of type int|string during argument unpacking
diff --git a/Zend/tests/arg_unpack/string_keys.phpt b/Zend/tests/arg_unpack/string_keys.phpt
index b0bf366fb38..3d1d1c866d5 100644
--- a/Zend/tests/arg_unpack/string_keys.phpt
+++ b/Zend/tests/arg_unpack/string_keys.phpt
@@ -9,10 +9,10 @@

 try {
     var_dump(...new ArrayIterator([1, 2, "foo" => 3, 4]));
-} catch (Error $ex) {
-    var_dump($ex->getMessage());
+} catch (Throwable $ex) {
+    echo $ex::class, ': ', $ex->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-string(68) "Cannot use positional argument after named argument during unpacking"
+Error: Cannot use positional argument after named argument during unpacking
diff --git a/Zend/tests/arg_unpack/traversable_throwing_exception.phpt b/Zend/tests/arg_unpack/traversable_throwing_exception.phpt
index c78e491e201..25c5da8df29 100644
--- a/Zend/tests/arg_unpack/traversable_throwing_exception.phpt
+++ b/Zend/tests/arg_unpack/traversable_throwing_exception.phpt
@@ -21,13 +21,13 @@ function gen() {

 try {
     test(1, 2, ...new Foo, ...[3, 4]);
-} catch (Exception $e) { var_dump($e->getMessage()); }
+} catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }

 try {
     test(1, 2, ...gen(), ...[3, 4]);
-} catch (Exception $e) { var_dump($e->getMessage()); }
+} catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }

 ?>
 --EXPECT--
-string(11) "getIterator"
-string(3) "gen"
+Exception: getIterator
+Exception: gen
diff --git a/Zend/tests/array_literal_next_element_error.phpt b/Zend/tests/array_literal_next_element_error.phpt
index 23dec5e22ca..33ce9e7c35b 100644
--- a/Zend/tests/array_literal_next_element_error.phpt
+++ b/Zend/tests/array_literal_next_element_error.phpt
@@ -7,18 +7,18 @@
 try {
     $array = [$i => 42, new stdClass];
     var_dump($array);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 function test($x = [PHP_INT_MAX => 42, "foo"]) {}
 try {
     test();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
diff --git a/Zend/tests/array_merge_recursive_next_key_overflow.phpt b/Zend/tests/array_merge_recursive_next_key_overflow.phpt
index f7d28729578..492d06973b4 100644
--- a/Zend/tests/array_merge_recursive_next_key_overflow.phpt
+++ b/Zend/tests/array_merge_recursive_next_key_overflow.phpt
@@ -8,7 +8,7 @@
         ['' => [null]],
     );
 } catch (Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
@@ -17,9 +17,9 @@
         ['foo' => str_repeat('a', 2)],
     );
 } catch (Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
diff --git a/Zend/tests/array_unpack/already_occupied.phpt b/Zend/tests/array_unpack/already_occupied.phpt
index b2febe00215..3f031c082f9 100644
--- a/Zend/tests/array_unpack/already_occupied.phpt
+++ b/Zend/tests/array_unpack/already_occupied.phpt
@@ -8,26 +8,26 @@
 $arr = [1, 2, 3];
 try {
     var_dump([PHP_INT_MAX-1 => 0, ...$arr]);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     var_dump([PHP_INT_MAX-1 => 0, ...[1, 2, 3]]);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 const ARR = [1, 2, 3];
 function test($x = [PHP_INT_MAX-1 => 0, ...ARR]) {}
 try {
     test();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
diff --git a/Zend/tests/array_unpack/classes.phpt b/Zend/tests/array_unpack/classes.phpt
index fa4b0f8e536..7a1f9555233 100644
--- a/Zend/tests/array_unpack/classes.phpt
+++ b/Zend/tests/array_unpack/classes.phpt
@@ -19,8 +19,8 @@ class D {

 try {
     var_dump(D::A);
-} catch (Error $ex) {
-    echo "Exception: " . $ex->getMessage() . "\n";
+} catch (Throwable $ex) {
+    echo $ex::class, ': ', $ex->getMessage(), "\n";
 }
 ?>
 --EXPECT--
@@ -44,4 +44,4 @@ class D {
   [2]=>
   int(3)
 }
-Exception: Cannot declare self-referencing constant self::B
+Error: Cannot declare self-referencing constant self::B
diff --git a/Zend/tests/array_unpack/non_integer_keys.phpt b/Zend/tests/array_unpack/non_integer_keys.phpt
index ab7a20ac86b..099a928ffdd 100644
--- a/Zend/tests/array_unpack/non_integer_keys.phpt
+++ b/Zend/tests/array_unpack/non_integer_keys.phpt
@@ -9,10 +9,10 @@ function gen() {

 try {
     [...gen()];
-} catch (Error $ex) {
-    echo "Exception: " . $ex->getMessage() . "\n";
+} catch (Throwable $ex) {
+    echo $ex::class, ': ', $ex->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Exception: 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/arrow_functions/006.phpt b/Zend/tests/arrow_functions/006.phpt
index 6f61b3c817d..15e1d18d7e0 100644
--- a/Zend/tests/arrow_functions/006.phpt
+++ b/Zend/tests/arrow_functions/006.phpt
@@ -16,23 +16,23 @@
 var_dump($int_fn($var));
 try {
     $int_fn("foo");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $varargs = fn(?int... $args): array => $args;
 var_dump($varargs(20, null, 30));
 try {
     $varargs(40, "foo");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
 int(2)
 int(10)
-{closure:%s:%d}(): Argument #1 ($x) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($x) must be of type int, string given, called in %s on line %d
 array(3) {
   [0]=>
   int(20)
@@ -41,4 +41,4 @@
   [2]=>
   int(30)
 }
-{closure:%s:%d}(): Argument #2 must be of type ?int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #2 must be of type ?int, string given, called in %s on line %d
diff --git a/Zend/tests/arrow_functions/007.phpt b/Zend/tests/arrow_functions/007.phpt
index 66b03b84c2e..7b63b1ba152 100644
--- a/Zend/tests/arrow_functions/007.phpt
+++ b/Zend/tests/arrow_functions/007.phpt
@@ -7,17 +7,17 @@

 try {
     assert((fn() => false)());
-} catch (AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert((fn&(int... $args): ?bool => $args[0])(false));
-} catch (AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert(): assert((fn() => false)()) failed
-assert(): assert((fn&(int ...$args): ?bool => $args[0])(false)) failed
+AssertionError: assert((fn() => false)())
+AssertionError: assert((fn&(int ...$args): ?bool => $args[0])(false))
diff --git a/Zend/tests/arrow_functions/gh7900.phpt b/Zend/tests/arrow_functions/gh7900.phpt
index d6465c31239..cfe09ba6cc4 100644
--- a/Zend/tests/arrow_functions/gh7900.phpt
+++ b/Zend/tests/arrow_functions/gh7900.phpt
@@ -10,17 +10,17 @@

 try {
     var_dump($x());
-} catch (\Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert((fn(): never => 42) && false);
-} catch (\Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Here
-assert((fn(): never => 42) && false)
+Exception: Here
+AssertionError: assert((fn(): never => 42) && false)
diff --git a/Zend/tests/assert/bug70528.phpt b/Zend/tests/assert/bug70528.phpt
index 717c096fdaa..57aa6706de1 100644
--- a/Zend/tests/assert/bug70528.phpt
+++ b/Zend/tests/assert/bug70528.phpt
@@ -11,21 +11,21 @@ class Bar {}
 $bar = "Bar";
 try {
     assert(new \stdClass instanceof $bar);
-} catch (\AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     assert(new \stdClass instanceof Bar);
-} catch (\AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     assert(new \stdClass instanceof \Foo\Bar);
-} catch (\AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-assert(): assert(new \stdClass() instanceof $bar) failed
-assert(): assert(new \stdClass() instanceof Bar) failed
-assert(): assert(new \stdClass() instanceof \Foo\Bar) failed
+AssertionError: assert(new \stdClass() instanceof $bar)
+AssertionError: assert(new \stdClass() instanceof Bar)
+AssertionError: assert(new \stdClass() instanceof \Foo\Bar)
diff --git a/Zend/tests/assert/bug71922.phpt b/Zend/tests/assert/bug71922.phpt
index 986254cab73..e996b97dba4 100644
--- a/Zend/tests/assert/bug71922.phpt
+++ b/Zend/tests/assert/bug71922.phpt
@@ -10,12 +10,12 @@
     assert(0 && new class {
     } && new class(42) extends stdclass {
     });
-} catch (AssertionError $e) {
-    echo "Assertion failure: ", $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Assertion failure: assert(0 && new class {
+AssertionError: assert(0 && new class {
 } && new class(42) extends stdclass {
 })
diff --git a/Zend/tests/assert/expect_003.phpt b/Zend/tests/assert/expect_003.phpt
index 350fca6e57b..6701718daa8 100644
--- a/Zend/tests/assert/expect_003.phpt
+++ b/Zend/tests/assert/expect_003.phpt
@@ -7,9 +7,9 @@
 <?php
 try {
     assert(false);
-} catch (AssertionError $ex) {
-    var_dump($ex->getMessage());
+} catch (Throwable $ex) {
+    echo $ex::class, ': ', $ex->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(13) "assert(false)"
+AssertionError: assert(false)
diff --git a/Zend/tests/assert/expect_004.phpt b/Zend/tests/assert/expect_004.phpt
index 111e37295fe..c89741d5b3d 100644
--- a/Zend/tests/assert/expect_004.phpt
+++ b/Zend/tests/assert/expect_004.phpt
@@ -7,9 +7,9 @@
 <?php
 try {
     assert(false, "I require this to succeed");
-} catch (AssertionError $ex) {
-    var_dump($ex->getMessage());
+} catch (Throwable $ex) {
+    echo $ex::class, ': ', $ex->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(25) "I require this to succeed"
+AssertionError: I require this to succeed
diff --git a/Zend/tests/assert/expect_005.phpt b/Zend/tests/assert/expect_005.phpt
index f2c91f25666..07747665c56 100644
--- a/Zend/tests/assert/expect_005.phpt
+++ b/Zend/tests/assert/expect_005.phpt
@@ -8,8 +8,8 @@
 try {
     /* by passing we test there are no leaks upon success */
     assert(true, "I require this to succeed");
-} catch (AssertionError $ex) {
-    var_dump($ex->getMessage());
+} catch (Throwable $ex) {
+    echo $ex::class, ': ', $ex->getMessage(), "\n";
 }
 var_dump(true);
 ?>
diff --git a/Zend/tests/assert/expect_015.phpt b/Zend/tests/assert/expect_015.phpt
index 3bb08504f58..5834b99d9da 100644
--- a/Zend/tests/assert/expect_015.phpt
+++ b/Zend/tests/assert/expect_015.phpt
@@ -19,8 +19,8 @@
     yield 1 => 2;
     yield from $x;
 }));
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
@@ -68,8 +68,8 @@ static private function f1() {
         }
     }
 }));
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
@@ -104,8 +104,8 @@ final protected function f2() {
         }
     }
 }));
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
@@ -120,8 +120,8 @@ class A {
         use T3;
     }
 }));
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
@@ -137,8 +137,8 @@ class A {
         echo 3;
     }
 }));
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
@@ -165,13 +165,13 @@ class A {
     }
     if ($a); else;
 }));
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert(0 && ($a = function () {
+AssertionError: assert(0 && ($a = function () {
     global $a;
     global $$b;
     static $c;
@@ -187,7 +187,7 @@ class A {
     yield 1 => 2;
     yield from $x;
 }))
-assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
+AssertionError: assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
     abstract class A extends B implements C, D {
         public const X = 12;
         public const Y = self::X, Z = 'aaa';
@@ -231,7 +231,7 @@ private static function f1() {
     }

 }))
-assert(0 && ($a = function &(array &$a, X $b = null, int|float $c) use($c, &$d): X {
+AssertionError: assert(0 && ($a = function &(array &$a, X $b = null, int|float $c) use($c, &$d): X {
     final class A {
         protected final function f2() {
             if (!$x) {
@@ -270,7 +270,7 @@ protected final function f2() {
     }

 }))
-assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
+AssertionError: assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
     class A {
         use T1, T2 {
             T1::foo insteadof foo;
@@ -282,7 +282,7 @@ class A {
     }

 }))
-assert(0 && ($a = function &(array &...$a) {
+AssertionError: assert(0 && ($a = function &(array &...$a) {
     declare(A = 1, B = 2);
     try {
         $i++;
@@ -294,7 +294,7 @@ class A {
         echo 3;
     }
 }))
-assert(0 && ($a = function (): ?static {
+AssertionError: assert(0 && ($a = function (): ?static {
     declare(C = 1) {
         echo 1;
     }
diff --git a/Zend/tests/assert/expect_016.phpt b/Zend/tests/assert/expect_016.phpt
index 32e8fea9171..ad738aef482 100644
--- a/Zend/tests/assert/expect_016.phpt
+++ b/Zend/tests/assert/expect_016.phpt
@@ -10,8 +10,8 @@
 ini_set("zend.assertions", 1);
 try {
     var_dump(assert(false));
-} catch (AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(assert(true));
 ini_set("zend.assertions", -1);
@@ -19,7 +19,7 @@
 --EXPECTF--
 bool(true)
 bool(true)
-assert(): assert(false) failed
+AssertionError: assert(false)
 bool(true)

 Warning: zend.assertions may be completely enabled or disabled only in php.ini in %s on line %d
diff --git a/Zend/tests/assert/expect_018.phpt b/Zend/tests/assert/expect_018.phpt
index abe74ce2522..7a927d0a65e 100644
--- a/Zend/tests/assert/expect_018.phpt
+++ b/Zend/tests/assert/expect_018.phpt
@@ -14,14 +14,14 @@
 ini_set("zend.assertions", 1);
 try {
     var_dump(\assert(false));
-} catch (\AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(\assert(true));
 try {
     var_dump(assert(false));
-} catch (\AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(assert(true));
 ?>
@@ -30,7 +30,7 @@
 bool(true)
 bool(true)
 bool(true)
-assert(): assert(false) failed
+AssertionError: assert(false)
 bool(true)
-assert(): assert(false) failed
+AssertionError: assert(false)
 bool(true)
diff --git a/Zend/tests/assign_dim_obj_null_return.phpt b/Zend/tests/assign_dim_obj_null_return.phpt
index e2b7f20a0c0..0ee2a93a8b7 100644
--- a/Zend/tests/assign_dim_obj_null_return.phpt
+++ b/Zend/tests/assign_dim_obj_null_return.phpt
@@ -9,61 +9,61 @@ function test() {

     try {
         var_dump($array[] = 123);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         var_dump($array[[]] = 123);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         var_dump($array[new stdClass] = 123);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         var_dump($true[123] = 456);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         var_dump($array[] += 123);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         var_dump($array[[]] += 123);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         var_dump($array[new stdClass] += 123);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         var_dump($true[123] += 456);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         var_dump($true->foo = 123);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         var_dump($true->foo += 123);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -71,13 +71,13 @@ function test() {

 ?>
 --EXPECT--
-Cannot add element to the array as the next element is already occupied
-Cannot access offset of type array on array
-Cannot access offset of type stdClass on array
-Cannot use a scalar value as an array
-Cannot add element to the array as the next element is already occupied
-Cannot access offset of type array on array
-Cannot access offset of type stdClass on array
-Cannot use a scalar value as an array
-Attempt to assign property "foo" on true
-Attempt to assign property "foo" on true
+Error: Cannot add element to the array as the next element is already occupied
+TypeError: Cannot access offset of type array on array
+TypeError: Cannot access offset of type stdClass on array
+Error: Cannot use a scalar value as an array
+Error: Cannot add element to the array as the next element is already occupied
+TypeError: Cannot access offset of type array on array
+TypeError: Cannot access offset of type stdClass on array
+Error: Cannot use a scalar value as an array
+Error: Attempt to assign property "foo" on true
+Error: Attempt to assign property "foo" on true
diff --git a/Zend/tests/assign_op_type_error.phpt b/Zend/tests/assign_op_type_error.phpt
index 5f175613e20..3068e0ca48b 100644
--- a/Zend/tests/assign_op_type_error.phpt
+++ b/Zend/tests/assign_op_type_error.phpt
@@ -6,52 +6,52 @@
 $x = [];
 try {
     $x += "1";
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $x -= "1";
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $x *= "1";
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $x /= "1";
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $x **= "1";
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $x %= "1";
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $x <<= "1";
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $x >>= "1";
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Unsupported operand types: array + string
-Unsupported operand types: array - string
-Unsupported operand types: array * string
-Unsupported operand types: array / string
-Unsupported operand types: array ** string
-Unsupported operand types: array % string
-Unsupported operand types: array << string
-Unsupported operand types: array >> string
+TypeError: Unsupported operand types: array + string
+TypeError: Unsupported operand types: array - string
+TypeError: Unsupported operand types: array * string
+TypeError: Unsupported operand types: array / string
+TypeError: Unsupported operand types: array ** string
+TypeError: Unsupported operand types: array % string
+TypeError: Unsupported operand types: array << string
+TypeError: Unsupported operand types: array >> string
diff --git a/Zend/tests/assign_property_null_object.phpt b/Zend/tests/assign_property_null_object.phpt
index fff2c99f620..622746ba0ee 100644
--- a/Zend/tests/assign_property_null_object.phpt
+++ b/Zend/tests/assign_property_null_object.phpt
@@ -15,8 +15,8 @@ public function a() {

 try {
     $test->a()->a = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 print "ok\n";

@@ -24,5 +24,5 @@ public function a() {
 --EXPECTF--
 Warning: Attempt to read property "a" on null in %s on line %d
 ok
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null
 ok
diff --git a/Zend/tests/assign_ref_error_var_handling.phpt b/Zend/tests/assign_ref_error_var_handling.phpt
index 2a66b68cc54..3fbbcefe337 100644
--- a/Zend/tests/assign_ref_error_var_handling.phpt
+++ b/Zend/tests/assign_ref_error_var_handling.phpt
@@ -11,20 +11,20 @@ function val() {
 $arr = [PHP_INT_MAX => "foo"];
 try {
     var_dump($arr[] =& $var);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(count($arr));
 try {
     var_dump($arr[] =& val());
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(count($arr));

 ?>
 --EXPECT--
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
 int(1)
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
 int(1)
diff --git a/Zend/tests/assign_to_obj_002.phpt b/Zend/tests/assign_to_obj_002.phpt
index a911c06f36d..52541e28e06 100644
--- a/Zend/tests/assign_to_obj_002.phpt
+++ b/Zend/tests/assign_to_obj_002.phpt
@@ -5,8 +5,8 @@

 try {
     $this->a = new stdClass;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }

 ?>
 --EXPECT--
-Using $this when not in object context
+Error: Using $this when not in object context
diff --git a/Zend/tests/ast/ast_serialize_backtick_literal.phpt b/Zend/tests/ast/ast_serialize_backtick_literal.phpt
index 46aa0ebe8ae..85e5dd6fbb6 100644
--- a/Zend/tests/ast/ast_serialize_backtick_literal.phpt
+++ b/Zend/tests/ast/ast_serialize_backtick_literal.phpt
@@ -7,10 +7,10 @@

 try {
     assert(false && `echo -n ""`);
-} catch (AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert(): assert(false && `echo -n ""`) failed
+AssertionError: assert(false && `echo -n ""`)
diff --git a/Zend/tests/ast/ast_serialize_floats.phpt b/Zend/tests/ast/ast_serialize_floats.phpt
index 164b8b03338..73426b0ded3 100644
--- a/Zend/tests/ast/ast_serialize_floats.phpt
+++ b/Zend/tests/ast/ast_serialize_floats.phpt
@@ -6,21 +6,21 @@
 <?php
 try {
     assert(!is_float(0.0));
-} catch (AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     assert(!is_float(1.1));
-} catch (AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     assert(!is_float(1234.5678));
-} catch (AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-assert(): assert(!is_float(0.0)) failed
-assert(): assert(!is_float(1.1)) failed
-assert(): assert(!is_float(1234.5678)) failed
+AssertionError: assert(!is_float(0.0))
+AssertionError: assert(!is_float(1.1))
+AssertionError: assert(!is_float(1234.5678))
diff --git a/Zend/tests/ast/gh21072.phpt b/Zend/tests/ast/gh21072.phpt
index 1ffd0518eae..88b9d0e0030 100644
--- a/Zend/tests/ast/gh21072.phpt
+++ b/Zend/tests/ast/gh21072.phpt
@@ -9,8 +9,8 @@ class C {
         public $p = (unset) C::class;
     }
     new C;
-} catch (Error $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
diff --git a/Zend/tests/ast/zend-pow-assign.phpt b/Zend/tests/ast/zend-pow-assign.phpt
index fd8bf8346ce..98ad319fc7a 100644
--- a/Zend/tests/ast/zend-pow-assign.phpt
+++ b/Zend/tests/ast/zend-pow-assign.phpt
@@ -7,9 +7,9 @@

 try {
     assert(false && ($a **= 2));
-} catch (AssertionError $e) {
-    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-assert(): assert(false && ($a **= 2)) failed
+AssertionError: assert(false && ($a **= 2))
diff --git a/Zend/tests/asymmetric_visibility/__set.phpt b/Zend/tests/asymmetric_visibility/__set.phpt
index 7476f5304e2..17c6aaef1bd 100644
--- a/Zend/tests/asymmetric_visibility/__set.phpt
+++ b/Zend/tests/asymmetric_visibility/__set.phpt
@@ -22,15 +22,15 @@ public function __set(string $name, mixed $value) {
 $foo = new Foo();
 try {
     $foo->bar = 'baz';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $foo->setBar('baz');
 try {
     $foo->bar = 'baz';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $foo->unsetBar();
@@ -38,6 +38,6 @@ public function __set(string $name, mixed $value) {

 ?>
 --EXPECT--
-Cannot modify private(set) property Foo::$bar from global scope
-Cannot modify private(set) property Foo::$bar from global scope
+Error: Cannot modify private(set) property Foo::$bar from global scope
+Error: Cannot modify private(set) property Foo::$bar from global scope
 Foo::Foo::__set
diff --git a/Zend/tests/asymmetric_visibility/__unset.phpt b/Zend/tests/asymmetric_visibility/__unset.phpt
index 3d5977d7978..ca065080bf9 100644
--- a/Zend/tests/asymmetric_visibility/__unset.phpt
+++ b/Zend/tests/asymmetric_visibility/__unset.phpt
@@ -22,8 +22,8 @@ public function __unset($name) {
 function test($foo) {
     try {
         unset($foo->bar);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -41,7 +41,7 @@ function test($foo) {

 ?>
 --EXPECT--
-Cannot unset private(set) property Foo::$bar from global scope
+Error: Cannot unset private(set) property Foo::$bar from global scope
 Foo::__unset
-Cannot unset private(set) property Foo::$bar from global scope
+Error: Cannot unset private(set) property Foo::$bar from global scope
 Foo::__unset
diff --git a/Zend/tests/asymmetric_visibility/ast_printing.phpt b/Zend/tests/asymmetric_visibility/ast_printing.phpt
index 25803e67c09..aabf2a3df2c 100644
--- a/Zend/tests/asymmetric_visibility/ast_printing.phpt
+++ b/Zend/tests/asymmetric_visibility/ast_printing.phpt
@@ -13,13 +13,13 @@ class Foo {
             public protected(set) string $baz;
         }
     } && false);
-} catch (Error $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert(function () {
+AssertionError: assert(function () {
     class Foo {
         public private(set) string $bar;
         public protected(set) string $baz;
diff --git a/Zend/tests/asymmetric_visibility/bug001.phpt b/Zend/tests/asymmetric_visibility/bug001.phpt
index c306434d610..28c4e9c8c62 100644
--- a/Zend/tests/asymmetric_visibility/bug001.phpt
+++ b/Zend/tests/asymmetric_visibility/bug001.phpt
@@ -19,14 +19,14 @@ public function __unset($name) {
 $c = new D();
 try {
     unset($c->a);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($c);

 ?>
 --EXPECTF--
-Cannot unset private(set) property C::$a from scope D
+Error: Cannot unset private(set) property C::$a from scope D
 object(D)#%d (0) {
   ["a"]=>
   uninitialized(int)
diff --git a/Zend/tests/asymmetric_visibility/bug002.phpt b/Zend/tests/asymmetric_visibility/bug002.phpt
index 1f6dc2b8527..bca8864f29f 100644
--- a/Zend/tests/asymmetric_visibility/bug002.phpt
+++ b/Zend/tests/asymmetric_visibility/bug002.phpt
@@ -19,14 +19,14 @@ public function __set($name, $value) {
 $c = new D();
 try {
     $c->a = 2;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($c);

 ?>
 --EXPECTF--
-Cannot modify private(set) property C::$a from scope D
+Error: Cannot modify private(set) property C::$a from scope D
 object(D)#%d (0) {
   ["a"]=>
   uninitialized(int)
diff --git a/Zend/tests/asymmetric_visibility/bug003.phpt b/Zend/tests/asymmetric_visibility/bug003.phpt
index 9f541f87f7c..af840222be7 100644
--- a/Zend/tests/asymmetric_visibility/bug003.phpt
+++ b/Zend/tests/asymmetric_visibility/bug003.phpt
@@ -13,16 +13,16 @@ public function __construct() {
 $c = new C();
 try {
     $c->a = 2;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     unset($c->a);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot modify private(set) property C::$a from global scope
-Cannot unset private(set) property C::$a from global scope
+Error: Cannot modify private(set) property C::$a from global scope
+Error: Cannot unset private(set) property C::$a from global scope
diff --git a/Zend/tests/asymmetric_visibility/cpp_private.phpt b/Zend/tests/asymmetric_visibility/cpp_private.phpt
index c308330d3ab..4430f88f4f9 100644
--- a/Zend/tests/asymmetric_visibility/cpp_private.phpt
+++ b/Zend/tests/asymmetric_visibility/cpp_private.phpt
@@ -18,8 +18,8 @@ public function setBar($bar) {

 try {
     $foo->bar = 'baz';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $foo->setBar('baz');
@@ -28,5 +28,5 @@ public function setBar($bar) {
 ?>
 --EXPECT--
 string(3) "bar"
-Cannot modify private(set) property Foo::$bar from global scope
+Error: Cannot modify private(set) property Foo::$bar from global scope
 string(3) "baz"
diff --git a/Zend/tests/asymmetric_visibility/cpp_protected.phpt b/Zend/tests/asymmetric_visibility/cpp_protected.phpt
index f13351e3200..5cb6be2c99a 100644
--- a/Zend/tests/asymmetric_visibility/cpp_protected.phpt
+++ b/Zend/tests/asymmetric_visibility/cpp_protected.phpt
@@ -24,8 +24,8 @@ public function setBarProtected($bar) {

 try {
     $foo->bar = 'baz';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $foo->setBarPrivate('baz');
@@ -37,6 +37,6 @@ public function setBarProtected($bar) {
 ?>
 --EXPECT--
 string(3) "bar"
-Cannot modify protected(set) property Foo::$bar from global scope
+Error: Cannot modify protected(set) property Foo::$bar from global scope
 string(3) "baz"
 string(3) "qux"
diff --git a/Zend/tests/asymmetric_visibility/dim_add.phpt b/Zend/tests/asymmetric_visibility/dim_add.phpt
index f7bf0ceaf93..9038f1d3186 100644
--- a/Zend/tests/asymmetric_visibility/dim_add.phpt
+++ b/Zend/tests/asymmetric_visibility/dim_add.phpt
@@ -15,8 +15,8 @@ public function addBar($bar) {

 try {
     $foo->bars[] = 'baz';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($foo->bars);

@@ -25,7 +25,7 @@ public function addBar($bar) {

 ?>
 --EXPECT--
-Cannot indirectly modify private(set) property Foo::$bars from global scope
+Error: Cannot indirectly modify private(set) property Foo::$bars from global scope
 array(0) {
 }
 array(1) {
diff --git a/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt b/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt
index 2e24ad1f8d0..96c08c840dc 100644
--- a/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt
+++ b/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt
@@ -14,8 +14,8 @@ public function test() {
         var_dump($this->prop);
         try {
             $this->prop = 'overwritten';
-        } catch (Error $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
         var_dump($this->prop);
     }
@@ -27,8 +27,8 @@ public function test() {
 ?>
 --EXPECT--
 string(7) "default"
-Cannot modify private(set) property P::$prop from scope C
+Error: Cannot modify private(set) property P::$prop from scope C
 string(7) "default"
 string(7) "default"
-Cannot modify private(set) property P::$prop from scope C
+Error: Cannot modify private(set) property P::$prop from scope C
 string(7) "default"
diff --git a/Zend/tests/asymmetric_visibility/private.phpt b/Zend/tests/asymmetric_visibility/private.phpt
index 48e557c6e87..bcdb33b39ff 100644
--- a/Zend/tests/asymmetric_visibility/private.phpt
+++ b/Zend/tests/asymmetric_visibility/private.phpt
@@ -28,8 +28,8 @@ public function modifyBar($bar) {

 try {
     $foo->bar = 'baz';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $foo->setBar('baz');
@@ -37,8 +37,8 @@ public function modifyBar($bar) {

 try {
     $foo->baz = 'baz2';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $foo->setBaz('baz2');
@@ -47,15 +47,15 @@ public function modifyBar($bar) {
 $child = new FooChild();
 try {
     $child->modifyBar('baz');
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 string(3) "bar"
-Cannot modify private(set) property Foo::$bar from global scope
+Error: Cannot modify private(set) property Foo::$bar from global scope
 string(3) "baz"
-Cannot modify private(set) property Foo::$baz from global scope
+Error: Cannot modify private(set) property Foo::$baz from global scope
 string(4) "baz2"
-Cannot modify private(set) property Foo::$bar from scope FooChild
+Error: Cannot modify private(set) property Foo::$bar from scope FooChild
diff --git a/Zend/tests/asymmetric_visibility/protected.phpt b/Zend/tests/asymmetric_visibility/protected.phpt
index 49a39b39936..9c79752c23c 100644
--- a/Zend/tests/asymmetric_visibility/protected.phpt
+++ b/Zend/tests/asymmetric_visibility/protected.phpt
@@ -32,8 +32,8 @@ public function setBazProtected($baz) {

 try {
     $foo->bar = 'baz';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $foo->setBarPrivate('baz');
@@ -44,8 +44,8 @@ public function setBazProtected($baz) {

 try {
     $foo->baz = 'baz';
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $foo->setbazPrivate('baz2');
@@ -58,9 +58,9 @@ public function setBazProtected($baz) {
 ?>
 --EXPECT--
 string(3) "bar"
-Cannot modify protected(set) property Foo::$bar from global scope
+Error: Cannot modify protected(set) property Foo::$bar from global scope
 string(3) "baz"
 string(3) "qux"
-Cannot modify protected(set) property Foo::$baz from global scope
+Error: Cannot modify protected(set) property Foo::$baz from global scope
 string(4) "baz2"
 string(4) "baz3"
diff --git a/Zend/tests/asymmetric_visibility/readonly.phpt b/Zend/tests/asymmetric_visibility/readonly.phpt
index e02d3690799..d8ae18bb1be 100644
--- a/Zend/tests/asymmetric_visibility/readonly.phpt
+++ b/Zend/tests/asymmetric_visibility/readonly.phpt
@@ -22,8 +22,8 @@ public function __construct() {
         $this->pDefault = 1;
         try {
             $this->pPrivate = 1;
-        } catch (Error $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
         $this->pProtected = 1;
         $this->pPublic = 1;
@@ -34,18 +34,18 @@ function test() {
     $p = new ReflectionClass(P::class)->newInstanceWithoutConstructor();
     try {
         $p->pDefault = 1;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         $p->pPrivate = 1;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         $p->pProtected = 1;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     $p->pPublic = 1;
 }
@@ -56,7 +56,7 @@ function test() {

 ?>
 --EXPECT--
-Cannot modify private(set) property P::$pPrivate from scope C
-Cannot modify protected(set) readonly property P::$pDefault from global scope
-Cannot modify private(set) property P::$pPrivate from global scope
-Cannot modify protected(set) readonly property P::$pProtected from global scope
+Error: Cannot modify private(set) property P::$pPrivate from scope C
+Error: Cannot modify protected(set) readonly property P::$pDefault from global scope
+Error: Cannot modify private(set) property P::$pPrivate from global scope
+Error: Cannot modify protected(set) readonly property P::$pProtected from global scope
diff --git a/Zend/tests/asymmetric_visibility/reference.phpt b/Zend/tests/asymmetric_visibility/reference.phpt
index ae527141828..34c0324b988 100644
--- a/Zend/tests/asymmetric_visibility/reference.phpt
+++ b/Zend/tests/asymmetric_visibility/reference.phpt
@@ -17,8 +17,8 @@ public function test() {
 try {
     $bar = &$foo->bar;
     $bar++;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($foo->bar);

@@ -27,6 +27,6 @@ public function test() {

 ?>
 --EXPECT--
-Cannot indirectly modify private(set) property Foo::$bar from global scope
+Error: Cannot indirectly modify private(set) property Foo::$bar from global scope
 int(0)
 int(1)
diff --git a/Zend/tests/asymmetric_visibility/reference_2.phpt b/Zend/tests/asymmetric_visibility/reference_2.phpt
index d4ef6c03a78..ba5c0e5ac2b 100644
--- a/Zend/tests/asymmetric_visibility/reference_2.phpt
+++ b/Zend/tests/asymmetric_visibility/reference_2.phpt
@@ -14,17 +14,17 @@ function test($c) {

 try {
     test(new C());
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     test(new C());
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot indirectly modify private(set) property C::$prop from global scope
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
diff --git a/Zend/tests/asymmetric_visibility/scope_rebinding.phpt b/Zend/tests/asymmetric_visibility/scope_rebinding.phpt
index 8c10d10f77a..4351e8796e5 100644
--- a/Zend/tests/asymmetric_visibility/scope_rebinding.phpt
+++ b/Zend/tests/asymmetric_visibility/scope_rebinding.phpt
@@ -18,19 +18,19 @@ class Bar {}
 var_dump($foo->bar);
 try {
     $c();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     ($c->bindTo(null, Bar::class))();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($foo->bar);

 ?>
 --EXPECT--
 int(2)
-Cannot modify private(set) property Foo::$bar from global scope
-Cannot modify private(set) property Foo::$bar from scope Bar
+Error: Cannot modify private(set) property Foo::$bar from global scope
+Error: Cannot modify private(set) property Foo::$bar from scope Bar
 int(2)
diff --git a/Zend/tests/asymmetric_visibility/static_props.phpt b/Zend/tests/asymmetric_visibility/static_props.phpt
index f47dcf70b6f..1bba69bebd4 100644
--- a/Zend/tests/asymmetric_visibility/static_props.phpt
+++ b/Zend/tests/asymmetric_visibility/static_props.phpt
@@ -29,8 +29,8 @@ function test() {

     try {
         C::$prop = 2;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump(C::$prop);

@@ -39,30 +39,30 @@ function test() {

     try {
         ++C::$prop;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump(C::$prop);

     try {
         C::$prop++;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump(C::$prop);

     try {
         C::$prop += str_repeat('a', 10);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump(C::$prop);

     try {
         $ref = &C::$prop;
         $ref++;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump(C::$prop);

@@ -70,15 +70,15 @@ function test() {
         $ref = 4;
         C::$prop = &$ref;
         $ref++;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump(C::$prop);

     try {
         C::$prop2[] = 'foo';
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump(C::$prop2);

@@ -97,20 +97,20 @@ function test() {

 ?>
 --EXPECTF--
-Cannot modify private(set) property C::$prop from global scope
+Error: Cannot modify private(set) property C::$prop from global scope
 int(1)
 int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
 int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
 int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
 int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
 int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
 int(3)
-Cannot indirectly modify private(set) property C::$prop2 from global scope
+Error: Cannot indirectly modify private(set) property C::$prop2 from global scope
 array(0) {
 }
 array(1) {
@@ -123,20 +123,20 @@ function test() {
 }

 Repeat:
-Cannot modify private(set) property C::$prop from global scope
+Error: Cannot modify private(set) property C::$prop from global scope
 int(1)
 int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
 int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
 int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
 int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
 int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
 int(3)
-Cannot indirectly modify private(set) property C::$prop2 from global scope
+Error: Cannot indirectly modify private(set) property C::$prop2 from global scope
 array(0) {
 }
 array(1) {
diff --git a/Zend/tests/asymmetric_visibility/unset.phpt b/Zend/tests/asymmetric_visibility/unset.phpt
index 3fd3d767308..039bdb84bb4 100644
--- a/Zend/tests/asymmetric_visibility/unset.phpt
+++ b/Zend/tests/asymmetric_visibility/unset.phpt
@@ -36,8 +36,8 @@ public function unsetSecret() {
 $foo->setBar('bar');
 try {
     unset($foo->bar);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($foo->bar ?? 'unset');

@@ -52,16 +52,16 @@ public function unsetSecret() {
 $foo->setSecret('beep');
 try {
     $foo->unsetSecret();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($foo->secret ?? 'unset');

 ?>
 --EXPECT--
-Cannot unset protected(set) property Foo::$bar from global scope
+Error: Cannot unset protected(set) property Foo::$bar from global scope
 string(3) "bar"
 string(5) "unset"
 string(5) "unset"
-Cannot unset private(set) property Foo::$secret from scope FooChild
+Error: Cannot unset private(set) property Foo::$secret from scope FooChild
 string(4) "beep"
diff --git a/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt b/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt
index d81f4d3891b..9c57c85a30a 100644
--- a/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt
+++ b/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt
@@ -17,20 +17,20 @@ public function setBar($bar) {
 $c = new C();
 try {
     $c->setBar(1);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $c->setBar(1);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($c);

 ?>
 --EXPECTF--
-Typed property P::$bar must not be accessed before initialization
-Typed property P::$bar must not be accessed before initialization
+Error: Typed property P::$bar must not be accessed before initialization
+Error: Typed property P::$bar must not be accessed before initialization
 object(C)#%d (0) {
   ["bar"]=>
   uninitialized(string)
diff --git a/Zend/tests/attributes/003_ast_nodes.phpt b/Zend/tests/attributes/003_ast_nodes.phpt
index 854edf3d63c..2d47a89e78b 100644
--- a/Zend/tests/attributes/003_ast_nodes.phpt
+++ b/Zend/tests/attributes/003_ast_nodes.phpt
@@ -71,14 +71,14 @@ public function __construct() { }

 try {
     $attr[0]->getArguments();
-} catch (\Error $e) {
-    var_dump($e->getMessage());
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $attr[0]->newInstance();
-} catch (\Error $e) {
-    var_dump($e->getMessage());
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -104,5 +104,5 @@ public function __construct() { }
 }

 int(1)
-string(30) "Class "MissingClass" not found"
-string(30) "Class "MissingClass" not found"
+Error: Class "MissingClass" not found
+Error: Class "MissingClass" not found
diff --git a/Zend/tests/attributes/005_objects.phpt b/Zend/tests/attributes/005_objects.phpt
index 2b08db838b2..4e0bd69ce3c 100644
--- a/Zend/tests/attributes/005_objects.phpt
+++ b/Zend/tests/attributes/005_objects.phpt
@@ -30,8 +30,8 @@ public function __construct(string $name, int $ttl = 50)

 try {
     $ref->getAttributes()[0]->newInstance();
-} catch (\ArgumentCountError $e) {
-    var_dump('ERROR 1', $e->getMessage());
+} catch (\Throwable $e) {
+    echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n";
@@ -40,8 +40,8 @@ public function __construct(string $name, int $ttl = 50)

 try {
     $ref->getAttributes()[0]->newInstance();
-} catch (\TypeError $e) {
-    var_dump('ERROR 2', $e->getMessage());
+} catch (\Throwable $e) {
+    echo 'ERROR 2: ', $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n";
@@ -50,8 +50,8 @@ public function __construct(string $name, int $ttl = 50)

 try {
     $ref->getAttributes()[0]->newInstance();
-} catch (\Error $e) {
-    var_dump('ERROR 3', $e->getMessage());
+} catch (\Throwable $e) {
+    echo 'ERROR 3: ', $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n";
@@ -66,8 +66,8 @@ private function __construct() { }

 try {
     $ref->getAttributes()[0]->newInstance();
-} catch (\Error $e) {
-    var_dump('ERROR 4', $e->getMessage());
+} catch (\Throwable $e) {
+    echo 'ERROR 4: ', $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n";
@@ -78,8 +78,8 @@ class A5 { }

 try {
     $ref->getAttributes()[0]->newInstance();
-} catch (\Error $e) {
-    var_dump('ERROR 6', $e->getMessage());
+} catch (\Throwable $e) {
+    echo 'ERROR 6: ', $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -88,17 +88,12 @@ class A5 { }
 string(4) "test"
 int(50)

-string(7) "ERROR 1"
-string(%d) "Too few arguments to function A1::__construct(), 0 passed in %s005_objects.php on line 26 and at least 1 expected"
+ERROR 1: ArgumentCountError: Too few arguments to function A1::__construct(), 0 passed in %s005_objects.php on line 26 and at least 1 expected

-string(7) "ERROR 2"
-string(%d) "A1::__construct(): Argument #1 ($name) must be of type string, array given, called in %s005_objects.php on line 36"
+ERROR 2: TypeError: A1::__construct(): Argument #1 ($name) must be of type string, array given, called in %s005_objects.php on line 36

-string(7) "ERROR 3"
-string(30) "Attribute class "A2" not found"
+ERROR 3: Error: Attribute class "A2" not found

-string(7) "ERROR 4"
-string(51) "Call to private A3::__construct() from global scope"
+ERROR 4: Error: Call to private A3::__construct() from global scope

-string(7) "ERROR 6"
-string(55) "Attempting to use non-attribute class "A5" as attribute"
+ERROR 6: Error: Attempting to use non-attribute class "A5" as attribute
diff --git a/Zend/tests/attributes/006_filter.phpt b/Zend/tests/attributes/006_filter.phpt
index 2924e6ed798..badbe9f9a5b 100644
--- a/Zend/tests/attributes/006_filter.phpt
+++ b/Zend/tests/attributes/006_filter.phpt
@@ -56,16 +56,16 @@ class A3 extends A2 { }

 try {
     $ref->getAttributes(A1::class, 3);
-} catch (\Error $e) {
-    var_dump('ERROR 1', $e->getMessage());
+} catch (\Throwable $e) {
+    echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n";
 }

 $ref = new \ReflectionFunction(function () { });

 try {
     $ref->getAttributes(SomeMissingClass::class, \ReflectionAttribute::IS_INSTANCEOF);
-} catch (\Error $e) {
-    var_dump('ERROR 2', $e->getMessage());
+} catch (\Throwable $e) {
+    echo 'ERROR 2: ', $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -106,7 +106,5 @@ class A3 extends A2 { }
     [2] => A3
 )

-string(7) "ERROR 1"
-string(103) "ReflectionFunctionAbstract::getAttributes(): Argument #2 ($flags) must be a valid attribute filter flag"
-string(7) "ERROR 2"
-string(34) "Class "SomeMissingClass" not found"
+ERROR 1: ValueError: ReflectionFunctionAbstract::getAttributes(): Argument #2 ($flags) must be a valid attribute filter flag
+ERROR 2: Error: Class "SomeMissingClass" not found
diff --git a/Zend/tests/attributes/013_class_scope.phpt b/Zend/tests/attributes/013_class_scope.phpt
index ff16bb7b822..d3991ad9f1c 100644
--- a/Zend/tests/attributes/013_class_scope.phpt
+++ b/Zend/tests/attributes/013_class_scope.phpt
@@ -46,8 +46,8 @@ class C2

 try {
     $attr->getArguments();
-} catch (\Error $e) {
-    var_dump('ERROR 1', $e->getMessage());
+} catch (\Throwable $e) {
+    echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n";
@@ -108,8 +108,7 @@ public function bar() { }
     [0] => C2
     [1] => bar
 )
-string(7) "ERROR 1"
-string(28) "Undefined constant self::FOO"
+ERROR 1: Error: Undefined constant self::FOO

 bool(true)
 string(3) "bar"
diff --git a/Zend/tests/attributes/020_userland_attribute_validation.phpt b/Zend/tests/attributes/020_userland_attribute_validation.phpt
index ce2acb26db1..008a892c707 100644
--- a/Zend/tests/attributes/020_userland_attribute_validation.phpt
+++ b/Zend/tests/attributes/020_userland_attribute_validation.phpt
@@ -20,7 +20,7 @@ class A1 { }
 try {
     $attr->newInstance();
 } catch (\Throwable $e) {
-    var_dump('ERROR 1', $e->getMessage());
+    echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n";
@@ -32,7 +32,7 @@ class A1 { }
 try {
     $attr->newInstance();
 } catch (\Throwable $e) {
-    var_dump('ERROR 2', $e->getMessage());
+    echo 'ERROR 2: ', $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n";
@@ -55,14 +55,12 @@ class A2 { }
 string(2) "A1"
 bool(true)
 bool(false)
-string(7) "ERROR 1"
-string(70) "Attribute "A1" cannot target class (allowed targets: function, method)"
+ERROR 1: Error: Attribute "A1" cannot target class (allowed targets: function, method)

 string(2) "A1"
 bool(true)
 bool(true)
-string(7) "ERROR 2"
-string(35) "Attribute "A1" must not be repeated"
+ERROR 2: Error: Attribute "A1" must not be repeated

 string(2) "A2"
 bool(true)
diff --git a/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt b/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt
index 70e4fdb7f33..fbcb598d135 100644
--- a/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt
+++ b/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt
@@ -11,10 +11,10 @@ class Foo {}

 try {
     (new ReflectionClass(Foo::class))->getAttributes()[0]->newInstance();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Attribute::__construct(): Argument #1 ($flags) must be of type int, string given
+Error: Attribute::__construct(): Argument #1 ($flags) must be of type int, string given
diff --git a/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt b/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt
index efaa969af82..d06b92aad79 100644
--- a/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt
+++ b/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt
@@ -11,10 +11,10 @@ class Foo { }

 try {
     var_dump((new ReflectionClass(Foo::class))->getAttributes()[0]->newInstance());
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Invalid attribute flags specified
+Error: Invalid attribute flags specified
diff --git a/Zend/tests/attributes/023_ast_node_in_validation.phpt b/Zend/tests/attributes/023_ast_node_in_validation.phpt
index 063a6b7e815..10b2101d174 100644
--- a/Zend/tests/attributes/023_ast_node_in_validation.phpt
+++ b/Zend/tests/attributes/023_ast_node_in_validation.phpt
@@ -11,10 +11,10 @@ class Bar { }

 try {
     var_dump((new ReflectionClass(Bar::class))->getAttributes()[0]->newInstance());
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Class "Foo" not found
+Error: Class "Foo" not found
diff --git a/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt b/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt
index b1efb538b32..43ff78e0720 100644
--- a/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt
@@ -65,8 +65,8 @@ function demoFn() {
 	var_dump($attributes);
 	try {
 		$attributes[1]->newInstance();
-	} catch (Error $e) {
-		echo get_class($e) . ": " . $e->getMessage() . "\n";
+	} catch (Throwable $e) {
+		echo $e::class, ': ', $e->getMessage(), "\n";
 	}
 }

diff --git a/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt b/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt
index 68d1ae43bd4..7fd5ef63b40 100644
--- a/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt
@@ -19,8 +19,8 @@
 var_dump($attributes);
 try {
 	$attributes[1]->newInstance();
-} catch (Error $e) {
-	echo get_class($e) . ": " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
diff --git a/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt b/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt
index 63add9e445a..57063a55fba 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt
@@ -32,8 +32,8 @@ enum DemoEnum {}
 	var_dump($attributes);
 	try {
 		$attributes[1]->newInstance();
-	} catch (Error $e) {
-		echo get_class($e) . ": " . $e->getMessage() . "\n";
+	} catch (Throwable $e) {
+		echo $e::class, ': ', $e->getMessage(), "\n";
 	}
 }

diff --git a/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt b/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt
index 0571024f19c..ad618c84aca 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt
@@ -32,8 +32,8 @@ enum DemoEnum {}
 	var_dump($attributes);
 	try {
 		$attributes[1]->newInstance();
-	} catch (Error $e) {
-		echo get_class($e) . ": " . $e->getMessage() . "\n";
+	} catch (Throwable $e) {
+		echo $e::class, ': ', $e->getMessage(), "\n";
 	}
 }

diff --git a/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt b/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt
index f5fedb4ee68..8e0e6f4fbf3 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt
@@ -27,8 +27,8 @@ enum DemoEnum {}
 	var_dump($attributes);
 	try {
 		$attributes[1]->newInstance();
-	} catch (Error $e) {
-		echo get_class($e) . ": " . $e->getMessage() . "\n";
+	} catch (Throwable $e) {
+		echo $e::class, ': ', $e->getMessage(), "\n";
 	}
 }

diff --git a/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt b/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt
index e3cfe9d1c10..3009315b6c4 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt
@@ -25,8 +25,8 @@ class DemoClass {
 	var_dump($attributes);
 	try {
 		$attributes[1]->newInstance();
-	} catch (Error $e) {
-		echo get_class($e) . ": " . $e->getMessage() . "\n";
+	} catch (Throwable $e) {
+		echo $e::class, ': ', $e->getMessage(), "\n";
 	}
 }

diff --git a/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt b/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt
index ab84d472422..97fdf986d28 100644
--- a/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt
+++ b/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt
@@ -20,17 +20,17 @@ class Clazz {

 try {
 	Clazz::TEST;
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	Clazz::TEST3;
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Caught: Constant Clazz::TEST is deprecated, from itself
-Caught: Constant Clazz::TEST2 is deprecated
+ErrorException: Constant Clazz::TEST is deprecated, from itself
+ErrorException: Constant Clazz::TEST2 is deprecated
diff --git a/Zend/tests/attributes/deprecated/constants/const_messages.phpt b/Zend/tests/attributes/deprecated/constants/const_messages.phpt
index 1cf8b11af15..2ced4e06fd2 100644
--- a/Zend/tests/attributes/deprecated/constants/const_messages.phpt
+++ b/Zend/tests/attributes/deprecated/constants/const_messages.phpt
@@ -46,4 +46,3 @@

 Deprecated: Constant DeprecatedConst6 is deprecated since 1.0 in %s on line %d
 6
-
diff --git a/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt
index f749293d8fa..6d12af0f241 100644
--- a/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt
+++ b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt
@@ -18,17 +18,17 @@

 try {
 	TEST;
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	TEST3;
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Caught: Constant TEST is deprecated, from itself
-Caught: Constant TEST2 is deprecated
+ErrorException: Constant TEST is deprecated, from itself
+ErrorException: Constant TEST2 is deprecated
diff --git a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt
index af816aea6c4..e4d1c4807d7 100644
--- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt
+++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt
@@ -14,8 +14,8 @@ function test() {

 try {
 	test();
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 eval(<<<'CODE'
@@ -27,8 +27,8 @@ function test2() {

 try {
 	test2();
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 class Clazz {
@@ -41,8 +41,8 @@ function test() {
 try {
 	$cls = new Clazz();
 	$cls->test();
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $closure = #[\Deprecated("convert to exception")] function () {
@@ -51,8 +51,8 @@ function test() {

 try {
 	$closure();
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 class Constructor {
@@ -64,8 +64,8 @@ public function __construct() {

 try {
 	new Constructor();
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 class Destructor {
@@ -77,15 +77,15 @@ public function __destruct() {

 try {
 	new Destructor();
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
-Caught: Function test() is deprecated, convert to exception
-Caught: Function test2() is deprecated, convert to exception
-Caught: Method Clazz::test() is deprecated, convert to exception
-Caught: Function {closure:%s:%d}() is deprecated, convert to exception
-Caught: Method Constructor::__construct() is deprecated, convert to exception
-Caught: Method Destructor::__destruct() is deprecated, convert to exception
+ErrorException: Function test() is deprecated, convert to exception
+ErrorException: Function test2() is deprecated, convert to exception
+ErrorException: Method Clazz::test() is deprecated, convert to exception
+ErrorException: Function {closure:%s:%d}() is deprecated, convert to exception
+ErrorException: Method Constructor::__construct() is deprecated, convert to exception
+ErrorException: Method Destructor::__destruct() is deprecated, convert to exception
diff --git a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt
index 3c9c9ec952f..0b8395aaae6 100644
--- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt
+++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt
@@ -12,10 +12,10 @@ function test() {}

 try {
 	$x = test();
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Caught: Function test() is deprecated
+ErrorException: Function test() is deprecated
diff --git a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt
index 734a30795e5..00efe2b6963 100644
--- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt
+++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt
@@ -12,10 +12,10 @@ function test($dummy) {}

 try {
 	$x = test(new stdClass());
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Caught: Function test() is deprecated
+ErrorException: Function test() is deprecated
diff --git a/Zend/tests/attributes/nodiscard/002.phpt b/Zend/tests/attributes/nodiscard/002.phpt
index 618aa2f6286..c690212a52a 100644
--- a/Zend/tests/attributes/nodiscard/002.phpt
+++ b/Zend/tests/attributes/nodiscard/002.phpt
@@ -41,4 +41,3 @@ public function __invoke(string $param): int {

 Warning: The return value of method Clazz::__invoke() should either be used or intentionally ignored by casting it as (void) in %s on line %d
 __invoke(foo)
-
diff --git a/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt b/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt
index 51179b26ab1..0a8d2f8bbe7 100644
--- a/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt
+++ b/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt
@@ -14,8 +14,8 @@ function test(): int {

 try {
 	test();
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 #[\NoDiscard]
@@ -25,11 +25,11 @@ function test2(): stdClass {

 try {
 	test2();
-} catch (ErrorException $e) {
-	echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Caught: The return value of function test() should either be used or intentionally ignored by casting it as (void)
-Caught: The return value of function test2() should either be used or intentionally ignored by casting it as (void)
+ErrorException: The return value of function test() should either be used or intentionally ignored by casting it as (void)
+ErrorException: The return value of function test2() should either be used or intentionally ignored by casting it as (void)
diff --git a/Zend/tests/attributes/ossfuzz371445205.phpt b/Zend/tests/attributes/ossfuzz371445205.phpt
index 17e4f529a2a..1959affaca6 100644
--- a/Zend/tests/attributes/ossfuzz371445205.phpt
+++ b/Zend/tests/attributes/ossfuzz371445205.phpt
@@ -9,9 +9,9 @@ class Test1{}
 $attr=(new ReflectionClass(Test1::class))->getAttributes()[0];
 try {
     $attr->newInstance();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Unknown named parameter $notinterned
+Error: Unknown named parameter $notinterned
diff --git a/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt b/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt
index f6ea383c397..82f75742c77 100644
--- a/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt
+++ b/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt
@@ -5,4 +5,3 @@
 debug_print_backtrace();
 ?>
 --EXPECT--
-
diff --git a/Zend/tests/bind_static_exception.phpt b/Zend/tests/bind_static_exception.phpt
index c374130aaec..5cf68904760 100644
--- a/Zend/tests/bind_static_exception.phpt
+++ b/Zend/tests/bind_static_exception.phpt
@@ -10,9 +10,9 @@ function __destruct() {
 try {
     $new = new Test;
     static $new;
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Foo
+Exception: Foo
diff --git a/Zend/tests/bitwise_not_precision_exception.phpt b/Zend/tests/bitwise_not_precision_exception.phpt
index e28bf8f4e17..c8b0c44c180 100644
--- a/Zend/tests/bitwise_not_precision_exception.phpt
+++ b/Zend/tests/bitwise_not_precision_exception.phpt
@@ -7,9 +7,9 @@
 });
 try {
     var_dump(~INF);
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-The float INF is not representable as an int, cast occurred
+Exception: The float INF is not representable as an int, cast occurred
diff --git a/Zend/tests/bug26229.phpt b/Zend/tests/bug26229.phpt
index 5914b977ef5..d25fc7fcd5d 100644
--- a/Zend/tests/bug26229.phpt
+++ b/Zend/tests/bug26229.phpt
@@ -19,10 +19,10 @@ public function getIterator() {
         var_dump($value);
     }
 }
-catch(Exception $e)
+catch(Throwable $e)
 {
-    echo $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator
+Exception: Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator
diff --git a/Zend/tests/bug31098.phpt b/Zend/tests/bug31098.phpt
index 862fc6fc46d..b20d7f10923 100644
--- a/Zend/tests/bug31098.phpt
+++ b/Zend/tests/bug31098.phpt
@@ -19,8 +19,8 @@
 echo isset($simpleString->wrong)?"bug\n":"ok\n";
 try {
     echo isset($simpleString["wrong"])?"bug\n":"ok\n";
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo isset($simpleString[-20])?"bug\n":"ok\n";
 echo isset($simpleString[0])?"ok\n":"bug\n";
@@ -30,15 +30,15 @@
 echo $simpleString->wrong === null?"ok\n":"bug\n";
 try {
     echo $simpleString["wrong"] === "B"?"ok\n":"bug\n";
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo $simpleString["0"] === "B"?"ok\n":"bug\n";
 try {
     /* This must not affect the string value */
     $simpleString["wrong"] = "f";
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo $simpleString["0"] === "B"?"ok\n":"bug\n";
 ?>
@@ -59,7 +59,7 @@

 Warning: Attempt to read property "wrong" on string in %s on line %d
 ok
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
 ok
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
 ok
diff --git a/Zend/tests/bug31720.phpt b/Zend/tests/bug31720.phpt
index 083ea78a011..db04ef108ad 100644
--- a/Zend/tests/bug31720.phpt
+++ b/Zend/tests/bug31720.phpt
@@ -6,10 +6,10 @@

 try {
     array_walk($array, array($nonesuchvar,'show'));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Warning: Undefined variable $nonesuchvar in %s on line %d
-array_walk(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: array_walk(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object
diff --git a/Zend/tests/bug33996.phpt b/Zend/tests/bug33996.phpt
index d5ec3386d6e..849667e9eed 100644
--- a/Zend/tests/bug33996.phpt
+++ b/Zend/tests/bug33996.phpt
@@ -22,16 +22,16 @@ function NormalTest($a)
 try {
     NormalTest();
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     FooTest();
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 FooTest(new Foo());
 ?>
 --EXPECTF--
-Exception: Too few arguments to function NormalTest(), 0 passed in %sbug33996.php on line 18 and exactly 1 expected
-Exception: Too few arguments to function FooTest(), 0 passed in %sbug33996.php on line 23 and exactly 1 expected
+ArgumentCountError: Too few arguments to function NormalTest(), 0 passed in %sbug33996.php on line 18 and exactly 1 expected
+ArgumentCountError: Too few arguments to function FooTest(), 0 passed in %sbug33996.php on line 23 and exactly 1 expected
 Hello!
diff --git a/Zend/tests/bug37811.phpt b/Zend/tests/bug37811.phpt
index b066ecd7abb..dadd5a51ef2 100644
--- a/Zend/tests/bug37811.phpt
+++ b/Zend/tests/bug37811.phpt
@@ -19,8 +19,8 @@ function __toString()
 var_dump(Baz);
 try {
     var_dump((string) Baz);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -30,4 +30,4 @@ function __toString()
 string(3) "Foo"
 object(stdClass)#2 (0) {
 }
-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/bug44660.phpt b/Zend/tests/bug44660.phpt
index 02588c44b9d..5a5c66f7216 100644
--- a/Zend/tests/bug44660.phpt
+++ b/Zend/tests/bug44660.phpt
@@ -11,36 +11,36 @@
 echo "\n--> direct assignment:\n";
 try {
     $a->p = $s;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n--> increment:\n";
 try {
     $a->p++;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n--> reference assignment:\n";
 try {
     $a->p =& $s;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n--> reference assignment:\n";
 try {
     $s =& $a->p;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n--> indexed assignment:\n";
 try {
     $a->p[0] = $s;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n--> Confirm assignments have had no impact:\n";
@@ -51,19 +51,19 @@
 Warning: Attempt to read property "p" on true in %s on line %d

 --> direct assignment:
-Attempt to assign property "p" on true
+Error: Attempt to assign property "p" on true

 --> increment:
-Attempt to increment/decrement property "p" on true
+Error: Attempt to increment/decrement property "p" on true

 --> reference assignment:
-Attempt to modify property "p" on true
+Error: Attempt to modify property "p" on true

 --> reference assignment:
-Attempt to modify property "p" on true
+Error: Attempt to modify property "p" on true

 --> indexed assignment:
-Attempt to modify property "p" on true
+Error: Attempt to modify property "p" on true

 --> Confirm assignments have had no impact:
 bool(true)
diff --git a/Zend/tests/bug46106.phpt b/Zend/tests/bug46106.phpt
index 7f0ae66debf..dbb4a1bce21 100644
--- a/Zend/tests/bug46106.phpt
+++ b/Zend/tests/bug46106.phpt
@@ -17,11 +17,11 @@ function test($x) {
 $x = new ReflectionFunction('str_pad');
 try {
     test($x);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 DONE
 --EXPECT--
-str_pad() expects at least 2 arguments, 1 given
+ArgumentCountError: str_pad() expects at least 2 arguments, 1 given
 DONE