Commit e1501d56b48 for php.net

commit e1501d56b486147bf25253f3b5f37e713fb44b42
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date:   Sat Aug 22 20:15:30 2026 +0700

    Zend: applied fixers to improve test robustness (3/8) (#23311)

diff --git a/Zend/tests/dynamic_call/bug77877.phpt b/Zend/tests/dynamic_call/bug77877.phpt
index 6ed35213efb..9c32424de1c 100644
--- a/Zend/tests/dynamic_call/bug77877.phpt
+++ b/Zend/tests/dynamic_call/bug77877.phpt
@@ -10,14 +10,14 @@ static public function bar() {
 try {
     array_map([new Foo, 'bar'],[1]);
 } catch (Throwable $e) {
-    echo $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     call_user_func([new Foo, 'bar']);
 } catch (Throwable $e) {
-    echo $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Using $this when not in object context
-Using $this when not in object context
+Error: Using $this when not in object context
+Error: Using $this when not in object context
diff --git a/Zend/tests/dynamic_call/dynamic_call_005.phpt b/Zend/tests/dynamic_call/dynamic_call_005.phpt
index 91d1cb914c1..e651b54a8b7 100644
--- a/Zend/tests/dynamic_call/dynamic_call_005.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_005.phpt
@@ -9,28 +9,28 @@ function test_calls($func) {
     try {
         array_map($func, [['i' => new stdClass]]);
         var_dump($i);
-    } catch (\Error $e) {
-        echo $e->getMessage() . "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

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

     try {
         call_user_func($func, ['i' => new stdClass]);
         var_dump($i);
-    } catch (\Error $e) {
-        echo $e->getMessage() . "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 test_calls('extract');

 ?>
 --EXPECT--
-Cannot call extract() dynamically
-Cannot call extract() dynamically
-Cannot call extract() dynamically
+Error: Cannot call extract() dynamically
+Error: Cannot call extract() dynamically
+Error: Cannot call extract() dynamically
diff --git a/Zend/tests/dynamic_call/dynamic_call_006.phpt b/Zend/tests/dynamic_call/dynamic_call_006.phpt
index e6ea7191585..b1948e340ad 100644
--- a/Zend/tests/dynamic_call/dynamic_call_006.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_006.phpt
@@ -7,52 +7,52 @@ function test() {
     try {
         $func = 'extract';
         $func(['a' => 'b']);
-    } catch (\Error $e) {
-        echo $e->getMessage() . "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         $func = 'compact';
         $func(['a']);
-    } catch (\Error $e) {
-        echo $e->getMessage() . "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

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

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

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

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

 ?>
 --EXPECT--
-Cannot call extract() dynamically
-Cannot call compact() dynamically
-Cannot call get_defined_vars() dynamically
-Cannot call func_get_args() dynamically
-Cannot call func_get_arg() dynamically
-Cannot call func_num_args() dynamically
+Error: Cannot call extract() dynamically
+Error: Cannot call compact() dynamically
+Error: Cannot call get_defined_vars() dynamically
+Error: Cannot call func_get_args() dynamically
+Error: Cannot call func_get_arg() dynamically
+Error: Cannot call func_num_args() dynamically
diff --git a/Zend/tests/dynamic_call/dynamic_call_007.phpt b/Zend/tests/dynamic_call/dynamic_call_007.phpt
index f1312b95b47..5d99ba5d535 100644
--- a/Zend/tests/dynamic_call/dynamic_call_007.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_007.phpt
@@ -7,8 +7,8 @@ function test() {
     $i = 1;
     try {
         array_map('extract', [['i' => new stdClass]]);
-    } catch (\Error $e) {
-        echo $e->getMessage() . "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     $i += 1;
     var_dump($i);
@@ -17,5 +17,5 @@ function test() {

 ?>
 --EXPECT--
-Cannot call extract() dynamically
+Error: Cannot call extract() dynamically
 int(2)
diff --git a/Zend/tests/dynamic_call/dynamic_call_008.phpt b/Zend/tests/dynamic_call/dynamic_call_008.phpt
index 1916bcf9134..97c21e69a0a 100644
--- a/Zend/tests/dynamic_call/dynamic_call_008.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_008.phpt
@@ -6,12 +6,12 @@
 function test() {
     try {
         ((string) 'extract')(['a' => 42]);
-    } catch (\Error $e) {
-        echo $e->getMessage() . "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 test();

 ?>
 --EXPECT--
-Cannot call extract() dynamically
+Error: Cannot call extract() dynamically
diff --git a/Zend/tests/dynamic_call/dynamic_call_freeing.phpt b/Zend/tests/dynamic_call/dynamic_call_freeing.phpt
index 1bba3ebf6be..03851cb7794 100644
--- a/Zend/tests/dynamic_call/dynamic_call_freeing.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_freeing.phpt
@@ -6,23 +6,23 @@
 try {
     $bar = "bar";
     ("foo" . $bar)();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $bar = ["bar"];
     (["foo"] + $bar)();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     (new stdClass)();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Call to undefined function foobar()
-Array callback must have exactly two elements
-Object of type stdClass is not callable
+Error: Call to undefined function foobar()
+Error: Array callback must have exactly two elements
+Error: Object of type stdClass is not callable
diff --git a/Zend/tests/dynamic_call/dynamic_call_non_static.phpt b/Zend/tests/dynamic_call/dynamic_call_non_static.phpt
index f73d29a131d..f2ff0faa1de 100644
--- a/Zend/tests/dynamic_call/dynamic_call_non_static.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_non_static.phpt
@@ -16,15 +16,15 @@ function __call($name, $args) {}
 $x = new Foo;
 try {
     $x->test1();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $x->test2();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Non-static method Foo::bar() cannot be called statically
-Non-static method Foo::bar() cannot be called statically
+Error: Non-static method Foo::bar() cannot be called statically
+Error: Non-static method Foo::bar() cannot be called statically
diff --git a/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt b/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt
index cca6fa38b6c..ebfc7f4059a 100644
--- a/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt
+++ b/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt
@@ -6,10 +6,10 @@
 namespace Foo;
 try {
     ('\bar')();
-} catch (\Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Call to undefined function bar()
+Error: Call to undefined function bar()
diff --git a/Zend/tests/dynamic_prop_deprecation_002.phpt b/Zend/tests/dynamic_prop_deprecation_002.phpt
index bd0d3aa5a7d..980bbef7d8d 100644
--- a/Zend/tests/dynamic_prop_deprecation_002.phpt
+++ b/Zend/tests/dynamic_prop_deprecation_002.phpt
@@ -10,9 +10,9 @@
 try {
     [&$a->y];
 } catch (Throwable $ex) {
-	echo "Exception: " .$ex->getMessage() . "\n";
+	echo $ex::class, ': ', $ex->getMessage(), "\n";
 }
 ?>
 --EXPECT--
 Err: Creation of dynamic property class@anonymous::$y is deprecated
-Exception: Cannot create dynamic property class@anonymous::$y
+Error: Cannot create dynamic property class@anonymous::$y
diff --git a/Zend/tests/enum/ast-dumper.phpt b/Zend/tests/enum/ast-dumper.phpt
index 7972fe64965..f421f6ffa67 100644
--- a/Zend/tests/enum/ast-dumper.phpt
+++ b/Zend/tests/enum/ast-dumper.phpt
@@ -22,13 +22,13 @@ public function self() {

         return false;
     })());
-} catch (Error $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert((function () {
+AssertionError: assert((function () {
     enum Foo {
         case Bar;
     }
diff --git a/Zend/tests/enum/backed-duplicate-int.phpt b/Zend/tests/enum/backed-duplicate-int.phpt
index fb64ff29322..11c9f68214b 100644
--- a/Zend/tests/enum/backed-duplicate-int.phpt
+++ b/Zend/tests/enum/backed-duplicate-int.phpt
@@ -10,31 +10,31 @@ enum Foo: int {

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

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

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

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

 ?>
 --EXPECT--
-Duplicate value in enum Foo for cases Bar and Baz
-Duplicate value in enum Foo for cases Bar and Baz
-Duplicate value in enum Foo for cases Bar and Baz
-Foo::tryFrom(): Argument #1 ($value) must be of type int, string given
+Error: Duplicate value in enum Foo for cases Bar and Baz
+Error: Duplicate value in enum Foo for cases Bar and Baz
+Error: Duplicate value in enum Foo for cases Bar and Baz
+TypeError: Foo::tryFrom(): Argument #1 ($value) must be of type int, string given
diff --git a/Zend/tests/enum/backed-duplicate-string.phpt b/Zend/tests/enum/backed-duplicate-string.phpt
index 22224ada35a..d7ae7b309df 100644
--- a/Zend/tests/enum/backed-duplicate-string.phpt
+++ b/Zend/tests/enum/backed-duplicate-string.phpt
@@ -12,31 +12,31 @@ enum Suit: string {

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

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

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

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

 ?>
 --EXPECT--
-Duplicate value in enum Suit for cases Hearts and Spades
-Duplicate value in enum Suit for cases Hearts and Spades
-Duplicate value in enum Suit for cases Hearts and Spades
-Duplicate value in enum Suit for cases Hearts and Spades
+Error: Duplicate value in enum Suit for cases Hearts and Spades
+Error: Duplicate value in enum Suit for cases Hearts and Spades
+Error: Duplicate value in enum Suit for cases Hearts and Spades
+Error: Duplicate value in enum Suit for cases Hearts and Spades
diff --git a/Zend/tests/enum/backed-from-invalid-int.phpt b/Zend/tests/enum/backed-from-invalid-int.phpt
index d40cae30e6c..21584621a09 100644
--- a/Zend/tests/enum/backed-from-invalid-int.phpt
+++ b/Zend/tests/enum/backed-from-invalid-int.phpt
@@ -10,10 +10,10 @@ enum Foo: int {

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

 ?>
 --EXPECT--
-2 is not a valid backing value for enum Foo
+ValueError: 2 is not a valid backing value for enum Foo
diff --git a/Zend/tests/enum/backed-from-invalid-string.phpt b/Zend/tests/enum/backed-from-invalid-string.phpt
index c6d784872ef..10949c80cad 100644
--- a/Zend/tests/enum/backed-from-invalid-string.phpt
+++ b/Zend/tests/enum/backed-from-invalid-string.phpt
@@ -12,10 +12,10 @@ enum Suit: string {

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

 ?>
 --EXPECT--
-"A" is not a valid backing value for enum Suit
+ValueError: "A" is not a valid backing value for enum Suit
diff --git a/Zend/tests/enum/backed-from-invalid-type.phpt b/Zend/tests/enum/backed-from-invalid-type.phpt
index b4e0e6d6164..0d1eeab4297 100644
--- a/Zend/tests/enum/backed-from-invalid-type.phpt
+++ b/Zend/tests/enum/backed-from-invalid-type.phpt
@@ -12,8 +12,8 @@ enum Suit: string {

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

 enum Foo: int {
@@ -23,12 +23,12 @@ enum Foo: int {

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


 ?>
 --EXPECT--
-"42" is not a valid backing value for enum Suit
-Foo::from(): Argument #1 ($value) must be of type int, string given
+ValueError: "42" is not a valid backing value for enum Suit
+TypeError: Foo::from(): Argument #1 ($value) must be of type int, string given
diff --git a/Zend/tests/enum/backed-mismatch.phpt b/Zend/tests/enum/backed-mismatch.phpt
index 73602f7b15b..6864e51c569 100644
--- a/Zend/tests/enum/backed-mismatch.phpt
+++ b/Zend/tests/enum/backed-mismatch.phpt
@@ -9,26 +9,26 @@ enum Foo: int {

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

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

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

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

 ?>
diff --git a/Zend/tests/enum/enum-as-params.phpt b/Zend/tests/enum/enum-as-params.phpt
index 90a1f0b5d07..abef7cebd94 100644
--- a/Zend/tests/enum/enum-as-params.phpt
+++ b/Zend/tests/enum/enum-as-params.phpt
@@ -19,17 +19,17 @@ function takesBaz(Baz $baz) {}

 try {
     takesBaz(Foo::Bar);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     takesFoo(Baz::Qux);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
-takesBaz(): Argument #1 ($baz) must be of type Baz, Foo given, called in %s on line %d
-takesFoo(): Argument #1 ($foo) must be of type Foo, Baz given, called in %s on line %d
+TypeError: takesBaz(): Argument #1 ($baz) must be of type Baz, Foo given, called in %s on line %d
+TypeError: takesFoo(): Argument #1 ($foo) must be of type Foo, Baz given, called in %s on line %d
diff --git a/Zend/tests/enum/internal_enums.phpt b/Zend/tests/enum/internal_enums.phpt
index ae26e24cd7e..c58cdb302da 100644
--- a/Zend/tests/enum/internal_enums.phpt
+++ b/Zend/tests/enum/internal_enums.phpt
@@ -33,8 +33,8 @@
 function test_int_enum(int|string $case) {
     try {
         var_dump(ZendTestIntEnum::from($case));
-    } catch (\Error $e) {
-        echo get_class($e) . ': ' . $e->getMessage() . "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump(ZendTestIntEnum::tryFrom($case));
 }
diff --git a/Zend/tests/enum/internal_enums_strict_types.phpt b/Zend/tests/enum/internal_enums_strict_types.phpt
index 3d5ea231a27..f98945f72ee 100644
--- a/Zend/tests/enum/internal_enums_strict_types.phpt
+++ b/Zend/tests/enum/internal_enums_strict_types.phpt
@@ -11,18 +11,18 @@

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

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

 ?>
 --EXPECT--
 enum(ZendTestStringEnum::Bar)
-ZendTestStringEnum::from(): Argument #1 ($value) must be of type string, int given
-ZendTestStringEnum::tryFrom(): Argument #1 ($value) must be of type string, int given
+TypeError: ZendTestStringEnum::from(): Argument #1 ($value) must be of type string, int given
+TypeError: ZendTestStringEnum::tryFrom(): Argument #1 ($value) must be of type string, int given
diff --git a/Zend/tests/enum/json_encode.phpt b/Zend/tests/enum/json_encode.phpt
index f1174db7ae8..9328ea99dd7 100644
--- a/Zend/tests/enum/json_encode.phpt
+++ b/Zend/tests/enum/json_encode.phpt
@@ -34,8 +34,8 @@ function test($value) {
     try {
         var_dump(json_encode($value, JSON_THROW_ON_ERROR));
         echo json_last_error_msg() . "\n";
-    } catch (Exception $e) {
-        echo get_class($e) . ': ' . $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

diff --git a/Zend/tests/enum/no-clone-internal.phpt b/Zend/tests/enum/no-clone-internal.phpt
index 84b7ee2634d..ad2b42793b7 100644
--- a/Zend/tests/enum/no-clone-internal.phpt
+++ b/Zend/tests/enum/no-clone-internal.phpt
@@ -7,10 +7,10 @@

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

 ?>
 --EXPECT--
-Trying to clone an uncloneable object of class ZendTestIntEnum
+Error: Trying to clone an uncloneable object of class ZendTestIntEnum
diff --git a/Zend/tests/enum/no-clone.phpt b/Zend/tests/enum/no-clone.phpt
index 2fadbb26b72..f5e3573bf44 100644
--- a/Zend/tests/enum/no-clone.phpt
+++ b/Zend/tests/enum/no-clone.phpt
@@ -9,10 +9,10 @@ enum Foo {

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

 ?>
 --EXPECT--
-Trying to clone an uncloneable object of class Foo
+Error: Trying to clone an uncloneable object of class Foo
diff --git a/Zend/tests/enum/no-dynamic-properties-internal.phpt b/Zend/tests/enum/no-dynamic-properties-internal.phpt
index 8d821a5f629..1c9eae019cf 100644
--- a/Zend/tests/enum/no-dynamic-properties-internal.phpt
+++ b/Zend/tests/enum/no-dynamic-properties-internal.phpt
@@ -9,10 +9,10 @@

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

 ?>
 --EXPECT--
-Cannot create dynamic property ZendTestUnitEnum::$baz
+Error: Cannot create dynamic property ZendTestUnitEnum::$baz
diff --git a/Zend/tests/enum/no-dynamic-properties.phpt b/Zend/tests/enum/no-dynamic-properties.phpt
index 83d0d441b45..3654f1a33c6 100644
--- a/Zend/tests/enum/no-dynamic-properties.phpt
+++ b/Zend/tests/enum/no-dynamic-properties.phpt
@@ -11,10 +11,10 @@ enum Foo {

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

 ?>
 --EXPECT--
-Cannot create dynamic property Foo::$baz
+Error: Cannot create dynamic property Foo::$baz
diff --git a/Zend/tests/enum/no-new-through-reflection.phpt b/Zend/tests/enum/no-new-through-reflection.phpt
index 9a92559cd3d..c9e0fae4632 100644
--- a/Zend/tests/enum/no-new-through-reflection.phpt
+++ b/Zend/tests/enum/no-new-through-reflection.phpt
@@ -7,10 +7,10 @@ enum Foo {}

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

 ?>
 --EXPECT--
-Cannot instantiate enum Foo
+Error: Cannot instantiate enum Foo
diff --git a/Zend/tests/enum/no-new.phpt b/Zend/tests/enum/no-new.phpt
index 698e9548827..6e39f95b493 100644
--- a/Zend/tests/enum/no-new.phpt
+++ b/Zend/tests/enum/no-new.phpt
@@ -7,10 +7,10 @@ enum Foo {}

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

 ?>
 --EXPECT--
-Cannot instantiate enum Foo
+Error: Cannot instantiate enum Foo
diff --git a/Zend/tests/enum/no-pass-properties-by-ref.phpt b/Zend/tests/enum/no-pass-properties-by-ref.phpt
index 21c3a41e935..748b33b69f3 100644
--- a/Zend/tests/enum/no-pass-properties-by-ref.phpt
+++ b/Zend/tests/enum/no-pass-properties-by-ref.phpt
@@ -14,13 +14,13 @@ function setBarValueByRef(&$bar, $value) {
 try {
     $bar = Foo::Bar;
     $value = setBarValueByRef($bar->value, 1);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump(Foo::Bar->value);

 ?>
 --EXPECT--
-Cannot indirectly modify readonly property Foo::$value
+Error: Cannot indirectly modify readonly property Foo::$value
 int(0)
diff --git a/Zend/tests/enum/no-return-properties-by-ref.phpt b/Zend/tests/enum/no-return-properties-by-ref.phpt
index ea68e7a585c..578643bf273 100644
--- a/Zend/tests/enum/no-return-properties-by-ref.phpt
+++ b/Zend/tests/enum/no-return-properties-by-ref.phpt
@@ -15,13 +15,13 @@ function &getBarValueByRef() {
 try {
     $value = &getBarValueByRef();
     $value = 1;
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump(Foo::Bar->value);

 ?>
 --EXPECT--
-Cannot indirectly modify readonly property Foo::$value
+Error: Cannot indirectly modify readonly property Foo::$value
 int(0)
diff --git a/Zend/tests/enum/no-unset-propertes.phpt b/Zend/tests/enum/no-unset-propertes.phpt
index 867c853afa7..e73e1ce2dd9 100644
--- a/Zend/tests/enum/no-unset-propertes.phpt
+++ b/Zend/tests/enum/no-unset-propertes.phpt
@@ -14,24 +14,24 @@ enum IntFoo: int {
 $foo = Foo::Bar;
 try {
     unset($foo->name);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $intFoo = IntFoo::Bar;
 try {
     unset($intFoo->name);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     unset($intFoo->value);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot unset readonly property Foo::$name
-Cannot unset readonly property IntFoo::$name
-Cannot unset readonly property IntFoo::$value
+Error: Cannot unset readonly property Foo::$name
+Error: Cannot unset readonly property IntFoo::$name
+Error: Cannot unset readonly property IntFoo::$value
diff --git a/Zend/tests/enum/no-write-properties-cache-slot.phpt b/Zend/tests/enum/no-write-properties-cache-slot.phpt
index d59268b6912..574095207f7 100644
--- a/Zend/tests/enum/no-write-properties-cache-slot.phpt
+++ b/Zend/tests/enum/no-write-properties-cache-slot.phpt
@@ -15,13 +15,13 @@ public function modify() {

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

 ?>
 --EXPECT--
 string(1) "A"
-Cannot modify readonly property Test::$name
+Error: Cannot modify readonly property Test::$name
 string(1) "A"
diff --git a/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt b/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt
index b02f4993290..3f04caddad5 100644
--- a/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt
+++ b/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt
@@ -10,13 +10,13 @@ enum Foo: int {
 try {
     $bar = Foo::Bar;
     foreach ([1] as &$bar->value) {}
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump(Foo::Bar->value);

 ?>
 --EXPECT--
-Cannot indirectly modify readonly property Foo::$value
+Error: Cannot indirectly modify readonly property Foo::$value
 int(0)
diff --git a/Zend/tests/enum/no-write-properties-through-references.phpt b/Zend/tests/enum/no-write-properties-through-references.phpt
index 17bd57b82ea..7166b403763 100644
--- a/Zend/tests/enum/no-write-properties-through-references.phpt
+++ b/Zend/tests/enum/no-write-properties-through-references.phpt
@@ -11,13 +11,13 @@ enum Foo: int {
     $bar = Foo::Bar;
     $value = &$bar->value;
     $value = 1;
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump(Foo::Bar->value);

 ?>
 --EXPECT--
-Cannot indirectly modify readonly property Foo::$value
+Error: Cannot indirectly modify readonly property Foo::$value
 int(0)
diff --git a/Zend/tests/enum/no-write-properties.phpt b/Zend/tests/enum/no-write-properties.phpt
index e0022cfffe7..f6436012542 100644
--- a/Zend/tests/enum/no-write-properties.phpt
+++ b/Zend/tests/enum/no-write-properties.phpt
@@ -14,36 +14,36 @@ enum IntFoo: int {
 $bar = Foo::Bar;
 try {
     $bar->name = 'Baz';
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $bar->value = 1;
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $intBar = IntFoo::Bar;
 try {
     $intBar->name = 'Baz';
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $intBar->value = 1;
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $intBar->value2 = 1;
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot modify readonly property Foo::$name
-Cannot create dynamic property Foo::$value
-Cannot modify readonly property IntFoo::$name
-Cannot modify readonly property IntFoo::$value
-Cannot create dynamic property IntFoo::$value2
+Error: Cannot modify readonly property Foo::$name
+Error: Cannot create dynamic property Foo::$value
+Error: Cannot modify readonly property IntFoo::$name
+Error: Cannot modify readonly property IntFoo::$value
+Error: Cannot create dynamic property IntFoo::$value2
diff --git a/Zend/tests/errmsg/bug43344_1.phpt b/Zend/tests/errmsg/bug43344_1.phpt
index d517373d9f1..6b9a5604d69 100644
--- a/Zend/tests/errmsg/bug43344_1.phpt
+++ b/Zend/tests/errmsg/bug43344_1.phpt
@@ -18,28 +18,28 @@ function f3($a=array(bar=>0)) {

 try {
     echo bar."\n";
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     echo f1()."\n";
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     echo f2()."\n";
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     echo f3()."\n";
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Undefined constant "Foo\bar"
-Undefined constant "Foo\bar"
-Undefined constant "Foo\bar"
-Undefined constant "Foo\bar"
+Error: Undefined constant "Foo\bar"
+Error: Undefined constant "Foo\bar"
+Error: Undefined constant "Foo\bar"
+Error: Undefined constant "Foo\bar"
diff --git a/Zend/tests/errmsg/errmsg_020.phpt b/Zend/tests/errmsg/errmsg_020.phpt
index 4a7c326d053..80cd072f540 100644
--- a/Zend/tests/errmsg/errmsg_020.phpt
+++ b/Zend/tests/errmsg/errmsg_020.phpt
@@ -7,10 +7,10 @@

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

 ?>
 --EXPECT--
-Call to undefined function phpinfo()
+Error: Call to undefined function phpinfo()
diff --git a/Zend/tests/error_reporting/bug72162.phpt b/Zend/tests/error_reporting/bug72162.phpt
index 721b0fc3068..24011a7caa5 100644
--- a/Zend/tests/error_reporting/bug72162.phpt
+++ b/Zend/tests/error_reporting/bug72162.phpt
@@ -7,9 +7,9 @@

 try {
     $var16 = error_reporting($var11);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-error_reporting(): Argument #1 ($error_level) must be of type ?int, stdClass given
+TypeError: error_reporting(): Argument #1 ($error_level) must be of type ?int, stdClass given
diff --git a/Zend/tests/eval_constant_resolution.phpt b/Zend/tests/eval_constant_resolution.phpt
index d302d50a2c0..44bbe4b24bc 100644
--- a/Zend/tests/eval_constant_resolution.phpt
+++ b/Zend/tests/eval_constant_resolution.phpt
@@ -20,4 +20,4 @@
 bool(true)
 bool(true)
 string(4) "test"
-bool(true)
\ No newline at end of file
+bool(true)
diff --git a/Zend/tests/exception_set_previous_leak.phpt b/Zend/tests/exception_set_previous_leak.phpt
index 7fb680f9516..7ff1ad36ff6 100644
--- a/Zend/tests/exception_set_previous_leak.phpt
+++ b/Zend/tests/exception_set_previous_leak.phpt
@@ -11,10 +11,10 @@
     } finally {
         throw $e;
     }
-} catch (Exception $e2) {
-    echo $e2->getMessage(), "\n";
+} catch (Throwable $e2) {
+    echo $e2::class, ': ', $e2->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Test
+Exception: Test
diff --git a/Zend/tests/exception_stream_wrapper.phpt b/Zend/tests/exception_stream_wrapper.phpt
index 4de8274fe0c..2db7364f476 100644
--- a/Zend/tests/exception_stream_wrapper.phpt
+++ b/Zend/tests/exception_stream_wrapper.phpt
@@ -20,8 +20,8 @@ function __call($m, $a) {
 stream_wrapper_register('abc', 'Loader');
 try {
     require 'abc://';
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -29,4 +29,4 @@ function __call($m, $a) {
 stream_set_option
 stream_stat
 stream_read
-Message
+Exception: Message
diff --git a/Zend/tests/exceptions/bug26698.phpt b/Zend/tests/exceptions/bug26698.phpt
index 8155f209059..c96ffcfa1cb 100644
--- a/Zend/tests/exceptions/bug26698.phpt
+++ b/Zend/tests/exceptions/bug26698.phpt
@@ -24,9 +24,9 @@ function callOne()
             $res = new ObjectOne();
             $this->three($res->getNone());
         }
-        catch(Exception $e)
+        catch(Throwable $e)
         {
-            echo 'Caught: '.$e->getMessage()."\n";
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }

@@ -37,9 +37,9 @@ function callTwo()
             $res = new ObjectOne();
             $this->three(1, $res->getNone());
         }
-        catch(Exception $e)
+        catch(Throwable $e)
         {
-            echo 'Caught: '.$e->getMessage()."\n";
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }

@@ -50,9 +50,9 @@ function callThree()
             $res = new ObjectOne();
             $this->three(1, 2, $res->getNone());
         }
-        catch(Exception $e)
+        catch(Throwable $e)
         {
-            echo 'Caught: '.$e->getMessage()."\n";
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
@@ -64,6 +64,6 @@ function callThree()
 $p->callThree();
 ?>
 --EXPECT--
-Caught: NONE
-Caught: NONE
-Caught: NONE
+Exception: NONE
+Exception: NONE
+Exception: NONE
diff --git a/Zend/tests/exceptions/bug47771.phpt b/Zend/tests/exceptions/bug47771.phpt
index c4350b9d95d..edf1f2e7906 100644
--- a/Zend/tests/exceptions/bug47771.phpt
+++ b/Zend/tests/exceptions/bug47771.phpt
@@ -22,8 +22,8 @@ public function __destruct() {

   $T =new Test(throw_exc());

-} catch( Exception $e) {
-  echo 'Exception: ' . $e->getMessage() . "\n";
+} catch( Throwable $e) {
+  echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
diff --git a/Zend/tests/exceptions/bug48428.phpt b/Zend/tests/exceptions/bug48428.phpt
index 0cda84dea4e..85e98713d1d 100644
--- a/Zend/tests/exceptions/bug48428.phpt
+++ b/Zend/tests/exceptions/bug48428.phpt
@@ -5,9 +5,9 @@
 try {
         function x() { throw new Exception("ERROR"); }
                 x(x());
-} catch(Exception $e) {
-        echo($e -> getMessage());
+} catch(Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-ERROR
+Exception: ERROR
diff --git a/Zend/tests/exceptions/bug50383.phpt b/Zend/tests/exceptions/bug50383.phpt
index 2f72ea51f85..ee97a7bca9b 100644
--- a/Zend/tests/exceptions/bug50383.phpt
+++ b/Zend/tests/exceptions/bug50383.phpt
@@ -22,21 +22,21 @@ function thrower2() {

 try {
     thrower();
-} catch(Exception $e) {
-    print $e->getMessage();
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage();
     print_r($e->getTrace());
 }

 try {
     thrower2();
-} catch (Exception $e) {
-    print $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage();
     print_r($e->getTrace());
 }

 ?>
 --EXPECTF--
-Missing static method 'ThrowException'
+Exception: Missing static method 'ThrowException'
 Array
 (
     [0] => Array
@@ -69,7 +69,7 @@ function thrower2() {
         )

 )
-Missing method 'foo'
+Exception: Missing method 'foo'
 Array
 (
     [0] => Array
diff --git a/Zend/tests/exceptions/bug53511.phpt b/Zend/tests/exceptions/bug53511.phpt
index b07504506a9..1fde070b706 100644
--- a/Zend/tests/exceptions/bug53511.phpt
+++ b/Zend/tests/exceptions/bug53511.phpt
@@ -12,8 +12,8 @@ function test() {
     $e = new Foo();
     try {
         throw new Exception("ops 2");
-    } catch (Exception $e) {
-        echo $e->getMessage()."\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

diff --git a/Zend/tests/exceptions/bug54043.phpt b/Zend/tests/exceptions/bug54043.phpt
index c6e08b75f9e..15c481456a6 100644
--- a/Zend/tests/exceptions/bug54043.phpt
+++ b/Zend/tests/exceptions/bug54043.phpt
@@ -8,13 +8,13 @@

 try {
     $dateTime = new DateTime($time, $timeZone);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump(error_get_last());

 ?>
 --EXPECT--
-string(80) "Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character"
+DateMalformedStringException: Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character
 NULL
diff --git a/Zend/tests/exceptions/bug60569.phpt b/Zend/tests/exceptions/bug60569.phpt
index ef3bea8edb7..6ecfc26e7dd 100644
--- a/Zend/tests/exceptions/bug60569.phpt
+++ b/Zend/tests/exceptions/bug60569.phpt
@@ -5,10 +5,11 @@
 try {
     $msg = "Some error \x00 message";
     throw new Exception($msg);
-} catch(Exception $e) {
-    var_dump($e->getMessage(), $msg);
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
+    var_dump($msg);
 }
 ?>
 --EXPECTF--
-string(20) "Some error %0 message"
+Exception: Some error %0 message
 string(20) "Some error %0 message"
diff --git a/Zend/tests/exceptions/exception_001.phpt b/Zend/tests/exceptions/exception_001.phpt
index aba29d4aa3e..51953c964fb 100644
--- a/Zend/tests/exceptions/exception_001.phpt
+++ b/Zend/tests/exceptions/exception_001.phpt
@@ -8,29 +8,29 @@
         try {
             try {
                 throw new Exception();
-            } catch (Exception $e) {
-                var_dump($e->getMessage());
+            } catch (Throwable $e) {
+                echo $e::class, ': "', $e->getMessage(), '"', "\n";
                 throw $e;
             }
-        } catch (Exception $e) {
-            var_dump($e->getMessage());
+        } catch (Throwable $e) {
+            echo $e::class, ': "', $e->getMessage(), '"', "\n";
             throw $e;
         }
-    } catch (Exception $e) {
-        var_dump($e->getMessage());
+    } catch (Throwable $e) {
+        echo $e::class, ': "', $e->getMessage(), '"', "\n";
         throw $e;
     }
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': "', $e->getMessage(), '"', "\n";
     throw $e;
 }

 ?>
 --EXPECTF--
-string(0) ""
-string(0) ""
-string(0) ""
-string(0) ""
+Exception: ""
+Exception: ""
+Exception: ""
+Exception: ""

 Fatal error: Uncaught Exception in %s:%d
 Stack trace:
diff --git a/Zend/tests/exceptions/exception_013.phpt b/Zend/tests/exceptions/exception_013.phpt
index 93d85761764..f643ea4324a 100644
--- a/Zend/tests/exceptions/exception_013.phpt
+++ b/Zend/tests/exceptions/exception_013.phpt
@@ -8,30 +8,28 @@ class C {

 try {
     var_dump(C::$a);
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
 }

 try {
     var_dump(C::$p);
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
 }

 try {
     unset(C::$a);
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
 }

 var_dump(C::$a);
 ?>
 --EXPECTF--
-Exception: Access to undeclared static property C::$a in %s on line %d
-
-Exception: Cannot access private property C::$p in %sexception_013.php on line 13
-
-Exception: Attempt to unset static property C::$a in %sexception_013.php on line 19
+Error: Access to undeclared static property C::$a in %s on line %d
+Error: Cannot access private property C::$p in %sexception_013.php on line 13
+Error: Attempt to unset static property C::$a in %sexception_013.php on line 19

 Fatal error: Uncaught Error: Access to undeclared static property C::$a in %s:%d
 Stack trace:
diff --git a/Zend/tests/exceptions/exception_014.phpt b/Zend/tests/exceptions/exception_014.phpt
index aaf411dae56..f9b69cf3aa8 100644
--- a/Zend/tests/exceptions/exception_014.phpt
+++ b/Zend/tests/exceptions/exception_014.phpt
@@ -9,14 +9,14 @@ class C {
 $x = new C;
 try {
     var_dump($x->p);
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
 }

 var_dump($x->p);
 ?>
 --EXPECTF--
-Exception: Cannot access private property C::$p in %sexception_014.php on line %d
+Error: Cannot access private property C::$p in %sexception_014.php on line %d

 Fatal error: Uncaught Error: Cannot access private property C::$p in %sexception_014.php:%d
 Stack trace:
diff --git a/Zend/tests/exceptions/exception_015.phpt b/Zend/tests/exceptions/exception_015.phpt
index a2b27154f65..e98fd487376 100644
--- a/Zend/tests/exceptions/exception_015.phpt
+++ b/Zend/tests/exceptions/exception_015.phpt
@@ -5,14 +5,14 @@
 $s = "ABC";
 try {
     $s[] = "D";
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
 }

 $s[] = "D";
 ?>
 --EXPECTF--
-Exception: [] operator not supported for strings in %sexception_015.php on line %d
+Error: [] operator not supported for strings in %sexception_015.php on line %d

 Fatal error: Uncaught Error: [] operator not supported for strings in %sexception_015.php:%d
 Stack trace:
diff --git a/Zend/tests/exceptions/exception_016.phpt b/Zend/tests/exceptions/exception_016.phpt
index 5b52cf72cd7..dedae5e179f 100644
--- a/Zend/tests/exceptions/exception_016.phpt
+++ b/Zend/tests/exceptions/exception_016.phpt
@@ -4,14 +4,14 @@
 <?php
 try {
     $this->foo();
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
 }

 $this->foo();
 ?>
 --EXPECTF--
-Exception: Using $this when not in object context in %sexception_016.php on line %d
+Error: Using $this when not in object context in %sexception_016.php on line %d

 Fatal error: Uncaught Error: Using $this when not in object context in %sexception_016.php:%d
 Stack trace:
diff --git a/Zend/tests/exceptions/exception_before_fatal.phpt b/Zend/tests/exceptions/exception_before_fatal.phpt
index edc63b2394c..cd0c2d518a8 100644
--- a/Zend/tests/exceptions/exception_before_fatal.phpt
+++ b/Zend/tests/exceptions/exception_before_fatal.phpt
@@ -11,38 +11,38 @@ function exception_error_handler($code, $msg) {
 try {
     $foo->a();
 } catch(Throwable $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

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

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

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


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

 class b {
@@ -51,14 +51,14 @@ class b {
 try {
     b::$foo();
 } catch(Throwable $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
diff --git a/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt b/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt
index 5732e8cc5af..26fb7a8d169 100644
--- a/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt
+++ b/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt
@@ -14,10 +14,10 @@ public function &__get($name) {
 $y = 5;
 try {
     $test->x =& $y;
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Foobar
+Exception: Foobar
diff --git a/Zend/tests/exceptions/exception_during_include_stat.phpt b/Zend/tests/exceptions/exception_during_include_stat.phpt
index 62747384e71..44441667971 100644
--- a/Zend/tests/exceptions/exception_during_include_stat.phpt
+++ b/Zend/tests/exceptions/exception_during_include_stat.phpt
@@ -15,28 +15,28 @@ public function url_stat($path, $flags) {

 try {
     require_once 'doesnt_exist.php';
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     require 'doesnt_exist.php';
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     include_once 'doesnt_exist.php';
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     include 'doesnt_exist.php';
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-stat failed
-stat failed
-stat failed
-stat failed
+Exception: stat failed
+Exception: stat failed
+Exception: stat failed
+Exception: stat failed
diff --git a/Zend/tests/exceptions/exception_from_toString.phpt b/Zend/tests/exceptions/exception_from_toString.phpt
index dd4de341caf..5a559fff5b1 100644
--- a/Zend/tests/exceptions/exception_from_toString.phpt
+++ b/Zend/tests/exceptions/exception_from_toString.phpt
@@ -14,78 +14,78 @@ public function __toString() {
 $badStr = new BadStr;

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

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

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

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

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

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

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

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

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

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

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

 try { $str[0] = $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
 var_dump($str);

 $obj = new DateInterval('P1D');
 try { $x = $obj->{$badStr} = $str; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
 var_dump(!isset($obj->{""}));

 try { strlen($badStr); } catch (Exception $e) { echo "Exception\n"; }
@@ -94,41 +94,41 @@ public function __toString() {

 ?>
 --EXPECT--
-Exception
-Exception
-Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
 string(1) "a"
-Exception
-Exception
-Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
 int(42)
-Exception
+Exception: Exception
 object(BadStr)#1 (0) {
 }
-Exception
+Exception: Exception
 object(BadStr)#1 (0) {
 }
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
 int(42)
-Exception
-Exception
-Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
 object(stdClass)#2 (0) {
 }
-Exception
+Exception: Exception
 string(1) "a"
-Exception
+Exception: Exception
 bool(true)
 Exception
 Exception
diff --git a/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt b/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt
index a9f9e77a59d..4ff3c5f189f 100644
--- a/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt
+++ b/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt
@@ -5,16 +5,16 @@

 try {
     set_exception_handler("fo");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     set_exception_handler(array("", ""));
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, function "fo" not found or invalid function name
-set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, class "" not found
+TypeError: set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, function "fo" not found or invalid function name
+TypeError: set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, class "" not found
diff --git a/Zend/tests/exit/die_string_cast_exception.phpt b/Zend/tests/exit/die_string_cast_exception.phpt
index c20a873939d..e23e9ca55f9 100644
--- a/Zend/tests/exit/die_string_cast_exception.phpt
+++ b/Zend/tests/exit/die_string_cast_exception.phpt
@@ -5,10 +5,10 @@

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

 ?>
 --EXPECT--
-exit(): Argument #1 ($status) must be of type string|int, stdClass given
+TypeError: exit(): Argument #1 ($status) must be of type string|int, stdClass given
diff --git a/Zend/tests/exit_finally_2.phpt b/Zend/tests/exit_finally_2.phpt
index 0a3f5dc7a1d..448dc90ace2 100644
--- a/Zend/tests/exit_finally_2.phpt
+++ b/Zend/tests/exit_finally_2.phpt
@@ -14,8 +14,8 @@
         throw new Exception("Finally exception");
     }
     echo "Not executed\n";
-} catch (Exception $e) {
-    echo "Caught {$e->getMessage()}\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
diff --git a/Zend/tests/fe_fetch_dtor_exception.phpt b/Zend/tests/fe_fetch_dtor_exception.phpt
index 99378e739a8..95ecfe4d2b0 100644
--- a/Zend/tests/fe_fetch_dtor_exception.phpt
+++ b/Zend/tests/fe_fetch_dtor_exception.phpt
@@ -13,10 +13,10 @@ function __destruct() {
     foreach ([1, 2] as $v) {
         var_dump($v);
     }
-} 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/fe_fetch_op2_live_range.phpt b/Zend/tests/fe_fetch_op2_live_range.phpt
index c601e43120e..7ddfc9378cd 100644
--- a/Zend/tests/fe_fetch_op2_live_range.phpt
+++ b/Zend/tests/fe_fetch_op2_live_range.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     foreach (["test"] as $k => func()[]) {}
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Call to undefined function func()
+Error: Call to undefined function func()
diff --git a/Zend/tests/fibers/catch.phpt b/Zend/tests/fibers/catch.phpt
index 92c139ca1b4..a55541b6acb 100644
--- a/Zend/tests/fibers/catch.phpt
+++ b/Zend/tests/fibers/catch.phpt
@@ -6,8 +6,8 @@
 $fiber = new Fiber(function () {
     try {
         Fiber::suspend('test');
-    } catch (Exception $exception) {
-        var_dump($exception->getMessage());
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 });

@@ -19,4 +19,4 @@
 ?>
 --EXPECT--
 string(4) "test"
-string(4) "test"
+Exception: test
diff --git a/Zend/tests/fibers/fiber-error-construct.phpt b/Zend/tests/fibers/fiber-error-construct.phpt
index 8af23ff86eb..a8b4fd02a63 100644
--- a/Zend/tests/fibers/fiber-error-construct.phpt
+++ b/Zend/tests/fibers/fiber-error-construct.phpt
@@ -5,10 +5,10 @@

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

 ?>
 --EXPECT--
-The "FiberError" class is reserved for internal use and cannot be manually instantiated
+Error: The "FiberError" class is reserved for internal use and cannot be manually instantiated
diff --git a/Zend/tests/fibers/get-return-after-throwing.phpt b/Zend/tests/fibers/get-return-after-throwing.phpt
index 620f74e3239..a46b00d27cb 100644
--- a/Zend/tests/fibers/get-return-after-throwing.phpt
+++ b/Zend/tests/fibers/get-return-after-throwing.phpt
@@ -7,15 +7,15 @@

 try {
     $fiber->start();
-} catch (Exception $exception) {
-    echo $exception->getMessage(), "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 $fiber->getReturn();

 ?>
 --EXPECTF--
-test
+Exception: test

 Fatal error: Uncaught FiberError: Cannot get fiber return value: The fiber threw an exception in %sget-return-after-throwing.php:%d
 Stack trace:
diff --git a/Zend/tests/fibers/gh10249.phpt b/Zend/tests/fibers/gh10249.phpt
index efbef9c42a2..2f9f9b4f9c8 100644
--- a/Zend/tests/fibers/gh10249.phpt
+++ b/Zend/tests/fibers/gh10249.phpt
@@ -8,10 +8,10 @@
 $fiber = new Fiber($callback);
 try {
     $fiber->start();
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
-Fiber stack size is too small, it needs to be at least %d bytes
+Exception: Fiber stack size is too small, it needs to be at least %d bytes
diff --git a/Zend/tests/fibers/gh20483.phpt b/Zend/tests/fibers/gh20483.phpt
index e06cf87258e..0181606412b 100644
--- a/Zend/tests/fibers/gh20483.phpt
+++ b/Zend/tests/fibers/gh20483.phpt
@@ -8,9 +8,9 @@
 $fiber = new Fiber($callback);
 try {
     $fiber->start();
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
-Fiber stack size is too small, it needs to be at least %d bytes
+Exception: Fiber stack size is too small, it needs to be at least %d bytes
diff --git a/Zend/tests/fibers/negative_stack_size.phpt b/Zend/tests/fibers/negative_stack_size.phpt
index 591a8f28878..c75686b8918 100644
--- a/Zend/tests/fibers/negative_stack_size.phpt
+++ b/Zend/tests/fibers/negative_stack_size.phpt
@@ -7,7 +7,7 @@
 try {
     $fiber->start();
 } catch (Throwable $e) {
-	echo "Exception: " . $e->getMessage()."\n";
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 DONE
diff --git a/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt b/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt
index dfde978ce06..a00484feb3f 100644
--- a/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt
+++ b/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt
@@ -15,13 +15,13 @@

         $fiber->start();
     })();
-} catch (FiberError $exception) {
-    echo $exception->getMessage(), "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "done\n";

 ?>
 --EXPECT--
-Cannot suspend in a force-closed fiber
+FiberError: Cannot suspend in a force-closed fiber
 done
diff --git a/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt b/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt
index f1b17caeb5d..c4ab9ef3f64 100644
--- a/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt
+++ b/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt
@@ -19,16 +19,16 @@
             echo "inner finally\n";
             throw new \Exception("finally exception");
         }
-    } catch (Exception $exception) {
-        echo $exception->getMessage(), "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     } finally {
         echo "outer finally\n";
     }

     try {
         echo Fiber::suspend();
-    } catch (FiberError $exception) {
-        echo $exception->getMessage(), "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 });

@@ -42,7 +42,7 @@
 --EXPECT--
 fiber
 inner finally
-finally exception
+Exception: finally exception
 outer finally
-Cannot suspend in a force-closed fiber
+FiberError: Cannot suspend in a force-closed fiber
 done
diff --git a/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt b/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt
index 2916c3dfff8..8d2e3d00bb4 100644
--- a/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt
+++ b/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt
@@ -11,8 +11,8 @@
         #[Attr(strrev(...))]
         function () { }
     );
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
@@ -21,13 +21,13 @@ function () { }
         new #[Attr(strrev(...))]
         class {}
     );
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert(!#[Attr(strrev(...))] function () {
+AssertionError: assert(!#[Attr(strrev(...))] function () {
 })
-assert(!new #[Attr(strrev(...))] class {
+AssertionError: assert(!new #[Attr(strrev(...))] class {
 })
diff --git a/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt b/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt
index 97831a8d65f..30bd7011c4e 100644
--- a/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt
+++ b/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt
@@ -21,11 +21,11 @@ function foo(Closure $c = Foo::myMethod(...)) {

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


 ?>
 --EXPECT--
-Caught: Calling static trait method Foo::myMethod is deprecated, it should only be called on a class using the trait
+ErrorException: Calling static trait method Foo::myMethod is deprecated, it should only be called on a class using the trait
diff --git a/Zend/tests/first_class_callable/first_class_callable_015.phpt b/Zend/tests/first_class_callable/first_class_callable_015.phpt
index 72e1d413dd7..545be8944a4 100644
--- a/Zend/tests/first_class_callable/first_class_callable_015.phpt
+++ b/Zend/tests/first_class_callable/first_class_callable_015.phpt
@@ -14,11 +14,11 @@ function test(int $i) {
 do_weak_call($fn);
 try {
     do_strict_call($fn);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
 int(42)
-test(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: test(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
diff --git a/Zend/tests/first_class_callable/first_class_callable_assert.phpt b/Zend/tests/first_class_callable/first_class_callable_assert.phpt
index 2bf3d9fc69e..78cff4b9d0f 100644
--- a/Zend/tests/first_class_callable/first_class_callable_assert.phpt
+++ b/Zend/tests/first_class_callable/first_class_callable_assert.phpt
@@ -9,17 +9,17 @@
 $assert(1 == 1.0, "Message 1");
 try {
     $assert(1 == 2.0, "Message 2");
-} catch (\AssertionError $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

 ?>
 --EXPECT--
-Message 2
-assert(false && strlen(...))
+AssertionError: Message 2
+AssertionError: assert(false && strlen(...))
diff --git a/Zend/tests/first_class_callable/first_class_callable_errors.phpt b/Zend/tests/first_class_callable/first_class_callable_errors.phpt
index dffcd779f36..4e7503027b1 100644
--- a/Zend/tests/first_class_callable/first_class_callable_errors.phpt
+++ b/Zend/tests/first_class_callable/first_class_callable_errors.phpt
@@ -12,46 +12,46 @@ public function instanceMethod() {}
 try {
     $fn = 123;
     $fn(...);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     does_not_exist(...);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     stdClass::doesNotExist(...);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     (new stdClass)->doesNotExist(...);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     [new stdClass, 'doesNotExist'](...);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     Test::privateMethod(...);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     Test::instanceMethod(...);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Value of type int is not callable
-Call to undefined function does_not_exist()
-Call to undefined method stdClass::doesNotExist()
-Call to undefined method stdClass::doesNotExist()
-Call to undefined method stdClass::doesNotExist()
-Call to private method Test::privateMethod() from global scope
-Non-static method Test::instanceMethod() cannot be called statically
+Error: Value of type int is not callable
+Error: Call to undefined function does_not_exist()
+Error: Call to undefined method stdClass::doesNotExist()
+Error: Call to undefined method stdClass::doesNotExist()
+Error: Call to undefined method stdClass::doesNotExist()
+Error: Call to private method Test::privateMethod() from global scope
+Error: Non-static method Test::instanceMethod() cannot be called statically
diff --git a/Zend/tests/foreach/foreach_003.phpt b/Zend/tests/foreach/foreach_003.phpt
index 3ecb96de795..73999b39847 100644
--- a/Zend/tests/foreach/foreach_003.phpt
+++ b/Zend/tests/foreach/foreach_003.phpt
@@ -30,42 +30,42 @@ function next(): void    {$this->trap(__FUNCTION__); $this->n++;}
     try {
         // IS_CV
         foreach ($obj as $key => $val) echo "$val\n";
-    } catch (Exception $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     unset($obj);

     try {
         // IS_VAR
         foreach (new IT(3, $trap) as $key => $val) echo "$val\n";
-    } catch (Exception $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         // IS_TMP_VAR
         foreach ((object)new IT(2, $trap) as $key => $val) echo "$val\n";
-    } catch (Exception $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 ?>
 --EXPECT--
-rewind
-rewind
-rewind
-valid
-valid
-valid
-key
-key
-key
-current
-current
-current
+Exception: rewind
+Exception: rewind
+Exception: rewind
+Exception: valid
+Exception: valid
+Exception: valid
+Exception: key
+Exception: key
+Exception: key
+Exception: current
+Exception: current
+Exception: current
 0
-next
+Exception: next
 0
-next
+Exception: next
 0
-next
+Exception: next
diff --git a/Zend/tests/frameless_undefined_var.phpt b/Zend/tests/frameless_undefined_var.phpt
index e9c5aac5823..5fcf5e00627 100644
--- a/Zend/tests/frameless_undefined_var.phpt
+++ b/Zend/tests/frameless_undefined_var.phpt
@@ -10,9 +10,9 @@ function test() {
 }
 try {
     test();
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Undefined variable $foo
+Exception: Undefined variable $foo
diff --git a/Zend/tests/func_arg_fetch_optimization.phpt b/Zend/tests/func_arg_fetch_optimization.phpt
index ba01d8f7dee..1401292bb12 100644
--- a/Zend/tests/func_arg_fetch_optimization.phpt
+++ b/Zend/tests/func_arg_fetch_optimization.phpt
@@ -7,9 +7,9 @@ function test($x) {
 }
 try {
     test([]);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Cannot use [] for reading
+Error: Cannot use [] for reading
diff --git a/Zend/tests/func_get_arg_basic.phpt b/Zend/tests/func_get_arg_basic.phpt
index ec06a5c20f4..5e56aa41560 100644
--- a/Zend/tests/func_get_arg_basic.phpt
+++ b/Zend/tests/func_get_arg_basic.phpt
@@ -6,50 +6,50 @@
 function test1() {
     try {
         var_dump(func_get_arg(-10));
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     try {
         var_dump(func_get_arg(0));
-    } catch (\Error $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         var_dump(func_get_arg(1));
-    } catch (\Error $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 function test2($a) {
     try {
         var_dump(func_get_arg(0));
-    } catch (\Error $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         var_dump(func_get_arg(1));
-    } catch (\Error $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 function test3($a, $b) {
     try {
         var_dump(func_get_arg(0));
-    } catch (\Error $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         var_dump(func_get_arg(1));
-    } catch (\Error $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         var_dump(func_get_arg(2));
-    } catch (\Error $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -59,7 +59,7 @@ function test3($a, $b) {
 try {
     test2();
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 test3(1,2);

@@ -67,7 +67,7 @@ function test3($a, $b) {
 try {
     call_user_func("test3", 1);
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 call_user_func("test3", 1, 2);

@@ -75,13 +75,13 @@ class test {
     static function test1($a) {
         try {
             var_dump(func_get_arg(0));
-        } catch (\Error $e) {
-            echo $e->getMessage() . \PHP_EOL;
+        } catch (\Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
         try {
             var_dump(func_get_arg(1));
-        } catch (\Error $e) {
-            echo $e->getMessage() . \PHP_EOL;
+        } catch (\Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
@@ -89,33 +89,33 @@ static function test1($a) {
 test::test1(1);
 try {
     var_dump(func_get_arg(1));
-} catch (\Error $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
 ?>
 --EXPECTF--
-func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
+ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
 int(10)
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
 int(1)
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
 int(1)
 int(2)
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
 int(1)
 int(2)
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
 int(1)
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-func_get_arg() cannot be called from the global scope
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+Error: func_get_arg() cannot be called from the global scope
 Done
diff --git a/Zend/tests/func_get_arg_invalid.phpt b/Zend/tests/func_get_arg_invalid.phpt
index 13e0443c07f..e08eaa2ef75 100644
--- a/Zend/tests/func_get_arg_invalid.phpt
+++ b/Zend/tests/func_get_arg_invalid.phpt
@@ -5,8 +5,8 @@

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

 function bar() {
@@ -19,11 +19,11 @@ function foo() {

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

 ?>
 --EXPECT--
-func_get_arg() cannot be called from the global scope
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+Error: func_get_arg() cannot be called from the global scope
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
diff --git a/Zend/tests/func_get_args.phpt b/Zend/tests/func_get_args.phpt
index 33cfdb02ebc..0c61755a875 100644
--- a/Zend/tests/func_get_args.phpt
+++ b/Zend/tests/func_get_args.phpt
@@ -5,10 +5,10 @@

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

 ?>
 --EXPECT--
-func_get_args() cannot be called from the global scope
+Error: func_get_args() cannot be called from the global scope
diff --git a/Zend/tests/func_get_args_basic.phpt b/Zend/tests/func_get_args_basic.phpt
index 54ddf1b40c9..a6278cdb067 100644
--- a/Zend/tests/func_get_args_basic.phpt
+++ b/Zend/tests/func_get_args_basic.phpt
@@ -21,7 +21,7 @@ function test3($a, $b) {
 try {
     test2();
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 test3(1,2);

@@ -29,7 +29,7 @@ function test3($a, $b) {
 try {
     call_user_func("test3", 1);
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 call_user_func("test3", 1, 2);

@@ -43,8 +43,8 @@ static function test1($a) {

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

 ?>
@@ -59,7 +59,7 @@ static function test1($a) {
   [0]=>
   int(1)
 }
-Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
 array(2) {
   [0]=>
   int(1)
@@ -68,7 +68,7 @@ static function test1($a) {
 }
 array(0) {
 }
-Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
+ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
 array(2) {
   [0]=>
   int(1)
@@ -79,4 +79,4 @@ static function test1($a) {
   [0]=>
   int(1)
 }
-func_get_args() cannot be called from the global scope
+Error: func_get_args() cannot be called from the global scope
diff --git a/Zend/tests/func_num_args_basic.phpt b/Zend/tests/func_num_args_basic.phpt
index 0e27b48d650..c0293f8d1b5 100644
--- a/Zend/tests/func_num_args_basic.phpt
+++ b/Zend/tests/func_num_args_basic.phpt
@@ -20,7 +20,7 @@ function test3($a, $b) {
 try {
     test2();
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 test3(1,2);
@@ -29,7 +29,7 @@ function test3($a, $b) {
 try {
     call_user_func("test3", 1);
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 call_user_func("test3", 1, 2);

@@ -43,8 +43,8 @@ static function test1($a) {

 try {
     func_num_args();
-} catch (Error $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "Done\n";
@@ -52,11 +52,11 @@ static function test1($a) {
 --EXPECTF--
 int(0)
 int(1)
-Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
 int(2)
 int(0)
-Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
+ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
 int(2)
 int(1)
-func_num_args() must be called from a function context
+Error: func_num_args() must be called from a function context
 Done
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt
index d23a6a0c705..b286298178a 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     substr("foo");
-} catch (ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-substr() expects at least 2 arguments, 1 given
+ArgumentCountError: substr() expects at least 2 arguments, 1 given
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt
index 2b809cdb731..c2b63e6664f 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt
@@ -5,20 +5,16 @@
 declare(strict_types=1);
 try {
     substr("foo");
-} catch (ArgumentCountError $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     array_diff();
-} catch (ArgumentCountError $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-ArgumentCountError
-substr() expects at least 2 arguments, 1 given
-ArgumentCountError
-array_diff() expects at least 1 argument, 0 given
+ArgumentCountError: substr() expects at least 2 arguments, 1 given
+ArgumentCountError: array_diff() expects at least 1 argument, 0 given
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt
index db9be6d8514..ddfd342d41d 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt
@@ -5,41 +5,33 @@
 try {
     function foo($bar) { }
     foo();
-} catch (\Error $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     function bar($foo, $bar) { }
     bar(1);
-} catch (\Error $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 function bat(int $foo, string $bar) { }

 try {
     bat(123);
-} catch (\Error $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     bat("123");
-} catch (\Error $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
-ArgumentCountError
-Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
-ArgumentCountError
-Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
-ArgumentCountError
-Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
-ArgumentCountError
-Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
+ArgumentCountError: Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
+ArgumentCountError: Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
+ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
+ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt
index 2a67a9ce4c6..d8703181bf6 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt
@@ -6,50 +6,40 @@
 try {
     function foo($bar) { }
     foo();
-} catch (\Error $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     function bar($foo, $bar) { }
     bar(1);
-} catch (\Error $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 function bat(int $foo, string $bar) { }

 try {
     bat(123);
-} catch (\Error $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     bat("123");
-} catch (\Error $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     bat(123, 456);
-} catch (\Error $e) {
-    echo get_class($e) . PHP_EOL;
-    echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
-ArgumentCountError
-Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
-ArgumentCountError
-Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
-ArgumentCountError
-Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
-TypeError
-bat(): Argument #1 ($foo) must be of type int, string given, called in %s on line %d
-TypeError
-bat(): Argument #2 ($bar) must be of type string, int given, called in %s on line %d
+ArgumentCountError: Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
+ArgumentCountError: Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
+ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
+TypeError: bat(): Argument #1 ($foo) must be of type int, string given, called in %s on line %d
+TypeError: bat(): Argument #2 ($bar) must be of type string, int given, called in %s on line %d
diff --git a/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt b/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt
index 1a6dc97dd2e..1fe2b6fef4c 100644
--- a/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt
+++ b/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt
@@ -14,8 +14,8 @@ function test(
 try {
     test('foo', 'bar', 'baz');
     echo 'Not reached';
-} catch (Exception $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     $testFrame = $e->getTrace()[0];
     var_dump($testFrame['function']);
     var_dump(count($testFrame['args']));
@@ -36,8 +36,8 @@ function test2(
 try {
     test2('foo', 'variadic1', 'variadic2', 'variadic3');
     echo 'Not reached';
-} catch (Exception $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     $testFrame = $e->getTrace()[0];
     var_dump($testFrame['function']);
     var_dump(count($testFrame['args']));
@@ -53,14 +53,14 @@ function test2(

 ?>
 --EXPECTF--
-Error
+Exception: Error
 string(4) "test"
 int(3)
 string(3) "foo"
 string(3) "bar"
 string(3) "baz"
 Success
-Error 2
+Exception: Error 2
 string(5) "test2"
 int(4)
 string(3) "foo"