Commit 430547e7d0e for php.net

commit 430547e7d0e9b1de083466004daf9f0525010725
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date:   Sat Aug 22 20:20:55 2026 +0700

    Zend: applied fixers to improve test robustness (part 5/8) (#23313)

diff --git a/Zend/tests/named_params/cannot_pass_by_ref.phpt b/Zend/tests/named_params/cannot_pass_by_ref.phpt
index a910cd4410c..dab88481d7e 100644
--- a/Zend/tests/named_params/cannot_pass_by_ref.phpt
+++ b/Zend/tests/named_params/cannot_pass_by_ref.phpt
@@ -5,9 +5,9 @@
 function test($a, &$e) {}
 try {
     test(e: 42);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-test(): Argument #2 ($e) could not be passed by reference
+Error: test(): Argument #2 ($e) could not be passed by reference
diff --git a/Zend/tests/named_params/ctor_extra_named_args.phpt b/Zend/tests/named_params/ctor_extra_named_args.phpt
index ae569ea65d3..4617a21192a 100644
--- a/Zend/tests/named_params/ctor_extra_named_args.phpt
+++ b/Zend/tests/named_params/ctor_extra_named_args.phpt
@@ -7,17 +7,17 @@ class Test {}

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

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

 ?>
 --EXPECT--
-Unknown named parameter $x
-Unknown named parameter $x
+Error: Unknown named parameter $x
+Error: Unknown named parameter $x
diff --git a/Zend/tests/named_params/duplicate_param.phpt b/Zend/tests/named_params/duplicate_param.phpt
index 6abc95bba0f..00f67d4ea1e 100644
--- a/Zend/tests/named_params/duplicate_param.phpt
+++ b/Zend/tests/named_params/duplicate_param.phpt
@@ -7,17 +7,17 @@ function test($a) {}

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

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

 ?>
 --EXPECT--
-Named parameter $a overwrites previous argument
-Named parameter $a overwrites previous argument
+Error: Named parameter $a overwrites previous argument
+Error: Named parameter $a overwrites previous argument
diff --git a/Zend/tests/named_params/gh17216.phpt b/Zend/tests/named_params/gh17216.phpt
index 4cb4df0ec43..aaaa5c5dce9 100644
--- a/Zend/tests/named_params/gh17216.phpt
+++ b/Zend/tests/named_params/gh17216.phpt
@@ -12,11 +12,11 @@ public function __call(string $name, array $arguments) {
 $array = ["a" => "b", 1];
 try {
     forward_static_call_array($callback, $array);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "Done\n";
 ?>
 --EXPECT--
-Cannot use positional argument after named argument
+Error: Cannot use positional argument after named argument
 Done
diff --git a/Zend/tests/named_params/missing_param.phpt b/Zend/tests/named_params/missing_param.phpt
index f8b0b356cee..17e2f33c67f 100644
--- a/Zend/tests/named_params/missing_param.phpt
+++ b/Zend/tests/named_params/missing_param.phpt
@@ -8,20 +8,20 @@ function test($a, $b, $c, $d) {

 try {
     test(a: 'a', d: 'd');
-} catch (ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     array_keys(strict: true);
-} catch (ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     array_keys([], strict: true);
-} catch (ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // This works fine, as search_value is explicitly specified.
@@ -29,9 +29,9 @@ function test($a, $b, $c, $d) {

 ?>
 --EXPECT--
-test(): Argument #2 ($b) not passed
-array_keys(): Argument #1 ($array) not passed
-array_keys(): Argument #2 ($filter_value) must be passed explicitly, because the default value is not known
+ArgumentCountError: test(): Argument #2 ($b) not passed
+ArgumentCountError: array_keys(): Argument #1 ($array) not passed
+ArgumentCountError: array_keys(): Argument #2 ($filter_value) must be passed explicitly, because the default value is not known
 array(1) {
   [0]=>
   int(1)
diff --git a/Zend/tests/named_params/unknown_named_param.phpt b/Zend/tests/named_params/unknown_named_param.phpt
index 5a18932ffd1..631776efeba 100644
--- a/Zend/tests/named_params/unknown_named_param.phpt
+++ b/Zend/tests/named_params/unknown_named_param.phpt
@@ -11,37 +11,37 @@ function test2(...$a) {

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

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

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

 try {
     test(...new ArrayIterator(['unknown' => 42]));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

 ?>
 --EXPECT--
-Unknown named parameter $b
-Unknown named parameter $b
-Unknown named parameter $b
-Unknown named parameter $unknown
+Error: Unknown named parameter $b
+Error: Unknown named parameter $b
+Error: Unknown named parameter $b
+Error: Unknown named parameter $unknown
diff --git a/Zend/tests/named_params/unpack.phpt b/Zend/tests/named_params/unpack.phpt
index 92bb4792c3e..c4eeffb9428 100644
--- a/Zend/tests/named_params/unpack.phpt
+++ b/Zend/tests/named_params/unpack.phpt
@@ -17,14 +17,14 @@ function test2($a = null, &$b = null) {

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

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

 $ary = ['b' => 0];
@@ -38,14 +38,14 @@ function test2($a = null, &$b = null) {

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

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

 $ary = ['b' => 0];
@@ -58,8 +58,8 @@ function test2($a = null, &$b = null) {
 a = a, b = b, c = c
 a = a, b = b, c = c
 a = a, b = b, c = c
-Cannot use positional argument after named argument during unpacking
-Named parameter $a overwrites previous argument
+Error: Cannot use positional argument after named argument during unpacking
+Error: Named parameter $a overwrites previous argument
 array(1) {
   ["b"]=>
   int(1)
@@ -71,8 +71,8 @@ function test2($a = null, &$b = null) {
 a = a, b = b, c = c
 a = a, b = b, c = c
 a = a, b = b, c = c
-Cannot use positional argument after named argument during unpacking
-Named parameter $a overwrites previous argument
+Error: Cannot use positional argument after named argument during unpacking
+Error: Named parameter $a overwrites previous argument

 Warning: Cannot pass by-reference argument 2 of test2() by unpacking a Traversable, passing by-value instead in %s on line %d
 array(1) {
diff --git a/Zend/tests/named_params/unpack_and_named_1.phpt b/Zend/tests/named_params/unpack_and_named_1.phpt
index 1e08163724d..85b40799846 100644
--- a/Zend/tests/named_params/unpack_and_named_1.phpt
+++ b/Zend/tests/named_params/unpack_and_named_1.phpt
@@ -19,13 +19,13 @@ function test2($a, $b, $c = 3, $d = 4) {

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

 ?>
@@ -54,5 +54,5 @@ function test2($a, $b, $c = 3, $d = 4) {
 int(2)
 int(3)
 int(40)
-Named parameter $b overwrites previous argument
-Named parameter $b overwrites previous argument
+Error: Named parameter $b overwrites previous argument
+Error: Named parameter $b overwrites previous argument
diff --git a/Zend/tests/namespaces/ns_076.phpt b/Zend/tests/namespaces/ns_076.phpt
index 230b498b54a..c033f43a38e 100644
--- a/Zend/tests/namespaces/ns_076.phpt
+++ b/Zend/tests/namespaces/ns_076.phpt
@@ -7,24 +7,24 @@

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

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

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

 ?>
 --EXPECT--
-Undefined constant "foo\unknown"
-Undefined constant "foo\unknown"
-Undefined constant "unknown"
+Error: Undefined constant "foo\unknown"
+Error: Undefined constant "foo\unknown"
+Error: Undefined constant "unknown"
diff --git a/Zend/tests/not_002.phpt b/Zend/tests/not_002.phpt
index 3282053b6b9..9027b8d28e8 100644
--- a/Zend/tests/not_002.phpt
+++ b/Zend/tests/not_002.phpt
@@ -8,8 +8,8 @@

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

 $a = ~$b;
@@ -18,7 +18,7 @@
 echo "Done\n";
 ?>
 --EXPECTF--
-Exception: Cannot perform bitwise not on array
+TypeError: Cannot perform bitwise not on array

 Fatal error: Uncaught TypeError: Cannot perform bitwise not on array in %s:%d
 Stack trace:
diff --git a/Zend/tests/nullsafe_operator/001.phpt b/Zend/tests/nullsafe_operator/001.phpt
index 22776006a71..8e0affeb3ec 100644
--- a/Zend/tests/nullsafe_operator/001.phpt
+++ b/Zend/tests/nullsafe_operator/001.phpt
@@ -45,7 +45,7 @@ function self() {
 try {
     var_dump($foo?->self()[null?->bar()]);
 } catch (Throwable $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -103,4 +103,4 @@ function self() {
 string(11) "Foo::null()"
 NULL
 string(11) "Foo::self()"
-string(38) "Cannot use object of type Foo as array"
+Error: Cannot use object of type Foo as array
diff --git a/Zend/tests/nullsafe_operator/002.phpt b/Zend/tests/nullsafe_operator/002.phpt
index 87642bdcb5f..19439bdd892 100644
--- a/Zend/tests/nullsafe_operator/002.phpt
+++ b/Zend/tests/nullsafe_operator/002.phpt
@@ -6,37 +6,37 @@
 try {
     false?->bar();
 } catch (Throwable $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

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

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

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

 ?>
 --EXPECT--
-string(40) "Call to a member function bar() on false"
-string(40) "Call to a member function bar() on array"
-string(38) "Call to a member function bar() on int"
-string(40) "Call to a member function bar() on float"
-string(41) "Call to a member function bar() on string"
+Error: Call to a member function bar() on false
+Error: Call to a member function bar() on array
+Error: Call to a member function bar() on int
+Error: Call to a member function bar() on float
+Error: Call to a member function bar() on string
diff --git a/Zend/tests/nullsafe_operator/003.phpt b/Zend/tests/nullsafe_operator/003.phpt
index 83c2863d1a1..4164ffab9f9 100644
--- a/Zend/tests/nullsafe_operator/003.phpt
+++ b/Zend/tests/nullsafe_operator/003.phpt
@@ -25,7 +25,7 @@ function qux() {
 try {
     var_dump($foo?->quux());
 } catch (Throwable $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump((new Foo)?->bar);
@@ -34,7 +34,7 @@ function qux() {
 try {
     var_dump((new Foo)?->quux());
 } catch (Throwable $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -48,10 +48,10 @@ function qux() {
 Warning: Undefined property: Foo::$baz in %s.php on line 20
 NULL
 string(3) "qux"
-string(36) "Call to undefined method Foo::quux()"
+Error: Call to undefined method Foo::quux()
 string(3) "bar"

 Warning: Undefined property: Foo::$baz in %s.php on line 29
 NULL
 string(3) "qux"
-string(36) "Call to undefined method Foo::quux()"
+Error: Call to undefined method Foo::quux()
diff --git a/Zend/tests/nullsafe_operator/013.phpt b/Zend/tests/nullsafe_operator/013.phpt
index ea353995489..775397a941a 100644
Binary files a/Zend/tests/nullsafe_operator/013.phpt and b/Zend/tests/nullsafe_operator/013.phpt differ
diff --git a/Zend/tests/nullsafe_operator/014.phpt b/Zend/tests/nullsafe_operator/014.phpt
index 896e831ec9f..78ee39eebe8 100644
--- a/Zend/tests/nullsafe_operator/014.phpt
+++ b/Zend/tests/nullsafe_operator/014.phpt
@@ -6,8 +6,8 @@
 function try_and_dump($fn) {
     try {
         var_dump($fn());
-    } catch (\Error $e) {
-        echo $e->getMessage() . "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -40,8 +40,8 @@ public function bar() {
 int(0)
 bar
 int(0)
-Call to a member function null() on null
-Call to a member function null() on null
+Error: Call to a member function null() on null
+Error: Call to a member function null() on null
 bar
 bar
-Call to a member function baz() on int
+Error: Call to a member function baz() on int
diff --git a/Zend/tests/nullsafe_operator/016.phpt b/Zend/tests/nullsafe_operator/016.phpt
index 5bc8516ae4b..23149c4070a 100644
--- a/Zend/tests/nullsafe_operator/016.phpt
+++ b/Zend/tests/nullsafe_operator/016.phpt
@@ -14,13 +14,13 @@ function set(&$ref, $value) {
 function test($foo) {
     try {
         set($foo?->bar, 'bar');
-    } catch (Error $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         (strrev('tes'))($foo?->bar, 'bar2');
-    } catch (Error $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

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

 ?>
 --EXPECT--
-set(): Argument #1 ($ref) could not be passed by reference
-set(): Argument #1 ($ref) could not be passed by reference
-set(): Argument #1 ($ref) could not be passed by reference
-set(): Argument #1 ($ref) could not be passed by reference
+Error: set(): Argument #1 ($ref) could not be passed by reference
+Error: set(): Argument #1 ($ref) could not be passed by reference
+Error: set(): Argument #1 ($ref) could not be passed by reference
+Error: set(): Argument #1 ($ref) could not be passed by reference
diff --git a/Zend/tests/nullsafe_operator/026.phpt b/Zend/tests/nullsafe_operator/026.phpt
index c4e825febbc..cd2ed06884b 100644
--- a/Zend/tests/nullsafe_operator/026.phpt
+++ b/Zend/tests/nullsafe_operator/026.phpt
@@ -10,17 +10,17 @@ class Test {

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

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

 ?>
 --EXPECT--
-Access to undeclared static property Test::$
-Method name must be a string
+Error: Access to undeclared static property Test::$
+Error: Method name must be a string
diff --git a/Zend/tests/nullsafe_operator/033.phpt b/Zend/tests/nullsafe_operator/033.phpt
index 63ee2f850a5..58579d325e0 100644
--- a/Zend/tests/nullsafe_operator/033.phpt
+++ b/Zend/tests/nullsafe_operator/033.phpt
@@ -25,7 +25,7 @@ function qux() {
 try {
     var_dump("{$foo?->quux()}");
 } catch (Throwable $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump("$foo?->bar");
@@ -34,7 +34,7 @@ function qux() {
 try {
     var_dump("$foo?->quux()");
 } catch (Throwable $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -48,7 +48,7 @@ function qux() {
 Warning: Undefined property: Foo::$baz in %s.php on line 20
 string(0) ""
 string(3) "qux"
-string(36) "Call to undefined method Foo::quux()"
+Error: Call to undefined method Foo::quux()
 string(3) "bar"

 Warning: Undefined property: Foo::$baz in %s.php on line 29
diff --git a/Zend/tests/nullsafe_operator/039.phpt b/Zend/tests/nullsafe_operator/039.phpt
index 92983c1592e..4189b85dfea 100644
--- a/Zend/tests/nullsafe_operator/039.phpt
+++ b/Zend/tests/nullsafe_operator/039.phpt
@@ -9,10 +9,10 @@

 try {
     $foo?->foo;
-} 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/nullsafe_operator/constant_propagation.phpt b/Zend/tests/nullsafe_operator/constant_propagation.phpt
index e41201d0e49..f6f9b616d7c 100644
--- a/Zend/tests/nullsafe_operator/constant_propagation.phpt
+++ b/Zend/tests/nullsafe_operator/constant_propagation.phpt
@@ -7,10 +7,10 @@ class Bar { const FOO = "foo"; }

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

 ?>
 --EXPECT--
-Call to a member function length() on string
+Error: Call to a member function length() on string
diff --git a/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt b/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt
index 51df2263486..a76e26cae6d 100644
--- a/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt
+++ b/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt
@@ -15,8 +15,8 @@ function foxcache($val) {
     $a = foxcache("dolor");
     $a += "sit";
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 $a = foxcache("5 amet,");
@@ -26,8 +26,8 @@ function foxcache($val) {
     $a = foxcache("adipiscing");
     $a -= "elit,";
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 $a = foxcache("11 sed");
@@ -37,8 +37,8 @@ function foxcache($val) {
     $a = foxcache("eiusmod");
     $a *= "tempor";
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 $a = foxcache("17 incididunt");
@@ -48,8 +48,8 @@ function foxcache($val) {
     $a = foxcache("labore");
     $a /= "et";
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 $a = foxcache("23 dolore");
@@ -59,8 +59,8 @@ function foxcache($val) {
     $a = foxcache("aliqua.");
     $a **= "Ut";
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 $a = foxcache("31 enim");
@@ -70,8 +70,8 @@ function foxcache($val) {
     $a = foxcache("minim");
     $a %= "veniam,";
     var_dump($a);
-} catch (\TypeError $e) {
-    echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 $a = foxcache("41 minim");
@@ -80,8 +80,8 @@ function foxcache($val) {
     var_dump($a);
     $a = foxcache("quis");
     $a <<= "nostrud";
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($a);
 echo "---", PHP_EOL;
@@ -92,8 +92,8 @@ function foxcache($val) {
     $a = foxcache("laboris");
     $a >>= "nisi";
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 $a = foxcache("59 ut");
@@ -106,15 +106,15 @@ function foxcache($val) {
     $a = foxcache("ex");
     $a |= 73;
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $a = foxcache(79);
     $a |= "ea";
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 $a = foxcache("83 commodo");
@@ -127,15 +127,15 @@ function foxcache($val) {
     $a = foxcache("Duis");
     $a &= 103;
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $a = foxcache(107);
     $a &= "aute";
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 $a = foxcache("109 irure");
@@ -148,15 +148,15 @@ function foxcache($val) {
     $a = foxcache("in");
     $a ^= 137;
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $a = foxcache(139);
     $a ^= "reprehenderit";
     var_dump($a);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
@@ -164,35 +164,35 @@ function foxcache($val) {

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

 Warning: A non-numeric value encountered in %s on line %d

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

 Warning: A non-numeric value encountered in %s on line %d

 Warning: A non-numeric value encountered in %s on line %d
 int(143)
-Unsupported operand types: string * string
+TypeError: Unsupported operand types: string * string
 ---

 Warning: A non-numeric value encountered in %s on line %d

 Warning: A non-numeric value encountered in %s on line %d
 float(0.8947368421052632)
-Unsupported operand types: string / string
+TypeError: Unsupported operand types: string / string
 ---

 Warning: A non-numeric value encountered in %s on line %d

 Warning: A non-numeric value encountered in %s on line %d
 float(3.0910586430935376E+39)
-Unsupported operand types: string ** string
+TypeError: Unsupported operand types: string ** string
 ---

 Warning: A non-numeric value encountered in %s on line %d
@@ -206,7 +206,7 @@ function foxcache($val) {

 Warning: A non-numeric value encountered in %s on line %d
 int(%d)
-Unsupported operand types: string << string
+TypeError: Unsupported operand types: string << string
 string(4) "quis"
 ---

@@ -214,7 +214,7 @@ function foxcache($val) {

 Warning: A non-numeric value encountered in %s on line %d
 int(0)
-Unsupported operand types: string >> string
+TypeError: Unsupported operand types: string >> string
 ---

 Warning: A non-numeric value encountered in %s on line %d
@@ -222,8 +222,8 @@ function foxcache($val) {

 Warning: A non-numeric value encountered in %s on line %d
 int(71)
-Unsupported operand types: string | int
-Unsupported operand types: int | string
+TypeError: Unsupported operand types: string | int
+TypeError: Unsupported operand types: int | string
 ---

 Warning: A non-numeric value encountered in %s on line %d
@@ -231,8 +231,8 @@ function foxcache($val) {

 Warning: A non-numeric value encountered in %s on line %d
 int(97)
-Unsupported operand types: string & int
-Unsupported operand types: int & string
+TypeError: Unsupported operand types: string & int
+TypeError: Unsupported operand types: int & string
 ---

 Warning: A non-numeric value encountered in %s on line %d
@@ -240,5 +240,5 @@ function foxcache($val) {

 Warning: A non-numeric value encountered in %s on line %d
 int(252)
-Unsupported operand types: string ^ int
-Unsupported operand types: int ^ string
+TypeError: Unsupported operand types: string ^ int
+TypeError: Unsupported operand types: int ^ string
diff --git a/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt b/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt
index 2b76f538f46..ff3202e2c29 100644
--- a/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt
+++ b/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt
@@ -6,110 +6,110 @@
 var_dump("2 Lorem" + "3 ipsum");
 try {
     var_dump("dolor" + "sit");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump("5 amet," - "7 consectetur");
 try {
     var_dump("adipiscing" - "elit,");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump("11 sed" * "13 do");
 try {
     var_dump("eiusmod" * "tempor");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump("17 incididunt" / "19 ut");
 try {
     var_dump("labore" / "et");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump("23 dolore" ** "29 magna");
 try {
     var_dump("aliqua." ** "Ut");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump("31 enim" % "37 ad");
 try {
     var_dump("minim" % "veniam,");
-} catch (\TypeError $e) {
-    echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump("41 minim" << "43 veniam,");
 try {
     var_dump("quis" << "nostrud");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump("47 exercitation" >> "53 ullamco");
 try {
     var_dump("laboris" >> "nisi");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump("59 ut" | 61);
 var_dump(67 | "71 aliquip");
 try {
     var_dump("ex" | 73);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(79 | "ea");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump("83 commodo" & 89);
 var_dump(97 & "101 consequat.");
 try {
     var_dump("Duis" & 103);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(107 & "aute");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump("109 irure" ^ 113);
 var_dump(127 ^ "131 dolor");
 try {
     var_dump("in" ^ 137);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(139 ^ "reprehenderit");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump(+"149 in");
 try {
     var_dump(+"voluptate");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "---", PHP_EOL;
 var_dump(-"151 velit");
 try {
     var_dump(-"esse");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
@@ -117,35 +117,35 @@

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

 Warning: A non-numeric value encountered in %s on line %d

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

 Warning: A non-numeric value encountered in %s on line %d

 Warning: A non-numeric value encountered in %s on line %d
 int(143)
-Unsupported operand types: string * string
+TypeError: Unsupported operand types: string * string
 ---

 Warning: A non-numeric value encountered in %s on line %d

 Warning: A non-numeric value encountered in %s on line %d
 float(0.8947368421052632)
-Unsupported operand types: string / string
+TypeError: Unsupported operand types: string / string
 ---

 Warning: A non-numeric value encountered in %s on line %d

 Warning: A non-numeric value encountered in %s on line %d
 float(3.0910586430935376E+39)
-Unsupported operand types: string ** string
+TypeError: Unsupported operand types: string ** string
 ---

 Warning: A non-numeric value encountered in %s on line %d
@@ -159,14 +159,14 @@

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

 Warning: A non-numeric value encountered in %s on line %d

 Warning: A non-numeric value encountered in %s on line %d
 int(0)
-Unsupported operand types: string >> string
+TypeError: Unsupported operand types: string >> string
 ---

 Warning: A non-numeric value encountered in %s on line %d
@@ -174,8 +174,8 @@

 Warning: A non-numeric value encountered in %s on line %d
 int(71)
-Unsupported operand types: string | int
-Unsupported operand types: int | string
+TypeError: Unsupported operand types: string | int
+TypeError: Unsupported operand types: int | string
 ---

 Warning: A non-numeric value encountered in %s on line %d
@@ -183,8 +183,8 @@

 Warning: A non-numeric value encountered in %s on line %d
 int(97)
-Unsupported operand types: string & int
-Unsupported operand types: int & string
+TypeError: Unsupported operand types: string & int
+TypeError: Unsupported operand types: int & string
 ---

 Warning: A non-numeric value encountered in %s on line %d
@@ -192,15 +192,15 @@

 Warning: A non-numeric value encountered in %s on line %d
 int(252)
-Unsupported operand types: string ^ int
-Unsupported operand types: int ^ string
+TypeError: Unsupported operand types: string ^ int
+TypeError: Unsupported operand types: int ^ string
 ---

 Warning: A non-numeric value encountered in %s on line %d
 int(149)
-Unsupported operand types: string * int
+TypeError: Unsupported operand types: string * int
 ---

 Warning: A non-numeric value encountered in %s on line %d
 int(-151)
-Unsupported operand types: string * int
+TypeError: Unsupported operand types: string * int
diff --git a/Zend/tests/numeric_strings/string_offset.phpt b/Zend/tests/numeric_strings/string_offset.phpt
index 0c43bc15121..4516cb24f80 100644
--- a/Zend/tests/numeric_strings/string_offset.phpt
+++ b/Zend/tests/numeric_strings/string_offset.phpt
@@ -30,8 +30,8 @@
 foreach ($keys as $key) {
     try {
         var_dump($str[$key]);
-    } catch (\TypeError $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -39,29 +39,29 @@
 ?>
 --EXPECTF--
 string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
 string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
 string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
 string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string

 Warning: Illegal string offset "7str" in %s on line %d
 string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string

 Warning: Illegal string offset "  7str" in %s on line %d
 string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string

 Warning: Illegal string offset "  7  str" in %s on line %d
 string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string

 Warning: Illegal string offset "7  str" in %s on line %d
 string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string

 Warning: Illegal string offset "0xC" in %s on line %d
 string(1) "T"
diff --git a/Zend/tests/offset_array.phpt b/Zend/tests/offset_array.phpt
index e50ffad18cb..e58701b94eb 100644
--- a/Zend/tests/offset_array.phpt
+++ b/Zend/tests/offset_array.phpt
@@ -19,15 +19,15 @@
 $obj = new stdClass;
 try {
     var_dump($arr[$obj]);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

 echo "Done\n";
@@ -50,6 +50,6 @@

 Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
 int(%d)
-Cannot access offset of type stdClass on array
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type stdClass on array
+TypeError: Cannot access offset of type array on array
 Done
diff --git a/Zend/tests/offset_string.phpt b/Zend/tests/offset_string.phpt
index a32a6826568..c979b5a3613 100644
--- a/Zend/tests/offset_string.phpt
+++ b/Zend/tests/offset_string.phpt
@@ -10,14 +10,14 @@
 var_dump($str[NULL]);
 try {
     var_dump($str["run away"]);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($str["13"]);
 try {
     var_dump($str["14.5"]);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($str["15 and then some"]);

@@ -27,22 +27,22 @@
 $fp = fopen(__FILE__, "r");
 try {
     var_dump($str[$fp]);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

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

 echo "Done\n";
@@ -55,9 +55,9 @@

 Warning: String offset cast occurred in %s on line %d
 string(1) "S"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
 string(1) "c"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string

 Warning: Illegal string offset "15 and then some" in %s on line %d
 string(1) "r"
@@ -67,7 +67,7 @@

 Warning: String offset cast occurred in %s on line %d
 string(1) "S"
-Cannot access offset of type resource on string
-Cannot access offset of type stdClass on string
-Cannot access offset of type array on string
+TypeError: Cannot access offset of type resource on string
+TypeError: Cannot access offset of type stdClass on string
+TypeError: Cannot access offset of type array on string
 Done
diff --git a/Zend/tests/offsets/appending_containers.phpt b/Zend/tests/offsets/appending_containers.phpt
index 0372c28bf18..85eb5081246 100644
--- a/Zend/tests/offsets/appending_containers.phpt
+++ b/Zend/tests/offsets/appending_containers.phpt
@@ -11,7 +11,7 @@
         $container[] = 'value';
         var_dump($container);
     } catch (\Throwable $e) {
-        echo $e->getMessage(), "\n";
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -30,26 +30,26 @@
   string(5) "value"
 }
 true container:
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 4 container:
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 5.5 container:
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 '10' container:
-[] operator not supported for strings
+Error: [] operator not supported for strings
 '25.5' container:
-[] operator not supported for strings
+Error: [] operator not supported for strings
 'string' container:
-[] operator not supported for strings
+Error: [] operator not supported for strings
 [] container:
 array(1) {
   [0]=>
   string(5) "value"
 }
 STDERR container:
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
 new stdClass() container:
-Cannot use object of type stdClass as array
+Error: Cannot use object of type stdClass as array
 new ArrayObject() container:
 object(ArrayObject)#2 (1) {
   ["storage":"ArrayObject":private]=>
diff --git a/Zend/tests/oss_fuzz_434346548.phpt b/Zend/tests/oss_fuzz_434346548.phpt
index 139e36758bc..26f10ccb989 100644
--- a/Zend/tests/oss_fuzz_434346548.phpt
+++ b/Zend/tests/oss_fuzz_434346548.phpt
@@ -13,10 +13,10 @@ function test($y = new Foo() < "") {

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

 ?>
 --EXPECT--
-Foo::__toString(): Return value must be of type string, none returned
+TypeError: Foo::__toString(): Return value must be of type string, none returned
diff --git a/Zend/tests/pipe_operator/ast.phpt b/Zend/tests/pipe_operator/ast.phpt
index e8c088dabfd..32e06f1ff10 100644
--- a/Zend/tests/pipe_operator/ast.phpt
+++ b/Zend/tests/pipe_operator/ast.phpt
@@ -7,76 +7,76 @@

 try {
     assert(false && foo() . bar() |> baz() . quux());
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert(false && (foo() . bar()) |> baz() . quux());
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert(false && foo() . (bar() |> baz()) . quux());
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert(false && foo() . bar() |> (baz() . quux()));
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert(false && (foo() . bar() |> baz()) . quux());
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert(false && foo() . (bar() |> baz() . quux()));
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 print "<, which binds lower\n";

 try {
     assert(false && foo() < bar() |> baz());
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert(false && (foo() < bar()) |> baz());
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert(false && foo() < (bar() |> baz()));
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert(false && foo() |> bar() < baz());
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert(false && (foo() |> bar()) < baz());
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     assert(false && foo() |> (bar() < baz()));
-} catch (AssertionError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }


@@ -85,25 +85,25 @@

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

 ?>
 --EXPECT--
 Concat, which binds higher
-assert(false && foo() . bar() |> baz() . quux())
-assert(false && foo() . bar() |> baz() . quux())
-assert(false && foo() . (bar() |> baz()) . quux())
-assert(false && foo() . bar() |> baz() . quux())
-assert(false && (foo() . bar() |> baz()) . quux())
-assert(false && foo() . (bar() |> baz() . quux()))
+AssertionError: assert(false && foo() . bar() |> baz() . quux())
+AssertionError: assert(false && foo() . bar() |> baz() . quux())
+AssertionError: assert(false && foo() . (bar() |> baz()) . quux())
+AssertionError: assert(false && foo() . bar() |> baz() . quux())
+AssertionError: assert(false && (foo() . bar() |> baz()) . quux())
+AssertionError: assert(false && foo() . (bar() |> baz() . quux()))
 <, which binds lower
-assert(false && foo() < bar() |> baz())
-assert(false && (foo() < bar()) |> baz())
-assert(false && foo() < bar() |> baz())
-assert(false && foo() |> bar() < baz())
-assert(false && foo() |> bar() < baz())
-assert(false && foo() |> (bar() < baz()))
+AssertionError: assert(false && foo() < bar() |> baz())
+AssertionError: assert(false && (foo() < bar()) |> baz())
+AssertionError: assert(false && foo() < bar() |> baz())
+AssertionError: assert(false && foo() |> bar() < baz())
+AssertionError: assert(false && foo() |> bar() < baz())
+AssertionError: assert(false && foo() |> (bar() < baz()))
 misc examples
-assert(false && foo() |> (bar() |> baz(...)))
+AssertionError: assert(false && foo() |> (bar() |> baz(...)))
diff --git a/Zend/tests/pipe_operator/call_by_ref.phpt b/Zend/tests/pipe_operator/call_by_ref.phpt
index 026089b0a65..052db32ea7b 100644
--- a/Zend/tests/pipe_operator/call_by_ref.phpt
+++ b/Zend/tests/pipe_operator/call_by_ref.phpt
@@ -17,8 +17,8 @@ function _append(array &$a): string {
     $a = 5;
     $res1 = $a |> _modify(...);
     var_dump($res1);
-} catch (\Error $e) {
-  echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+  echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // Complex variables.
@@ -26,12 +26,12 @@ function _append(array &$a): string {
     $a = ['foo' => 'beep'];
     $res2 = $a |> _append(...);
     var_dump($res2);
-} catch (\Error $e) {
-  echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+  echo $e::class, ': ', $e->getMessage(), "\n";
 }


 ?>
 --EXPECTF--
-_modify(): Argument #1 ($a) could not be passed by reference
-_append(): Argument #1 ($a) could not be passed by reference
+Error: _modify(): Argument #1 ($a) could not be passed by reference
+Error: _append(): Argument #1 ($a) could not be passed by reference
diff --git a/Zend/tests/pipe_operator/call_prefer_by_ref.phpt b/Zend/tests/pipe_operator/call_prefer_by_ref.phpt
index 31750ac280d..6476105fdad 100644
--- a/Zend/tests/pipe_operator/call_prefer_by_ref.phpt
+++ b/Zend/tests/pipe_operator/call_prefer_by_ref.phpt
@@ -8,8 +8,8 @@
 try {
     $r = $a |> array_multisort(...);
     var_dump($r);
-} catch (\Error $e) {
-  echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+  echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
diff --git a/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt b/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt
index 2ecfbab6348..00c86848348 100644
--- a/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt
+++ b/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt
@@ -5,22 +5,22 @@

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

 ?>
 --EXPECT--
-AssertionError: ''
-AssertionError: ''
-AssertionError: ''
+AssertionError: ""
+AssertionError: ""
+AssertionError: ""
diff --git a/Zend/tests/pipe_operator/prec_005.phpt b/Zend/tests/pipe_operator/prec_005.phpt
index 0dd262324e3..c711393502a 100644
--- a/Zend/tests/pipe_operator/prec_005.phpt
+++ b/Zend/tests/pipe_operator/prec_005.phpt
@@ -5,10 +5,10 @@

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

 ?>
 --EXPECT--
-assert(false && 1 |> (fn() => 2))
+AssertionError: assert(false && 1 |> (fn() => 2))
diff --git a/Zend/tests/pow_array_leak.phpt b/Zend/tests/pow_array_leak.phpt
index 06dce0ac6a2..be7bf6b0638 100644
--- a/Zend/tests/pow_array_leak.phpt
+++ b/Zend/tests/pow_array_leak.phpt
@@ -6,27 +6,27 @@
 $x = [0];
 try {
     $x **= 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($x);

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

 ?>
 --EXPECT--
-Unsupported operand types: array ** int
+TypeError: Unsupported operand types: array ** int
 array(1) {
   [0]=>
   int(0)
 }
-Unsupported operand types: array ** array
+TypeError: Unsupported operand types: array ** array
 array(1) {
   [0]=>
   int(0)
diff --git a/Zend/tests/prop_const_expr/non_enums_rhs.phpt b/Zend/tests/prop_const_expr/non_enums_rhs.phpt
index 0bffe9d8e02..57ac29257cb 100644
--- a/Zend/tests/prop_const_expr/non_enums_rhs.phpt
+++ b/Zend/tests/prop_const_expr/non_enums_rhs.phpt
@@ -12,8 +12,8 @@ function foo($prop = (new A)->prop) {}
 function test() {
     try {
         foo();
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -22,5 +22,5 @@ function test() {

 ?>
 --EXPECT--
-Fetching properties on non-enums in constant expressions is not allowed
-Fetching properties on non-enums in constant expressions is not allowed
+Error: Fetching properties on non-enums in constant expressions is not allowed
+Error: Fetching properties on non-enums in constant expressions is not allowed
diff --git a/Zend/tests/property_access_errors_for_guarded_properties.phpt b/Zend/tests/property_access_errors_for_guarded_properties.phpt
index 0a360a9447d..8cc6202097d 100644
--- a/Zend/tests/property_access_errors_for_guarded_properties.phpt
+++ b/Zend/tests/property_access_errors_for_guarded_properties.phpt
@@ -34,22 +34,22 @@ public function __unset($k) {
 $test = new Test;
 try {
     $test->prop = "bar";
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump($test->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     unset($test->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot access private property Test::$prop
-Cannot access private property Test::$prop
-Cannot access private property Test::$prop
+Error: Cannot access private property Test::$prop
+Error: Cannot access private property Test::$prop
+Error: Cannot access private property Test::$prop
diff --git a/Zend/tests/property_exists_basic.phpt b/Zend/tests/property_exists_basic.phpt
index 8412699e026..4ef9358e986 100644
--- a/Zend/tests/property_exists_basic.phpt
+++ b/Zend/tests/property_exists_basic.phpt
@@ -42,28 +42,28 @@ function test() {

 try {
     var_dump(property_exists(array(), "test"));
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(property_exists(1, "test"));
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(property_exists(3.14, "test"));
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(property_exists(true, "test"));
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(property_exists(null, "test"));
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $foo->bar();
@@ -86,11 +86,11 @@ function test() {
 bool(true)
 bool(false)
 bool(false)
-property_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
-property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
-property_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
-property_exists(): Argument #1 ($object_or_class) must be of type object|string, true given
-property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
+TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
+TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
+TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
+TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, true given
+TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
 bool(true)
 bool(true)
 bool(true)
diff --git a/Zend/tests/property_hooks/ast_printing.phpt b/Zend/tests/property_hooks/ast_printing.phpt
index 128a8496401..9153f499621 100644
--- a/Zend/tests/property_hooks/ast_printing.phpt
+++ b/Zend/tests/property_hooks/ast_printing.phpt
@@ -19,13 +19,13 @@
             get => 42;
         }
     });
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert(false && new class {
+AssertionError: assert(false && new class {
     public $prop1 {
         get;
         set;
diff --git a/Zend/tests/property_hooks/backed_delegated_read_write.phpt b/Zend/tests/property_hooks/backed_delegated_read_write.phpt
index df85768fe51..63910574bf7 100644
--- a/Zend/tests/property_hooks/backed_delegated_read_write.phpt
+++ b/Zend/tests/property_hooks/backed_delegated_read_write.phpt
@@ -45,14 +45,14 @@ class Child extends Test {

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

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

 $child = new Child();
@@ -61,6 +61,6 @@ class Child extends Test {

 ?>
 --EXPECTF--
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
 int(43)
diff --git a/Zend/tests/property_hooks/bug001.phpt b/Zend/tests/property_hooks/bug001.phpt
index 62291019b33..280f2a0791b 100644
--- a/Zend/tests/property_hooks/bug001.phpt
+++ b/Zend/tests/property_hooks/bug001.phpt
@@ -20,11 +20,11 @@ class C extends A {

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

 ?>
 --EXPECT--
 bool(true)
-Cannot write to get-only virtual property C::$x
+Error: Cannot write to get-only virtual property C::$x
diff --git a/Zend/tests/property_hooks/cache.phpt b/Zend/tests/property_hooks/cache.phpt
index dedbfa48f4a..0409c92a2b1 100644
--- a/Zend/tests/property_hooks/cache.phpt
+++ b/Zend/tests/property_hooks/cache.phpt
@@ -18,15 +18,15 @@ function doTest(Test $test) {
     $test->prop = [];
     try {
         $test->prop[] = 1;
-    } catch (\Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     isset($test->prop);
     isset($test->prop[0]);
     try {
         unset($test->prop);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -46,10 +46,10 @@ function doTest(Test $test) {
 Test::$prop::set
 Test::$prop::set
 Test::$prop::get
-Indirect modification of Test::$prop is not allowed
+Error: Indirect modification of Test::$prop is not allowed
 Test::$prop::get
 Test::$prop::get
-Cannot unset hooked property Test::$prop
+Error: Cannot unset hooked property Test::$prop

 Test::$prop::set
 Test::$prop::get
@@ -58,7 +58,7 @@ function doTest(Test $test) {
 Test::$prop::set
 Test::$prop::set
 Test::$prop::get
-Indirect modification of Test::$prop is not allowed
+Error: Indirect modification of Test::$prop is not allowed
 Test::$prop::get
 Test::$prop::get
-Cannot unset hooked property Test::$prop
+Error: Cannot unset hooked property Test::$prop
diff --git a/Zend/tests/property_hooks/default_value_inheritance.phpt b/Zend/tests/property_hooks/default_value_inheritance.phpt
index 3821e19634e..81fc5d2d0ac 100644
--- a/Zend/tests/property_hooks/default_value_inheritance.phpt
+++ b/Zend/tests/property_hooks/default_value_inheritance.phpt
@@ -28,14 +28,14 @@ function test(P $p) {
     var_dump($p->a);
     try {
         var_dump($p->b);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     var_dump($p->c);
     try {
         var_dump($p->d);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -45,10 +45,10 @@ function test(P $p) {
 ?>
 --EXPECT--
 NULL
-Typed property C::$b must not be accessed before initialization
+Error: Typed property C::$b must not be accessed before initialization
 int(2)
 int(2)
 NULL
-Typed property GC::$b must not be accessed before initialization
+Error: Typed property GC::$b must not be accessed before initialization
 NULL
-Typed property GC::$d must not be accessed before initialization
+Error: Typed property GC::$d must not be accessed before initialization
diff --git a/Zend/tests/property_hooks/direct_hook_call.phpt b/Zend/tests/property_hooks/direct_hook_call.phpt
index d97ef4c469a..6a09bb115e5 100644
--- a/Zend/tests/property_hooks/direct_hook_call.phpt
+++ b/Zend/tests/property_hooks/direct_hook_call.phpt
@@ -13,16 +13,16 @@ class Test {
 $test = new Test;
 try {
     $test->{'$prop::get'}();
-} catch (\Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->{'$prop::set'}('foo');
-} catch (\Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Call to undefined method Test::$prop::get()
-Call to undefined method Test::$prop::set()
+Error: Call to undefined method Test::$prop::get()
+Error: Call to undefined method Test::$prop::set()
diff --git a/Zend/tests/property_hooks/final_prop_promoted_ast.phpt b/Zend/tests/property_hooks/final_prop_promoted_ast.phpt
index 32aa1f27dc3..a442c879dc2 100644
--- a/Zend/tests/property_hooks/final_prop_promoted_ast.phpt
+++ b/Zend/tests/property_hooks/final_prop_promoted_ast.phpt
@@ -6,12 +6,12 @@
     assert(false && new class {
         public function __construct(public final $prop) {}
     });
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-assert(false && new class {
+AssertionError: assert(false && new class {
     public function __construct(public final $prop) {
     }

diff --git a/Zend/tests/property_hooks/foreach_val_to_ref.phpt b/Zend/tests/property_hooks/foreach_val_to_ref.phpt
index dba71412579..a5a64c0950b 100644
--- a/Zend/tests/property_hooks/foreach_val_to_ref.phpt
+++ b/Zend/tests/property_hooks/foreach_val_to_ref.phpt
@@ -24,11 +24,11 @@ function test($object) {

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

 ?>
 --EXPECT--
 int(42)
-Cannot create reference to property ByVal::$byVal
+Error: Cannot create reference to property ByVal::$byVal
diff --git a/Zend/tests/property_hooks/get.phpt b/Zend/tests/property_hooks/get.phpt
index 6d4b005843e..7c4923c8645 100644
--- a/Zend/tests/property_hooks/get.phpt
+++ b/Zend/tests/property_hooks/get.phpt
@@ -14,11 +14,11 @@ class Test {

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

 ?>
 --EXPECT--
 int(42)
-Cannot write to get-only virtual property Test::$prop
+Error: Cannot write to get-only virtual property Test::$prop
diff --git a/Zend/tests/property_hooks/get_by_ref.phpt b/Zend/tests/property_hooks/get_by_ref.phpt
index f602721a791..b35be8751bf 100644
--- a/Zend/tests/property_hooks/get_by_ref.phpt
+++ b/Zend/tests/property_hooks/get_by_ref.phpt
@@ -15,20 +15,20 @@ class Test {
 try {
     $test->byVal = [];
     $test->byVal[] = 42;
-} catch (\Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test->byVal);

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

 ?>
 --EXPECT--
-Indirect modification of Test::$byVal is not allowed
+Error: Indirect modification of Test::$byVal is not allowed
 array(0) {
 }
-Cannot assign by reference to overloaded object
+Error: Cannot assign by reference to overloaded object
diff --git a/Zend/tests/property_hooks/get_by_ref_auto.phpt b/Zend/tests/property_hooks/get_by_ref_auto.phpt
index 0dabe4c4521..7e0be4e38d9 100644
--- a/Zend/tests/property_hooks/get_by_ref_auto.phpt
+++ b/Zend/tests/property_hooks/get_by_ref_auto.phpt
@@ -11,15 +11,15 @@ class Test {

 try {
     $test->byVal[] = 42;
-} catch (\Error $e) {
-    echo get_class($e) . ': ' . $e->getMessage() . "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test->byVal);

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

 ?>
diff --git a/Zend/tests/property_hooks/get_type_check.phpt b/Zend/tests/property_hooks/get_type_check.phpt
index 2e0e9b9fcf6..0302e3aa769 100644
--- a/Zend/tests/property_hooks/get_type_check.phpt
+++ b/Zend/tests/property_hooks/get_type_check.phpt
@@ -15,12 +15,12 @@ class Test {
 $test = new Test;
 try {
     var_dump($test->prop1);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test->prop2);

 ?>
 --EXPECT--
-Test::$prop1::get(): Return value must be of type int, string returned
+TypeError: Test::$prop1::get(): Return value must be of type int, string returned
 int(42)
diff --git a/Zend/tests/property_hooks/gh15187_3.phpt b/Zend/tests/property_hooks/gh15187_3.phpt
index d82e6002f82..c8d8131de8a 100644
--- a/Zend/tests/property_hooks/gh15187_3.phpt
+++ b/Zend/tests/property_hooks/gh15187_3.phpt
@@ -17,8 +17,8 @@ class C {
     if ($k === 'c') {
         try {
             $v = 'foo';
-        } catch (Error $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
     if ($k === 'd') {
@@ -31,7 +31,7 @@ class C {
 ?>
 --EXPECTF--
 int(1)
-Cannot assign string to reference held by property C::$c of type int
+TypeError: Cannot assign string to reference held by property C::$c of type int
 int(2)
 object(C)#%d (2) {
   ["b"]=>
diff --git a/Zend/tests/property_hooks/gh15644.phpt b/Zend/tests/property_hooks/gh15644.phpt
index 1e0dda3a0e4..136fc8cc587 100644
--- a/Zend/tests/property_hooks/gh15644.phpt
+++ b/Zend/tests/property_hooks/gh15644.phpt
@@ -16,17 +16,17 @@ class C {

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

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

 ?>
 --EXPECT--
-Cannot modify private(set) property C::$prop1 from global scope
-Cannot modify private(set) property C::$prop2 from global scope
+Error: Cannot modify private(set) property C::$prop1 from global scope
+Error: Cannot modify private(set) property C::$prop2 from global scope
diff --git a/Zend/tests/property_hooks/gh16185_002.phpt b/Zend/tests/property_hooks/gh16185_002.phpt
index 39edba438b0..3154873a062 100644
--- a/Zend/tests/property_hooks/gh16185_002.phpt
+++ b/Zend/tests/property_hooks/gh16185_002.phpt
@@ -21,10 +21,10 @@ public function init() {

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

 ?>
 --EXPECTF--
-Cannot acquire reference to readonly property C::$prop
+Error: Cannot acquire reference to readonly property C::$prop
diff --git a/Zend/tests/property_hooks/gh17101.phpt b/Zend/tests/property_hooks/gh17101.phpt
index 3ab53fb75da..d6179f763f3 100644
--- a/Zend/tests/property_hooks/gh17101.phpt
+++ b/Zend/tests/property_hooks/gh17101.phpt
@@ -7,13 +7,13 @@
     assert(false && new class {
         public function __construct( #[Foo] public private(set) bool $boolVal = false { final set => $this->boolVal = 1;} ) {}
     });
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert(false && new class {
+AssertionError: assert(false && new class {
     public function __construct(#[Foo] public private(set) bool $boolVal = false {
         final set => $this->boolVal = 1;
     }) {
diff --git a/Zend/tests/property_hooks/gh20270.phpt b/Zend/tests/property_hooks/gh20270.phpt
index 173d21990e5..b2df8051964 100644
--- a/Zend/tests/property_hooks/gh20270.phpt
+++ b/Zend/tests/property_hooks/gh20270.phpt
@@ -31,21 +31,21 @@ class B extends A {

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

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

 ?>
 --EXPECT--
-Unknown named parameter $unknown
+Error: Unknown named parameter $unknown
 int(42)
-Unknown named parameter $value
+Error: Unknown named parameter $value
 int(42)
diff --git a/Zend/tests/property_hooks/indirect_modification.phpt b/Zend/tests/property_hooks/indirect_modification.phpt
index 2fb8bda77a2..198892adfae 100644
--- a/Zend/tests/property_hooks/indirect_modification.phpt
+++ b/Zend/tests/property_hooks/indirect_modification.phpt
@@ -23,14 +23,14 @@ class Test {
 $test->byVal = [];
 try {
     $test->byVal[] = 1;
-} catch (\Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test->byVal);
 try {
     $ref =& $test->byVal;
-} catch (\Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 $ref = 42;
 var_dump($test->byVal);
@@ -43,9 +43,9 @@ class Test {
 Test::$byVal::set
 int(3)
 Test::$byVal::set
-Indirect modification of Test::$byVal is not allowed
+Error: Indirect modification of Test::$byVal is not allowed
 array(0) {
 }
-Indirect modification of Test::$byVal is not allowed
+Error: Indirect modification of Test::$byVal is not allowed
 array(0) {
 }
diff --git a/Zend/tests/property_hooks/magic_interaction.phpt b/Zend/tests/property_hooks/magic_interaction.phpt
index 7ea9e60f896..b2b31750fad 100644
--- a/Zend/tests/property_hooks/magic_interaction.phpt
+++ b/Zend/tests/property_hooks/magic_interaction.phpt
@@ -18,24 +18,24 @@ public function __get($name) {
         echo __METHOD__, "($name)\n";
         try {
             $this->$name;
-        } catch (Error $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
     public function __set($name, $value) {
         echo __METHOD__, "($name, $value)\n";
         try {
             $this->$name = $value;
-        } catch (Error $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
     public function __isset($name) {
         echo __METHOD__, "($name)\n";
         try {
             var_dump(isset($this->$name));
-        } catch (Error $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
     public function __unset($name) {
@@ -49,8 +49,8 @@ public function __unset($name) {
 $b->prop = 1;
 try {
     unset($b->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -59,4 +59,4 @@ public function __unset($name) {
 A::$prop::get
 bool(true)
 A::$prop::set
-Cannot unset hooked property B::$prop
+Error: Cannot unset hooked property B::$prop
diff --git a/Zend/tests/property_hooks/override_add_get.phpt b/Zend/tests/property_hooks/override_add_get.phpt
index df2739e6086..2848d38273d 100644
--- a/Zend/tests/property_hooks/override_add_get.phpt
+++ b/Zend/tests/property_hooks/override_add_get.phpt
@@ -20,8 +20,8 @@ class B extends A {
 $a->prop = 1;
 try {
     var_dump($a->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $b = new B;
@@ -31,7 +31,7 @@ class B extends A {
 ?>
 --EXPECT--
 A::A::$prop::set
-Cannot read from set-only virtual property A::$prop
+Error: Cannot read from set-only virtual property A::$prop
 B::B::$prop::set
 B::B::$prop::get
 int(42)
diff --git a/Zend/tests/property_hooks/override_add_set.phpt b/Zend/tests/property_hooks/override_add_set.phpt
index e13de15f0b8..ba3c9c94127 100644
--- a/Zend/tests/property_hooks/override_add_set.phpt
+++ b/Zend/tests/property_hooks/override_add_set.phpt
@@ -19,8 +19,8 @@ class B extends A {
 $a = new A;
 try {
     $a->prop = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($a->prop);

@@ -30,7 +30,7 @@ class B extends A {

 ?>
 --EXPECT--
-Cannot write to get-only virtual property A::$prop
+Error: Cannot write to get-only virtual property A::$prop
 A::A::$prop::get
 int(42)
 B::B::$prop::set
diff --git a/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt b/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt
index 767e585f919..0519b652254 100644
--- a/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt
+++ b/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt
@@ -12,10 +12,10 @@ class Foo {
 $foo = new Foo();
 try {
     var_dump($foo->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot use "parent" when current class scope has no parent
+Error: Cannot use "parent" when current class scope has no parent
diff --git a/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt b/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt
index 0edd8ff074e..0fc8fea23b4 100644
--- a/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt
+++ b/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt
@@ -16,10 +16,10 @@ class C extends P {
 $c = new C();
 try {
     var_dump($c->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Typed property C::$prop must not be accessed before initialization
+Error: Typed property C::$prop must not be accessed before initialization
diff --git a/Zend/tests/property_hooks/parent_get_plain_zpp.phpt b/Zend/tests/property_hooks/parent_get_plain_zpp.phpt
index 04ac779f607..0e96f3fa99e 100644
--- a/Zend/tests/property_hooks/parent_get_plain_zpp.phpt
+++ b/Zend/tests/property_hooks/parent_get_plain_zpp.phpt
@@ -18,10 +18,10 @@ class B extends A {
 $b = new B();
 try {
     var_dump($b->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-A::$prop::get() expects exactly 0 arguments, 1 given
+ArgumentCountError: A::$prop::get() expects exactly 0 arguments, 1 given
diff --git a/Zend/tests/property_hooks/parent_get_undefined_property.phpt b/Zend/tests/property_hooks/parent_get_undefined_property.phpt
index 388448963e3..04967cbcf53 100644
--- a/Zend/tests/property_hooks/parent_get_undefined_property.phpt
+++ b/Zend/tests/property_hooks/parent_get_undefined_property.phpt
@@ -16,10 +16,10 @@ class C extends P {
 $c = new C();
 try {
     var_dump($c->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Undefined property P::$prop
+Error: Undefined property P::$prop
diff --git a/Zend/tests/property_hooks/parent_set_plain_zpp.phpt b/Zend/tests/property_hooks/parent_set_plain_zpp.phpt
index aa95552af56..5a6984ae7e1 100644
--- a/Zend/tests/property_hooks/parent_set_plain_zpp.phpt
+++ b/Zend/tests/property_hooks/parent_set_plain_zpp.phpt
@@ -18,10 +18,10 @@ class B extends A {
 $b = new B();
 try {
     $b->prop = 42;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-A::$prop::set() expects exactly 1 argument, 2 given
+ArgumentCountError: A::$prop::set() expects exactly 1 argument, 2 given
diff --git a/Zend/tests/property_hooks/parent_superfluous_args.phpt b/Zend/tests/property_hooks/parent_superfluous_args.phpt
index 2abcd7e7d10..38658eac96f 100644
--- a/Zend/tests/property_hooks/parent_superfluous_args.phpt
+++ b/Zend/tests/property_hooks/parent_superfluous_args.phpt
@@ -34,18 +34,18 @@ class B extends A {
 // Calling the implicit parent hook with extra args is not ok, since it is an internal function.
 try {
     var_dump($b->backed = 42);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump($b->backed);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 int(42)
 NULL
-A::$backed::set() expects exactly 1 argument, 2 given
-A::$backed::get() expects exactly 0 arguments, 1 given
+ArgumentCountError: A::$backed::set() expects exactly 1 argument, 2 given
+ArgumentCountError: A::$backed::get() expects exactly 0 arguments, 1 given
diff --git a/Zend/tests/property_hooks/parent_wrong_property_info.phpt b/Zend/tests/property_hooks/parent_wrong_property_info.phpt
index c18aad7f11f..e01e2dd719d 100644
--- a/Zend/tests/property_hooks/parent_wrong_property_info.phpt
+++ b/Zend/tests/property_hooks/parent_wrong_property_info.phpt
@@ -16,10 +16,10 @@ class B extends A {
 $b = new B;
 try {
     var_dump($b->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot access private property A::$prop
+Error: Cannot access private property A::$prop
diff --git a/Zend/tests/property_hooks/read_sibling_backing_value.phpt b/Zend/tests/property_hooks/read_sibling_backing_value.phpt
index 65fe28fed32..b8e1e5671f3 100644
--- a/Zend/tests/property_hooks/read_sibling_backing_value.phpt
+++ b/Zend/tests/property_hooks/read_sibling_backing_value.phpt
@@ -25,10 +25,10 @@ class Test {

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

 ?>
 --EXPECTF--
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/property_hooks/set.phpt b/Zend/tests/property_hooks/set.phpt
index 2928aee6ced..147f0b0e5d2 100644
--- a/Zend/tests/property_hooks/set.phpt
+++ b/Zend/tests/property_hooks/set.phpt
@@ -16,17 +16,17 @@ class Test {

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

 ?>
 --EXPECT--
 int(42)
-Cannot read from set-only virtual property Test::$prop
-Cannot read from set-only virtual property Test::$prop
+Error: Cannot read from set-only virtual property Test::$prop
+Error: Cannot read from set-only virtual property Test::$prop
diff --git a/Zend/tests/property_hooks/unset.phpt b/Zend/tests/property_hooks/unset.phpt
index 49edd56831a..d9b2b29fb3c 100644
--- a/Zend/tests/property_hooks/unset.phpt
+++ b/Zend/tests/property_hooks/unset.phpt
@@ -18,12 +18,12 @@ public function __unset($name) {
 $test->prop = 42;
 try {
     unset($test->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test->prop);

 ?>
 --EXPECT--
-Cannot unset hooked property Test::$prop
+Error: Cannot unset hooked property Test::$prop
 int(42)
diff --git a/Zend/tests/property_hooks/virtual_read_write.phpt b/Zend/tests/property_hooks/virtual_read_write.phpt
index e5451ee1ceb..61eeba0e4f8 100644
--- a/Zend/tests/property_hooks/virtual_read_write.phpt
+++ b/Zend/tests/property_hooks/virtual_read_write.phpt
@@ -33,17 +33,17 @@ private function setProp($value) {

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

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

 ?>
 --EXPECTF--
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/readonly_classes/gh10377.phpt b/Zend/tests/readonly_classes/gh10377.phpt
index c9e902ae739..faa4ae330bf 100644
--- a/Zend/tests/readonly_classes/gh10377.phpt
+++ b/Zend/tests/readonly_classes/gh10377.phpt
@@ -20,23 +20,23 @@ function __construct() {
 var_dump($readonly_anon->field);
 try {
     $readonly_anon->field = 123;
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($readonly_anon->field);

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

 ?>
 --EXPECT--
 int(2)
-Cannot modify readonly property class@anonymous::$field
+Error: Cannot modify readonly property class@anonymous::$field
 int(2)
 int(2)
 int(123)
diff --git a/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt b/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt
index b4da25ab0fe..6b3234a18fe 100644
--- a/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt
@@ -11,10 +11,10 @@

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

 ?>
 --EXPECT--
-Cannot create dynamic property Foo::$bar
+Error: Cannot create dynamic property Foo::$bar
diff --git a/Zend/tests/readonly_classes/readonly_class_property1.phpt b/Zend/tests/readonly_classes/readonly_class_property1.phpt
index 34e09eecd7f..acd9c3e6897 100644
--- a/Zend/tests/readonly_classes/readonly_class_property1.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_property1.phpt
@@ -16,10 +16,10 @@ public function __construct() {

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

 ?>
 --EXPECT--
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_classes/readonly_class_property2.phpt b/Zend/tests/readonly_classes/readonly_class_property2.phpt
index 6db08f4dfb3..ad491185bd8 100644
--- a/Zend/tests/readonly_classes/readonly_class_property2.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_property2.phpt
@@ -14,10 +14,10 @@ public function __construct(

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

 ?>
 --EXPECT--
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt b/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt
index e0672e4d97f..c8ee17cb295 100644
--- a/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt
@@ -7,10 +7,10 @@

 try {
     $readonly = unserialize('O:1:"C":1:{s:1:"x";b:1;}');
-} catch (Error $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot create dynamic property C::$x
+Error: Cannot create dynamic property C::$x
diff --git a/Zend/tests/readonly_props/array_append_initialization.phpt b/Zend/tests/readonly_props/array_append_initialization.phpt
index d9b3e8c0744..19008bf29f1 100644
--- a/Zend/tests/readonly_props/array_append_initialization.phpt
+++ b/Zend/tests/readonly_props/array_append_initialization.phpt
@@ -21,17 +21,17 @@ function init() {

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

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

 ?>
 --EXPECT--
-Cannot indirectly modify readonly property C::$a
-Cannot indirectly modify readonly property C::$a
+Error: Cannot indirectly modify readonly property C::$a
+Error: Cannot indirectly modify readonly property C::$a
diff --git a/Zend/tests/readonly_props/by_ref_foreach.phpt b/Zend/tests/readonly_props/by_ref_foreach.phpt
index dfc1d170937..67e3d31fae8 100644
--- a/Zend/tests/readonly_props/by_ref_foreach.phpt
+++ b/Zend/tests/readonly_props/by_ref_foreach.phpt
@@ -20,10 +20,10 @@ public function init() {

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

 ?>
 --EXPECT--
-Cannot acquire reference to readonly property Test::$prop
+Error: Cannot acquire reference to readonly property Test::$prop
diff --git a/Zend/tests/readonly_props/cache_slot.phpt b/Zend/tests/readonly_props/cache_slot.phpt
index af7f73c36eb..53d2bcef587 100644
--- a/Zend/tests/readonly_props/cache_slot.phpt
+++ b/Zend/tests/readonly_props/cache_slot.phpt
@@ -29,8 +29,8 @@ public function replaceProp3() {
 var_dump($test->prop);
 try {
     $test->setProp("b");
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test->prop);
 echo "\n";
@@ -38,13 +38,13 @@ public function replaceProp3() {
 $test = new Test;
 try {
     $test->initAndAppendProp2();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->initAndAppendProp2();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test->prop2);
 echo "\n";
@@ -65,13 +65,13 @@ public function replaceProp3() {
 })->bindTo($test, Test::class);
 try {
     $appendProp2();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $appendProp2();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test->prop2);
 echo "\n";
@@ -90,11 +90,11 @@ public function replaceProp3() {
 ?>
 --EXPECTF--
 string(1) "a"
-Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
 string(1) "a"

-Cannot indirectly modify readonly property Test::$prop2
-Cannot modify readonly property Test::$prop2
+Error: Cannot indirectly modify readonly property Test::$prop2
+Error: Cannot modify readonly property Test::$prop2
 array(0) {
 }

@@ -107,8 +107,8 @@ public function replaceProp3() {
   int(1)
 }

-Cannot indirectly modify readonly property Test::$prop2
-Cannot indirectly modify readonly property Test::$prop2
+Error: Cannot indirectly modify readonly property Test::$prop2
+Error: Cannot indirectly modify readonly property Test::$prop2
 array(0) {
 }

diff --git a/Zend/tests/readonly_props/gh7942.phpt b/Zend/tests/readonly_props/gh7942.phpt
index 89db53439a2..ff41043d771 100644
--- a/Zend/tests/readonly_props/gh7942.phpt
+++ b/Zend/tests/readonly_props/gh7942.phpt
@@ -13,10 +13,10 @@ public function __construct(int &$bar) {
 try {
     $i = 42;
     new Foo($i);
-} catch (Error $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot indirectly modify readonly property Foo::$bar
+Error: Cannot indirectly modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_props/initialization_scope.phpt b/Zend/tests/readonly_props/initialization_scope.phpt
index 49a4341e138..c694d1b7ca1 100644
--- a/Zend/tests/readonly_props/initialization_scope.phpt
+++ b/Zend/tests/readonly_props/initialization_scope.phpt
@@ -19,8 +19,8 @@ public function initProtected() {
 $test = new B;
 try {
     $test->prop = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 $test->initProtected();
 var_dump($test);
@@ -59,7 +59,7 @@ class Y extends X {

 ?>
 --EXPECTF--
-Cannot modify protected(set) readonly property A::$prop from global scope
+Error: Cannot modify protected(set) readonly property A::$prop from global scope
 object(B)#%d (1) {
   ["prop"]=>
   int(2)
diff --git a/Zend/tests/readonly_props/magic_get_set.phpt b/Zend/tests/readonly_props/magic_get_set.phpt
index ff9d7c7e332..f734c0c8817 100644
--- a/Zend/tests/readonly_props/magic_get_set.phpt
+++ b/Zend/tests/readonly_props/magic_get_set.phpt
@@ -35,18 +35,18 @@ public function __isset($name) {
 var_dump(isset($test->prop));
 try {
     var_dump($test->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->prop = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     unset($test->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $test->unsetProp();
@@ -56,16 +56,16 @@ public function __isset($name) {
 $test->prop = 2;
 try {
     unset($test->prop);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 bool(false)
-Typed property Test::$prop must not be accessed before initialization
-Cannot modify protected(set) readonly property Test::$prop from global scope
-Cannot unset protected(set) readonly property Test::$prop from global scope
+Error: Typed property Test::$prop must not be accessed before initialization
+Error: Cannot modify protected(set) readonly property Test::$prop from global scope
+Error: Cannot unset protected(set) readonly property Test::$prop from global scope
 Test::__isset(prop)
 bool(true)
 Test::__get(prop)
diff --git a/Zend/tests/readonly_props/promotion.phpt b/Zend/tests/readonly_props/promotion.phpt
index ee83246083b..f7618b279d4 100644
--- a/Zend/tests/readonly_props/promotion.phpt
+++ b/Zend/tests/readonly_props/promotion.phpt
@@ -15,8 +15,8 @@ public function __construct(
 $point = new Point(1.0, 2.0, 3.0);
 try {
     $point->x = 4.0;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($point);

@@ -30,7 +30,7 @@ public function __construct(
   ["z"]=>
   float(0)
 }
-Cannot modify readonly property Point::$x
+Error: Cannot modify readonly property Point::$x
 object(Point)#1 (3) {
   ["x"]=>
   float(1)
diff --git a/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt b/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt
index 29218d837d7..d39de17556a 100644
--- a/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt
+++ b/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt
@@ -24,10 +24,10 @@ public function __toString() {

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

 ?>
 --EXPECT--
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_props/readonly_clone_error1.phpt b/Zend/tests/readonly_props/readonly_clone_error1.phpt
index 98829d17576..39b150991f6 100644
--- a/Zend/tests/readonly_props/readonly_clone_error1.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error1.phpt
@@ -20,8 +20,8 @@ public function __clone()

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

 echo "done";
@@ -32,5 +32,5 @@ public function __clone()
   ["bar"]=>
   int(2)
 }
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
 done
diff --git a/Zend/tests/readonly_props/readonly_clone_error2.phpt b/Zend/tests/readonly_props/readonly_clone_error2.phpt
index e1e42abad07..d2a8f401755 100644
--- a/Zend/tests/readonly_props/readonly_clone_error2.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error2.phpt
@@ -26,17 +26,17 @@ public function wrongCloneNew()

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

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

 ?>
 --EXPECT--
-Cannot modify readonly property Foo::$bar
-Cannot modify readonly property Foo::$baz
+Error: Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$baz
diff --git a/Zend/tests/readonly_props/readonly_clone_error3.phpt b/Zend/tests/readonly_props/readonly_clone_error3.phpt
index a51ec165c68..e436cd18a04 100644
--- a/Zend/tests/readonly_props/readonly_clone_error3.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error3.phpt
@@ -28,17 +28,17 @@ public function wrongCloneNew()

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

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

 ?>
 --EXPECT--
-Cannot modify readonly property Foo::$bar
-Cannot modify readonly property Foo::$baz
+Error: Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$baz
diff --git a/Zend/tests/readonly_props/readonly_clone_error4.phpt b/Zend/tests/readonly_props/readonly_clone_error4.phpt
index f9edcbcbaa1..7596a78e348 100644
--- a/Zend/tests/readonly_props/readonly_clone_error4.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error4.phpt
@@ -20,14 +20,14 @@ public function __clone()

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

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

 ?>
@@ -36,9 +36,9 @@ public function __clone()
   ["bar"]=>
   int(3)
 }
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
 object(Foo)#2 (1) {
   ["bar"]=>
   int(3)
 }
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_props/readonly_clone_error5.phpt b/Zend/tests/readonly_props/readonly_clone_error5.phpt
index a6a10fb8a27..b795a1cc9aa 100644
--- a/Zend/tests/readonly_props/readonly_clone_error5.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error5.phpt
@@ -34,31 +34,31 @@ public function __construct() {

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

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

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

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

 ?>
 --EXPECT--
-Cannot indirectly modify readonly property TestSetOnce::$prop
-Cannot indirectly modify readonly property TestSetOnce::$prop
-Cannot indirectly modify readonly property TestSetTwice::$prop
-Cannot indirectly modify readonly property TestSetTwice::$prop
+Error: Cannot indirectly modify readonly property TestSetOnce::$prop
+Error: Cannot indirectly modify readonly property TestSetOnce::$prop
+Error: Cannot indirectly modify readonly property TestSetTwice::$prop
+Error: Cannot indirectly modify readonly property TestSetTwice::$prop