Commit dc6e18cfb2b for php.net

commit dc6e18cfb2b22613dc85c505ba30acca18c8419c
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date:   Sat Aug 22 20:13:52 2026 +0700

    Zend: applied fixers to improve test robustness (part 2/8) (#23310)

diff --git a/Zend/tests/bug47836.phpt b/Zend/tests/bug47836.phpt
index 15afc68c48d..41657a79d59 100644
--- a/Zend/tests/bug47836.phpt
+++ b/Zend/tests/bug47836.phpt
@@ -6,14 +6,14 @@
 $arr[PHP_INT_MAX] = 1;
 try {
     $arr[] = 2;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($arr);
 ?>
 --EXPECTF--
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
 array(1) {
   [%d]=>
   int(1)
diff --git a/Zend/tests/bug49893.phpt b/Zend/tests/bug49893.phpt
index 0832b0b0ef4..db53f2f78d8 100644
--- a/Zend/tests/bug49893.phpt
+++ b/Zend/tests/bug49893.phpt
@@ -6,8 +6,8 @@ class A {
     function __destruct() {
         try {
             throw new Exception("2");
-        } catch (Exception $e) {
-            echo $e->getMessage() . "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
@@ -20,10 +20,10 @@ function __construct() {
 }
 try {
     $b = new B();
-} catch(Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-2
-1
+Exception: 2
+Exception: 1
diff --git a/Zend/tests/bug52041.phpt b/Zend/tests/bug52041.phpt
index 7debab3f8be..76ba011e743 100644
--- a/Zend/tests/bug52041.phpt
+++ b/Zend/tests/bug52041.phpt
@@ -8,33 +8,33 @@ function foo() {

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

 foo()[0] = 1;
@@ -48,22 +48,22 @@ function foo() {
 ?>
 --EXPECTF--
 Warning: Undefined variable $x in %s on line %d
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null

 Warning: Undefined variable $x in %s on line %d
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null

 Warning: Undefined variable $x in %s on line %d
-Attempt to increment/decrement property "a" on null
+Error: Attempt to increment/decrement property "a" on null

 Warning: Undefined variable $x in %s on line %d
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null

 Warning: Undefined variable $x in %s on line %d
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null

 Warning: Undefined variable $x in %s on line %d
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null

 Warning: Undefined variable $x in %s on line %d

diff --git a/Zend/tests/bug52355.phpt b/Zend/tests/bug52355.phpt
index 0c207be2bee..959f637e956 100644
--- a/Zend/tests/bug52355.phpt
+++ b/Zend/tests/bug52355.phpt
@@ -12,8 +12,8 @@

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

 ?>
@@ -21,4 +21,4 @@
 float(-0)
 float(-0)
 float(-0)
-Division by zero
+DivisionByZeroError: Division by zero
diff --git a/Zend/tests/bug52614.phpt b/Zend/tests/bug52614.phpt
index 8c2bc0dc9e0..c5cb4375dfd 100644
--- a/Zend/tests/bug52614.phpt
+++ b/Zend/tests/bug52614.phpt
@@ -54,8 +54,8 @@ public function f7(&$x) {

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

@@ -76,7 +76,7 @@ public function f7(&$x) {
 }
 array(0) {
 }
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null
 NULL
 object(stdClass)#3 (1) {
   ["a"]=>
diff --git a/Zend/tests/bug53432.phpt b/Zend/tests/bug53432.phpt
index aa2a6015f51..f7573c0ba04 100644
--- a/Zend/tests/bug53432.phpt
+++ b/Zend/tests/bug53432.phpt
@@ -18,32 +18,32 @@
 $str = '';
 try {
     var_dump($str['foo'] = 'a');
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($str);

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

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

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

@@ -57,7 +57,7 @@
 Warning: Illegal string offset -1 in %s on line %d
 NULL
 string(0) ""
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
 string(0) ""
 Error: [] operator not supported for strings
 string(0) ""
diff --git a/Zend/tests/bug63882.phpt b/Zend/tests/bug63882.phpt
index 801f1b1e07e..7e723e06de1 100644
--- a/Zend/tests/bug63882.phpt
+++ b/Zend/tests/bug63882.phpt
@@ -11,10 +11,10 @@ class Test { public $x = 5; }

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

 ?>
 --EXPECT--
-Nesting level too deep - recursive dependency?
+Error: Nesting level too deep - recursive dependency?
diff --git a/Zend/tests/bug65784.phpt b/Zend/tests/bug65784.phpt
index 78a7cd12d90..a6a54fd4aa3 100644
--- a/Zend/tests/bug65784.phpt
+++ b/Zend/tests/bug65784.phpt
@@ -16,9 +16,9 @@ function foo1() {
 try {
     $foo = foo1();
     var_dump($foo);
-} catch (Exception $e) {
+} catch (Throwable $e) {
     do {
-        var_dump($e->getMessage());
+        echo $e::class, ': ', $e->getMessage(), "\n";
     } while ($e = $e->getPrevious());
 }

@@ -55,7 +55,7 @@ function foo3() {
 $bar = foo3();
 ?>
 --EXPECTF--
-string(9) "not catch"
+Exception: not catch
 NULL

 Fatal error: Uncaught Exception: not caught in %sbug65784.php:42
diff --git a/Zend/tests/bug69017.phpt b/Zend/tests/bug69017.phpt
index d1608ebbf9d..c106fbe470b 100644
--- a/Zend/tests/bug69017.phpt
+++ b/Zend/tests/bug69017.phpt
@@ -18,8 +18,8 @@ class c1
 c1::$a2[] = 1;
 try {
     c1::$a3[] = 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump(c1::$a1);
@@ -27,7 +27,7 @@ class c1
 var_dump(c1::$a3);
 ?>
 --EXPECTF--
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
 array(2) {
   [1]=>
   string(3) "one"
diff --git a/Zend/tests/bug69315.phpt b/Zend/tests/bug69315.phpt
index 82017c05524..f20d0d1c035 100644
--- a/Zend/tests/bug69315.phpt
+++ b/Zend/tests/bug69315.phpt
@@ -9,42 +9,42 @@
 var_dump(is_callable("strlen"));
 try {
     var_dump(strlen("xxx"));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(defined("PHP_VERSION"));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(constant("PHP_VERSION"));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(call_user_func("strlen"));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(is_string("xxx"));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(is_string());
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 bool(false)
 bool(false)
-Call to undefined function strlen()
-Call to undefined function defined()
-Call to undefined function constant()
-Call to undefined function call_user_func()
-Call to undefined function is_string()
-Call to undefined function is_string()
+Error: Call to undefined function strlen()
+Error: Call to undefined function defined()
+Error: Call to undefined function constant()
+Error: Call to undefined function call_user_func()
+Error: Call to undefined function is_string()
+Error: Call to undefined function is_string()
diff --git a/Zend/tests/bug70083.phpt b/Zend/tests/bug70083.phpt
index 691e6a41251..288f2f1eec8 100644
--- a/Zend/tests/bug70083.phpt
+++ b/Zend/tests/bug70083.phpt
@@ -15,14 +15,14 @@ function &noref() { $foo = 1; return $foo; }
 $foo = new foo;
 try {
     $foo->i = &noref();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($foo);

 ?>
 --EXPECT--
-Cannot assign by reference to overloaded object
+Error: Cannot assign by reference to overloaded object
 object(foo)#1 (1) {
   ["var":"foo":private]=>
   NULL
diff --git a/Zend/tests/bug70089.phpt b/Zend/tests/bug70089.phpt
index 3a8e7d8e783..94a660d4a4a 100644
--- a/Zend/tests/bug70089.phpt
+++ b/Zend/tests/bug70089.phpt
@@ -7,29 +7,29 @@ function dummy($a) {

 try {
     chr(0)[0][] = 1;
-} catch (Error $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     unset(chr(0)[0][0]);
-} catch (Error $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 eval("function runtimetest(&\$a) {} ");
 try {
     runtimetest(chr(0)[0]);
-} catch (Error $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     ++chr(0)[0];
-} catch (Error $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(36) "Cannot use string offset as an array"
-string(36) "Cannot use string offset as an array"
-string(47) "Cannot create references to/from string offsets"
-string(41) "Cannot increment/decrement string offsets"
+Error: Cannot use string offset as an array
+Error: Cannot use string offset as an array
+Error: Cannot create references to/from string offsets
+Error: Cannot increment/decrement string offsets
diff --git a/Zend/tests/bug70895.phpt b/Zend/tests/bug70895.phpt
index afbea1c91d7..c3b2edf957e 100644
--- a/Zend/tests/bug70895.phpt
+++ b/Zend/tests/bug70895.phpt
@@ -5,21 +5,21 @@

 try {
     array_map("%n", 0);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     array_map("%n %i", 0);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     array_map("%n %i aoeu %f aoeu %p", 0);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n" not found or invalid function name
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i" not found or invalid function name
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i aoeu %f aoeu %p" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i aoeu %f aoeu %p" not found or invalid function name
diff --git a/Zend/tests/bug70898.phpt b/Zend/tests/bug70898.phpt
index d3d2cf79a9d..3a41f4d767e 100644
--- a/Zend/tests/bug70898.phpt
+++ b/Zend/tests/bug70898.phpt
@@ -8,9 +8,9 @@ function m($f,$a){

 try {
     echo implode(m("",m("",m("",m("",m("0000000000000000000000000000000000",("")))))));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "0000000000000000000000000000000000" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "0000000000000000000000000000000000" not found or invalid function name
diff --git a/Zend/tests/bug70918.phpt b/Zend/tests/bug70918.phpt
index 54f3a3c72a8..cb11c3e8953 100644
--- a/Zend/tests/bug70918.phpt
+++ b/Zend/tests/bug70918.phpt
@@ -4,44 +4,44 @@
 <?php
 try {
     static::x;
-} catch (Error $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

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

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

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

 try {
     static::$i;
-} catch (Error $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(52) "Cannot access "static" when no class scope is active"
-string(52) "Cannot access "parent" when no class scope is active"
-string(50) "Cannot access "self" when no class scope is active"
-string(52) "Cannot access "static" when no class scope is active"
-string(52) "Cannot access "static" when no class scope is active"
-string(52) "Cannot access "static" when no class scope is active"
+Error: Cannot access "static" when no class scope is active
+Error: Cannot access "parent" when no class scope is active
+Error: Cannot access "self" when no class scope is active
+Error: Cannot access "static" when no class scope is active
+Error: Cannot access "static" when no class scope is active
+Error: Cannot access "static" when no class scope is active
diff --git a/Zend/tests/bug71196.phpt b/Zend/tests/bug71196.phpt
index ca25f9f4fcb..cef48b22212 100644
--- a/Zend/tests/bug71196.phpt
+++ b/Zend/tests/bug71196.phpt
@@ -5,9 +5,9 @@
 try  {
         $a = "1";
         [1, (y().$a.$a) . ($a.$a)];
-} catch (Error $e) {
-        var_dump($e->getMessage());
+} catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(30) "Call to undefined function y()"
+Error: Call to undefined function y()
diff --git a/Zend/tests/bug71572.phpt b/Zend/tests/bug71572.phpt
index f4079e55f89..46edce32a29 100644
--- a/Zend/tests/bug71572.phpt
+++ b/Zend/tests/bug71572.phpt
@@ -6,29 +6,29 @@
 $str = "abc";
 try {
     var_dump($str[0] = "");
-} catch (\Error $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump($str[1] = "");
-} catch (\Error $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump($str[3] = "");
-} catch (\Error $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump($str[10] = "");
-} catch (\Error $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($str);
 ?>
 --EXPECT--
-Cannot assign an empty string to a string offset
-Cannot assign an empty string to a string offset
-Cannot assign an empty string to a string offset
-Cannot assign an empty string to a string offset
+Error: Cannot assign an empty string to a string offset
+Error: Cannot assign an empty string to a string offset
+Error: Cannot assign an empty string to a string offset
+Error: Cannot assign an empty string to a string offset
 string(3) "abc"
diff --git a/Zend/tests/bug72038.phpt b/Zend/tests/bug72038.phpt
index f5491f1b9d6..54d6d6ae88d 100644
--- a/Zend/tests/bug72038.phpt
+++ b/Zend/tests/bug72038.phpt
@@ -6,14 +6,14 @@
 try {
     test($foo = new stdClass);
     var_dump($foo);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     test($bar = 2);
     var_dump($bar);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 test($baz = &$bar);
@@ -25,6 +25,6 @@ function test(&$param) {

 ?>
 --EXPECT--
-test(): Argument #1 ($param) could not be passed by reference
-test(): Argument #1 ($param) could not be passed by reference
+Error: test(): Argument #1 ($param) could not be passed by reference
+Error: test(): Argument #1 ($param) could not be passed by reference
 int(1)
diff --git a/Zend/tests/bug72107.phpt b/Zend/tests/bug72107.phpt
index f65b1422691..01cf3358824 100644
--- a/Zend/tests/bug72107.phpt
+++ b/Zend/tests/bug72107.phpt
@@ -8,9 +8,9 @@ function test($a) {
 }
 try {
     test(1);
-} catch (\Error $e) {
-    echo $e->getMessage();
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-func_get_args() expects exactly 0 arguments, 4 given
+ArgumentCountError: func_get_args() expects exactly 0 arguments, 4 given
diff --git a/Zend/tests/bug74084.phpt b/Zend/tests/bug74084.phpt
index 36239438c68..91509fb227f 100644
--- a/Zend/tests/bug74084.phpt
+++ b/Zend/tests/bug74084.phpt
@@ -8,30 +8,30 @@
 unset($$A);
 try {
     $$A -= $$B['a'] = &$$C;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 unset($$A);
 try {
     $$A *= $$B['a'] = &$$C;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 unset($$A);
 try {
     $$A /= $$B['a'] = &$$C;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 unset($$A);
 try {
     $$A **= $$B['a'] = &$$C;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Unsupported operand types: array - array
-Unsupported operand types: array * array
-Unsupported operand types: array / array
-Unsupported operand types: array ** array
+TypeError: Unsupported operand types: array - array
+TypeError: Unsupported operand types: array * array
+TypeError: Unsupported operand types: array / array
+TypeError: Unsupported operand types: array ** array
diff --git a/Zend/tests/bug75218.phpt b/Zend/tests/bug75218.phpt
index ddbde62a526..a0372c4798a 100644
--- a/Zend/tests/bug75218.phpt
+++ b/Zend/tests/bug75218.phpt
@@ -6,8 +6,8 @@
 function try_eval($code) {
     try {
         eval($code);
-    } catch (CompileError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -18,7 +18,7 @@ function try_eval($code) {

 ?>
 --EXPECT--
-Multiple final modifiers are not allowed
-Multiple access type modifiers are not allowed
-__HALT_COMPILER() can only be used from the outermost scope
-Encoding must be a literal
+CompileError: Multiple final modifiers are not allowed
+CompileError: Multiple access type modifiers are not allowed
+CompileError: __HALT_COMPILER() can only be used from the outermost scope
+CompileError: Encoding must be a literal
diff --git a/Zend/tests/bug75252.phpt b/Zend/tests/bug75252.phpt
index b4e0a1b5bdc..454257ca44b 100644
--- a/Zend/tests/bug75252.phpt
+++ b/Zend/tests/bug75252.phpt
@@ -12,17 +12,17 @@ function test_missing_semicolon() : string {

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

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

 ?>
 --EXPECT--
-string(41) "syntax error, unexpected identifier "FOO""
-string(41) "syntax error, unexpected identifier "FOO""
+ParseError: syntax error, unexpected identifier "FOO"
+ParseError: syntax error, unexpected identifier "FOO"
diff --git a/Zend/tests/bug75921.phpt b/Zend/tests/bug75921.phpt
index ab82c85840c..56db3edb266 100644
--- a/Zend/tests/bug75921.phpt
+++ b/Zend/tests/bug75921.phpt
@@ -5,63 +5,63 @@

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

 try {
     $null->a['hello'] = 42;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($null);
 unset($null);

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

 try {
     $null->a['hello']->b = 42;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($null);
 unset($null);

 try {
     $null->a->b['hello'] = 42;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($null);
 unset($null);

 ?>
 --EXPECTF--
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null

 Warning: Undefined variable $null in %s on line %d
 NULL
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null

 Warning: Undefined variable $null in %s on line %d
 NULL
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null

 Warning: Undefined variable $null in %s on line %d
 NULL
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null

 Warning: Undefined variable $null in %s on line %d
 NULL
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null

 Warning: Undefined variable $null in %s on line %d
 NULL
diff --git a/Zend/tests/bug76869.phpt b/Zend/tests/bug76869.phpt
index a19d2dfedbf..afd60595970 100644
--- a/Zend/tests/bug76869.phpt
+++ b/Zend/tests/bug76869.phpt
@@ -16,8 +16,8 @@ protected function f() {
 try {
     var_dump($b->f());
 } catch (Throwable $e) {
-    echo "Exception: ", $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Exception: Call to protected method B::f() from global scope
+Error: Call to protected method B::f() from global scope
diff --git a/Zend/tests/bug78154.phpt b/Zend/tests/bug78154.phpt
index 94f49b224e6..37a1e009f51 100644
--- a/Zend/tests/bug78154.phpt
+++ b/Zend/tests/bug78154.phpt
@@ -7,8 +7,8 @@
     try {
         var_dump(similar_text('a', 'a', $c=0x44444444));
         var_dump($c);
-    } catch (Throwable $e) {
-        echo "Exception: " . $e->getMessage() . "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 namespace Foo {
@@ -16,11 +16,11 @@
         var_dump(similar_text('a', 'a', $d=0x44444444));
         var_dump($d);
     } catch (\Throwable $e) {
-        echo "Exception: " . $e->getMessage() . "\n";
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 ?>
 --EXPECT--
-Exception: similar_text(): Argument #3 ($percent) could not be passed by reference
-Exception: similar_text(): Argument #3 ($percent) could not be passed by reference
+Error: similar_text(): Argument #3 ($percent) could not be passed by reference
+Error: similar_text(): Argument #3 ($percent) could not be passed by reference
diff --git a/Zend/tests/bug78182.phpt b/Zend/tests/bug78182.phpt
index a751e953bbf..b5aa2d0bb54 100644
--- a/Zend/tests/bug78182.phpt
+++ b/Zend/tests/bug78182.phpt
@@ -6,11 +6,11 @@
 $propName = 'prop';
 try {
     $$varName->$propName =& $$varName;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($var);
 ?>
 --EXPECT--
-Attempt to modify property "prop" on null
+Error: Attempt to modify property "prop" on null
 NULL
diff --git a/Zend/tests/bug78531.phpt b/Zend/tests/bug78531.phpt
index b818afb79a8..4f2d2e9d1b9 100644
--- a/Zend/tests/bug78531.phpt
+++ b/Zend/tests/bug78531.phpt
@@ -4,34 +4,34 @@
 <?php
 try {
     $u1->a += 5;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $x = ++$u2->a;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $x = $u3->a++;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $u4->a->a += 5;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Warning: Undefined variable $u1 in %s on line %d
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null

 Warning: Undefined variable $u2 in %s on line %d
-Attempt to increment/decrement property "a" on null
+Error: Attempt to increment/decrement property "a" on null

 Warning: Undefined variable $u3 in %s on line %d
-Attempt to increment/decrement property "a" on null
+Error: Attempt to increment/decrement property "a" on null

 Warning: Undefined variable $u4 in %s on line %d
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null
diff --git a/Zend/tests/bug78810.phpt b/Zend/tests/bug78810.phpt
index 0fd56f0ceda..9ca4c2a14a0 100644
--- a/Zend/tests/bug78810.phpt
+++ b/Zend/tests/bug78810.phpt
@@ -10,16 +10,16 @@ class Test {
 $test = new Test;
 try {
     $test->i++;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $test->i += 1;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Typed property Test::$i must not be accessed before initialization
-Typed property Test::$i must not be accessed before initialization
+Error: Typed property Test::$i must not be accessed before initialization
+Error: Typed property Test::$i must not be accessed before initialization
diff --git a/Zend/tests/bug78926.phpt b/Zend/tests/bug78926.phpt
index a59692748b2..f0a35b66964 100644
--- a/Zend/tests/bug78926.phpt
+++ b/Zend/tests/bug78926.phpt
@@ -11,12 +11,12 @@

 try {
     class B extends A {}
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(class_exists('B', false));

 ?>
 --EXPECT--
-Class "A" not found
+Error: Class "A" not found
 bool(false)
diff --git a/Zend/tests/bug79599.phpt b/Zend/tests/bug79599.phpt
index 57e5332431f..5de37578fa7 100644
--- a/Zend/tests/bug79599.phpt
+++ b/Zend/tests/bug79599.phpt
@@ -13,15 +13,15 @@ function test2(){
 }
 try{
     test1();
-}catch(\Exception $e){
-    var_dump($e->getMessage());
+}catch(\Throwable $e){
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try{
     test2();
-}catch(\Exception $e){
-    var_dump($e->getMessage());
+}catch(\Throwable $e){
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(21) "Undefined variable $b"
-string(21) "Undefined variable $c"
+Exception: Undefined variable $b
+Exception: Undefined variable $c
diff --git a/Zend/tests/bug79947.phpt b/Zend/tests/bug79947.phpt
index 0593eacfd6c..4e74631855e 100644
--- a/Zend/tests/bug79947.phpt
+++ b/Zend/tests/bug79947.phpt
@@ -6,12 +6,12 @@
 $key = [];
 try {
     $array[$key] += [$key];
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($array);
 ?>
 --EXPECT--
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type array on array
 array(0) {
 }
diff --git a/Zend/tests/bug80972.phpt b/Zend/tests/bug80972.phpt
index 01d1a98952d..6ca8623f832 100644
--- a/Zend/tests/bug80972.phpt
+++ b/Zend/tests/bug80972.phpt
@@ -19,8 +19,8 @@ function exceptions_error_handler($severity, $message, $filename, $lineno) {
     echo 'Float casted to string compile', \PHP_EOL;
     $string[(string) 10e120] = 'E';
     var_dump($string);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 /* This same bug also permits to modify the first byte of a string even if
@@ -29,13 +29,13 @@ function exceptions_error_handler($severity, $message, $filename, $lineno) {
     /* This must not affect the string value */
     $string["wrong"] = "f";
 } catch (\Throwable $e) {
-    echo $e->getMessage() . \PHP_EOL;
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($string);

 ?>
 --EXPECT--
 Float casted to string compile
-Cannot access offset of type string on string
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
 string(34) "Here is some text for good measure"
diff --git a/Zend/tests/bug81159.phpt b/Zend/tests/bug81159.phpt
index d16deafbf5b..54a85a16012 100644
--- a/Zend/tests/bug81159.phpt
+++ b/Zend/tests/bug81159.phpt
@@ -8,14 +8,14 @@
 try {
     $s[$o] = 'A';
 } catch (\Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump($s[$o]);
 } catch (\Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Cannot access offset of type stdClass on string
-Cannot access offset of type stdClass on string
+TypeError: Cannot access offset of type stdClass on string
+TypeError: Cannot access offset of type stdClass on string
diff --git a/Zend/tests/call_to_abstract_method_args.phpt b/Zend/tests/call_to_abstract_method_args.phpt
index cbbc276d2ce..12771d28717 100644
--- a/Zend/tests/call_to_abstract_method_args.phpt
+++ b/Zend/tests/call_to_abstract_method_args.phpt
@@ -9,18 +9,18 @@ abstract static function method();

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

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

 ?>
 --EXPECT--
-Cannot call abstract method Test::method()
-Cannot call abstract method Test::method()
+Error: Cannot call abstract method Test::method()
+Error: Cannot call abstract method Test::method()
diff --git a/Zend/tests/call_to_deprecated_function_args.phpt b/Zend/tests/call_to_deprecated_function_args.phpt
index bbae7474608..99da008a90c 100644
--- a/Zend/tests/call_to_deprecated_function_args.phpt
+++ b/Zend/tests/call_to_deprecated_function_args.phpt
@@ -11,35 +11,35 @@

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

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

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

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

 ?>
 --EXPECT--
-Function zend_test_deprecated() is deprecated
-Function zend_test_deprecated() is deprecated
-Function zend_test_deprecated() is deprecated
-Function zend_test_deprecated() is deprecated
+Error: Function zend_test_deprecated() is deprecated
+Error: Function zend_test_deprecated() is deprecated
+Error: Function zend_test_deprecated() is deprecated
+Error: Function zend_test_deprecated() is deprecated
diff --git a/Zend/tests/call_user_functions/call_user_func_001.phpt b/Zend/tests/call_user_functions/call_user_func_001.phpt
index 9497d305e2c..e52301a70d1 100644
--- a/Zend/tests/call_user_functions/call_user_func_001.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_001.phpt
@@ -24,18 +24,18 @@ private function priv($str) {
     $class =  __NAMESPACE__ .'\foo';
     try {
         call_user_func(array(new $class, 'priv'), 'foobar');
-    } catch (\TypeError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         call_user_func(array(new $class, 'prot'), 'foobar');
-    } catch (\TypeError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (\Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 ?>
 --EXPECT--
 string(6) "foobar"
-call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access private method testing\foo::priv()
-call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access protected method testing\foo::prot()
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access private method testing\foo::priv()
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access protected method testing\foo::prot()
diff --git a/Zend/tests/call_user_functions/call_user_func_002.phpt b/Zend/tests/call_user_functions/call_user_func_002.phpt
index 443334cd237..9d8f5ffaf34 100644
--- a/Zend/tests/call_user_functions/call_user_func_002.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_002.phpt
@@ -9,33 +9,33 @@

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

 ?>
 --EXPECTF--
 string(3) "foo"
-call_user_func(): Argument #1 ($callback) must be a valid callback, class "foo" not found
-call_user_func(): Argument #1 ($callback) must be a valid callback, class "" not found
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "foo" not found
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "" not found

 Warning: Undefined variable $foo in %s on line %d
-call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object

 Warning: Undefined variable $foo in %s on line %d
-call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
diff --git a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt
index 1849d8fc19b..0f1d34d21a6 100644
--- a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt
@@ -8,8 +8,8 @@
 try {
     $len = [];
     call_user_func_array('var_dump', array_slice($array, 0, $len));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $len = 2.0;
@@ -20,7 +20,7 @@

 ?>
 --EXPECT--
-array_slice(): Argument #3 ($length) must be of type ?int, array given
+TypeError: array_slice(): Argument #3 ($length) must be of type ?int, array given
 int(1)
 int(2)
 int(2)
diff --git a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt
index f73c8bbb246..6df84210c5c 100644
--- a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt
@@ -9,15 +9,15 @@
 try {
     $len = [];
     call_user_func_array('var_dump', array_slice($array, 0, $len));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $len = 2.0;
     call_user_func_array('var_dump', array_slice($array, 0, $len));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $len = null;
@@ -25,7 +25,7 @@

 ?>
 --EXPECT--
-array_slice(): Argument #3 ($length) must be of type ?int, array given
-array_slice(): Argument #3 ($length) must be of type ?int, float given
+TypeError: array_slice(): Argument #3 ($length) must be of type ?int, array given
+TypeError: array_slice(): Argument #3 ($length) must be of type ?int, float given
 int(2)
 int(3)
diff --git a/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt b/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt
index 785a6e35e90..dee17a371a4 100644
--- a/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt
@@ -10,9 +10,9 @@ function func() {
 $drv = new drv;
 try {
     call_user_func_array(array($drv, 'func'), null);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-call_user_func_array(): Argument #2 ($args) must be of type array, null given
+TypeError: call_user_func_array(): Argument #2 ($args) must be of type array, null given
diff --git a/Zend/tests/call_user_functions/call_user_func_by_ref.phpt b/Zend/tests/call_user_functions/call_user_func_by_ref.phpt
index 4596269549a..b8370fcafbd 100644
--- a/Zend/tests/call_user_functions/call_user_func_by_ref.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_by_ref.phpt
@@ -7,11 +7,11 @@ function test(Type &$ref) {
 }
 try {
     call_user_func('test', 0);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
 Warning: test(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
-test(): Argument #1 ($ref) must be of type Type, int given, called in %s on line %d
+TypeError: test(): Argument #1 ($ref) must be of type Type, int given, called in %s on line %d
diff --git a/Zend/tests/callable_param_exception_leak.phpt b/Zend/tests/callable_param_exception_leak.phpt
index 09027997108..8322c433d67 100644
--- a/Zend/tests/callable_param_exception_leak.phpt
+++ b/Zend/tests/callable_param_exception_leak.phpt
@@ -7,9 +7,9 @@
 });
 try {
     array_map('A::b', []);
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Failed
+Exception: Failed
diff --git a/Zend/tests/class_name/class_name_as_scalar_error_007.phpt b/Zend/tests/class_name/class_name_as_scalar_error_007.phpt
index a550cdd2b06..3d51aa382b9 100644
--- a/Zend/tests/class_name/class_name_as_scalar_error_007.phpt
+++ b/Zend/tests/class_name/class_name_as_scalar_error_007.phpt
@@ -5,16 +5,16 @@

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

 ?>
 --EXPECT--
-Cannot use "self" in the global scope
-Cannot use "self" in the global scope
+Error: Cannot use "self" in the global scope
+Error: Cannot use "self" in the global scope
diff --git a/Zend/tests/class_name/class_on_object.phpt b/Zend/tests/class_name/class_on_object.phpt
index dab09872901..8d6627aed21 100644
--- a/Zend/tests/class_name/class_on_object.phpt
+++ b/Zend/tests/class_name/class_on_object.phpt
@@ -16,8 +16,8 @@ function test() {
 }
 try {
     test();
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -25,4 +25,4 @@ function test() {
 string(8) "stdClass"
 string(8) "stdClass"
 string(8) "stdClass"
-Cannot use "::class" on null
+TypeError: Cannot use "::class" on null
diff --git a/Zend/tests/clone/ast.phpt b/Zend/tests/clone/ast.phpt
index e482854a944..f7ff1aaf582 100644
--- a/Zend/tests/clone/ast.phpt
+++ b/Zend/tests/clone/ast.phpt
@@ -8,87 +8,87 @@

 try {
 	assert(false &&  $y = clone $x);
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone($x));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone($x, ));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone($x, [ "foo" => $foo, "bar" => $bar ]));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone($x, $array));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone($x, $array, $extraParameter, $trailingComma, ));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone(object: $x, withProperties: [ "foo" => $foo, "bar" => $bar ]));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone($x, withProperties: [ "foo" => $foo, "bar" => $bar ]));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone(object: $x));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone(object: $x, [ "foo" => $foo, "bar" => $bar ]));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone(...["object" => $x, "withProperties" => [ "foo" => $foo, "bar" => $bar ]]));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(false && $y = clone(...));
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert(false && ($y = \clone($x)))
-assert(false && ($y = \clone($x)))
-assert(false && ($y = \clone($x)))
-assert(false && ($y = \clone($x, ['foo' => $foo, 'bar' => $bar])))
-assert(false && ($y = \clone($x, $array)))
-assert(false && ($y = \clone($x, $array, $extraParameter, $trailingComma)))
-assert(false && ($y = \clone(object: $x, withProperties: ['foo' => $foo, 'bar' => $bar])))
-assert(false && ($y = \clone($x, withProperties: ['foo' => $foo, 'bar' => $bar])))
-assert(false && ($y = \clone(object: $x)))
-assert(false && ($y = \clone(object: $x, ['foo' => $foo, 'bar' => $bar])))
-assert(false && ($y = \clone(...['object' => $x, 'withProperties' => ['foo' => $foo, 'bar' => $bar]])))
-assert(false && ($y = \clone(...)))
+AssertionError: assert(false && ($y = \clone($x)))
+AssertionError: assert(false && ($y = \clone($x)))
+AssertionError: assert(false && ($y = \clone($x)))
+AssertionError: assert(false && ($y = \clone($x, ['foo' => $foo, 'bar' => $bar])))
+AssertionError: assert(false && ($y = \clone($x, $array)))
+AssertionError: assert(false && ($y = \clone($x, $array, $extraParameter, $trailingComma)))
+AssertionError: assert(false && ($y = \clone(object: $x, withProperties: ['foo' => $foo, 'bar' => $bar])))
+AssertionError: assert(false && ($y = \clone($x, withProperties: ['foo' => $foo, 'bar' => $bar])))
+AssertionError: assert(false && ($y = \clone(object: $x)))
+AssertionError: assert(false && ($y = \clone(object: $x, ['foo' => $foo, 'bar' => $bar])))
+AssertionError: assert(false && ($y = \clone(...['object' => $x, 'withProperties' => ['foo' => $foo, 'bar' => $bar]])))
+AssertionError: assert(false && ($y = \clone(...)))
diff --git a/Zend/tests/closures/bug79778.phpt b/Zend/tests/closures/bug79778.phpt
index fa2e2771dce..4da0bd4ad0d 100644
--- a/Zend/tests/closures/bug79778.phpt
+++ b/Zend/tests/closures/bug79778.phpt
@@ -11,8 +11,8 @@

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

 var_dump($closure1);
@@ -49,7 +49,7 @@
         )

 )
-Undefined constant "CONST_REF"
+Error: Undefined constant "CONST_REF"
 object(Closure)#%d (4) {
   ["name"]=>
   string(%d) "{closure:%s:%d}"
diff --git a/Zend/tests/closures/closure_015.phpt b/Zend/tests/closures/closure_015.phpt
index f6903ebdb18..073c72836de 100644
--- a/Zend/tests/closures/closure_015.phpt
+++ b/Zend/tests/closures/closure_015.phpt
@@ -6,16 +6,16 @@
 $x = function() { return 1; };
 try {
     print (string) $x;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     print $x;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Object of class Closure could not be converted to string
-Object of class Closure could not be converted to string
+Error: Object of class Closure could not be converted to string
+Error: Object of class Closure could not be converted to string
diff --git a/Zend/tests/closures/closure_021.phpt b/Zend/tests/closures/closure_021.phpt
index 95ff7d889f9..63b836a35cf 100644
--- a/Zend/tests/closures/closure_021.phpt
+++ b/Zend/tests/closures/closure_021.phpt
@@ -13,10 +13,10 @@

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

 ?>
 --EXPECT--
-string(5) "test!"
+Exception: test!
diff --git a/Zend/tests/closures/closure_027.phpt b/Zend/tests/closures/closure_027.phpt
index 6e467856100..8e5a53a6792 100644
--- a/Zend/tests/closures/closure_027.phpt
+++ b/Zend/tests/closures/closure_027.phpt
@@ -16,7 +16,7 @@ function test(Closure $a) {
 try {
     test($a);
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 test(new stdclass);
@@ -28,7 +28,7 @@ function test(Closure $a) {
 NULL

 Warning: Undefined variable $y in %s on line %d
-Exception: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected

 Fatal error: Uncaught TypeError: test(): Argument #1 ($a) must be of type Closure, stdClass given, called in %s:%d
 Stack trace:
diff --git a/Zend/tests/closures/closure_031.phpt b/Zend/tests/closures/closure_031.phpt
index 19f3dc6e321..e6ae5063a84 100644
--- a/Zend/tests/closures/closure_031.phpt
+++ b/Zend/tests/closures/closure_031.phpt
@@ -10,8 +10,8 @@ function foo($errno, $errstr, $errfile, $errline) {
 };
 try {
     var_dump($foo->a);
-} catch (Error $ex) {
-    echo "Error: {$ex->getMessage()}\n";
+} catch (Throwable $ex) {
+    echo $ex::class, ': ', $ex->getMessage(), "\n";
 }
 ?>
 --EXPECT--
diff --git a/Zend/tests/closures/closure_040.phpt b/Zend/tests/closures/closure_040.phpt
index b733bdbef05..82d4aa245c7 100644
--- a/Zend/tests/closures/closure_040.phpt
+++ b/Zend/tests/closures/closure_040.phpt
@@ -26,14 +26,14 @@ public function getStaticIncrementor() {

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

 $cas->bindTo($a, 'A');

 ?>
 --EXPECTF--
-Closure::bindTo(): Argument #2 ($newScope) must be of type object|string|null, array given
+TypeError: Closure::bindTo(): Argument #2 ($newScope) must be of type object|string|null, array given

 Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d
diff --git a/Zend/tests/closures/closure_059.phpt b/Zend/tests/closures/closure_059.phpt
index d8f7590db90..4b4620c4aa5 100644
--- a/Zend/tests/closures/closure_059.phpt
+++ b/Zend/tests/closures/closure_059.phpt
@@ -19,21 +19,21 @@ class B {

 try {
     $f($b);
-} catch (Error $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     $f->__invoke($b);
-} catch (Error $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     call_user_func(array($f,"__invoke"), $b);
-} catch (Error $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
-Exception: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given, called in %s on line %d
-Exception: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given
-Exception: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given
+TypeError: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given
+TypeError: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given
diff --git a/Zend/tests/closures/closure_063.phpt b/Zend/tests/closures/closure_063.phpt
index b53f370eb4b..f46cdd976c8 100644
--- a/Zend/tests/closures/closure_063.phpt
+++ b/Zend/tests/closures/closure_063.phpt
@@ -9,4 +9,4 @@ function foo(){
 ?>
 DONE
 --EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/Zend/tests/closures/closure_array_key_error.phpt b/Zend/tests/closures/closure_array_key_error.phpt
index 8b6441e3c25..12a94ac1926 100644
--- a/Zend/tests/closures/closure_array_key_error.phpt
+++ b/Zend/tests/closures/closure_array_key_error.phpt
@@ -5,10 +5,10 @@

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

 ?>
 --EXPECT--
-Cannot access offset of type Closure on array
+TypeError: Cannot access offset of type Closure on array
diff --git a/Zend/tests/closures/closure_array_offset_error.phpt b/Zend/tests/closures/closure_array_offset_error.phpt
index 8958237b0eb..4ad86277061 100644
--- a/Zend/tests/closures/closure_array_offset_error.phpt
+++ b/Zend/tests/closures/closure_array_offset_error.phpt
@@ -5,10 +5,10 @@

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

 ?>
 --EXPECT--
-Cannot access offset of type Closure on array
+TypeError: Cannot access offset of type Closure on array
diff --git a/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt b/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt
index e87abf8c906..046a1e371fa 100644
--- a/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt
+++ b/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt
@@ -13,8 +13,8 @@
         })]
         function () { }
     );
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
@@ -25,17 +25,17 @@ function () { }
         })]
         class {}
     );
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert(!#[Attr(static function ($foo) {
+AssertionError: assert(!#[Attr(static function ($foo) {
     echo $foo;
 })] function () {
 })
-assert(!new #[Attr(static function ($foo) {
+AssertionError: assert(!new #[Attr(static function ($foo) {
     echo $foo;
 })] class {
 })
diff --git a/Zend/tests/closures/closure_from_callable_error.phpt b/Zend/tests/closures/closure_from_callable_error.phpt
index c6fd1ff831f..5d14ee39622 100644
--- a/Zend/tests/closures/closure_from_callable_error.phpt
+++ b/Zend/tests/closures/closure_from_callable_error.phpt
@@ -14,7 +14,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }


@@ -27,7 +27,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Cannot access privateInstance method'."\n";
@@ -39,7 +39,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'SubClass cannot access private instance method'."\n";
@@ -51,7 +51,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Cannot access private static function of instance'."\n";
@@ -63,7 +63,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Cannot access private static method statically'."\n";
@@ -75,7 +75,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Cannot access private static method statically with colon scheme'."\n";
@@ -87,7 +87,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Non-existent method should fail'."\n";
@@ -99,7 +99,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Non-existent class should fail'."\n";
@@ -111,7 +111,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Non-existent function should fail'."\n";
@@ -123,7 +123,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }


@@ -137,7 +137,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Subclass cannot closure over parent private static method'."\n";
@@ -150,7 +150,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Function scope cannot closure over protected instance method'."\n";
@@ -162,7 +162,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Function scope cannot closure over private instance method'."\n";
@@ -174,7 +174,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo 'Access private instance method of parent object through "self::" to parent method'."\n";
@@ -187,7 +187,7 @@
     //This is the expected outcome.
 }
 catch (\Throwable $t) {
-    echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+    echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
 }

 echo "OK\n";
diff --git a/Zend/tests/closures/closure_from_callable_non_static_statically.phpt b/Zend/tests/closures/closure_from_callable_non_static_statically.phpt
index 24df1d186a4..ae54c6182c6 100644
--- a/Zend/tests/closures/closure_from_callable_non_static_statically.phpt
+++ b/Zend/tests/closures/closure_from_callable_non_static_statically.phpt
@@ -11,10 +11,10 @@ public function method() {
 try {
     $fn = Closure::fromCallable(['A', 'method']);
     $fn();
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Failed to create closure from callable: non-static method A::method() cannot be called statically
+TypeError: Failed to create closure from callable: non-static method A::method() cannot be called statically
diff --git a/Zend/tests/closures/closure_get_current.phpt b/Zend/tests/closures/closure_get_current.phpt
index 3024ff355b5..e5af665e129 100644
--- a/Zend/tests/closures/closure_get_current.phpt
+++ b/Zend/tests/closures/closure_get_current.phpt
@@ -23,8 +23,8 @@ function fail() {

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

 function foo() {
@@ -33,8 +33,8 @@ function foo() {

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

 ?>
@@ -60,5 +60,5 @@ function foo() {
 int(10)
 int(10)
 int(11)
-Current function is not a closure
-Current function is not a closure
+Error: Current function is not a closure
+Error: Current function is not a closure
diff --git a/Zend/tests/closures/closure_instantiate.phpt b/Zend/tests/closures/closure_instantiate.phpt
index de3b866cb82..55918966fcc 100644
--- a/Zend/tests/closures/closure_instantiate.phpt
+++ b/Zend/tests/closures/closure_instantiate.phpt
@@ -8,14 +8,14 @@
 try {
     // Closures should be instantiatable using new
     $x = new Closure();
-} catch (Exception $e) {
+} catch (Throwable $e) {
     // Instantiating a closure is an error, not an exception, so we shouldn't see this
-    echo 'EXCEPTION: ', $e->getMessage();
+    echo $e::class, ': ', $e->getMessage(), "\n";
 } catch (Throwable $e) {
     // This is the message that we should see for a caught error
-    echo 'ERROR: ', $e->getMessage();
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-ERROR: Instantiation of class Closure is not allowed
+Error: Instantiation of class Closure is not allowed
diff --git a/Zend/tests/closures/closure_write_prop.phpt b/Zend/tests/closures/closure_write_prop.phpt
index 8dbf18e6704..2c0d469d88a 100644
--- a/Zend/tests/closures/closure_write_prop.phpt
+++ b/Zend/tests/closures/closure_write_prop.phpt
@@ -13,10 +13,10 @@ function getFn() {
 $a = new A;
 try {
     $c = $a->getFn()->b = new stdClass;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot create dynamic property Closure::$b
+Error: Cannot create dynamic property Closure::$b
diff --git a/Zend/tests/coalesce/assign_coalesce_002.phpt b/Zend/tests/coalesce/assign_coalesce_002.phpt
index 0b2c5374bc7..ef466865ac1 100644
--- a/Zend/tests/coalesce/assign_coalesce_002.phpt
+++ b/Zend/tests/coalesce/assign_coalesce_002.phpt
@@ -20,8 +20,8 @@ function do_throw($msg) {
 $ary = [];
 try {
     $ary[id($foo)] ??= do_throw("ex1");
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($ary);

@@ -46,8 +46,8 @@ public function __destruct() {
 $ary = new AA;
 try {
     $ary[new Dtor][id($foo)] ??= $bar;
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($foo);

@@ -65,20 +65,20 @@ public function offsetUnset($k): void {}
 $ary = ["foo" => new AA2];
 try {
     $ary[id($foo)][new Dtor] ??= $bar;
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($foo);

 ?>
 --EXPECT--
 id(foo)
-ex1
+Exception: ex1
 array(0) {
 }
 id(foo)
-dtor
+Exception: dtor
 string(3) "foo"
 id(foo)
-dtor
+Exception: dtor
 string(3) "foo"
diff --git a/Zend/tests/compound_assign_with_numeric_strings.phpt b/Zend/tests/compound_assign_with_numeric_strings.phpt
index c6cee53d95c..056394e8ef8 100644
--- a/Zend/tests/compound_assign_with_numeric_strings.phpt
+++ b/Zend/tests/compound_assign_with_numeric_strings.phpt
@@ -11,8 +11,8 @@
 try {
     $n <<= $n;
     var_dump($n);
-} catch (ArithmeticError $e) {
-    echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $n = "65";
@@ -23,16 +23,16 @@
 try {
   $n >>= $n;
   var_dump($n);
-} catch (ArithmeticError $e) {
-    echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $n = "0";
 try{
   $n %= $n;
   var_dump($n);
-} catch (DivisionByZeroError $e) {
-    echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $n = "-1";
@@ -41,11 +41,8 @@
 ?>
 --EXPECT--
 int(0)
-
-Exception: Bit shift by negative number
+ArithmeticError: Bit shift by negative number
 int(0)
-
-Exception: Bit shift by negative number
-
-Exception: Modulo by zero
+ArithmeticError: Bit shift by negative number
+DivisionByZeroError: Modulo by zero
 int(0)
diff --git a/Zend/tests/concat/bug81705.phpt b/Zend/tests/concat/bug81705.phpt
index 1c00b1c77d4..86d897b1db3 100644
--- a/Zend/tests/concat/bug81705.phpt
+++ b/Zend/tests/concat/bug81705.phpt
@@ -16,4 +16,4 @@ function() use(&$my_var) {
 ?>
 --EXPECT--
 error
-string(6) "aArray"
\ No newline at end of file
+string(6) "aArray"
diff --git a/Zend/tests/constant_arrays.phpt b/Zend/tests/constant_arrays.phpt
index eecc7684754..5a8ecaa908e 100644
--- a/Zend/tests/constant_arrays.phpt
+++ b/Zend/tests/constant_arrays.phpt
@@ -33,8 +33,8 @@

 try {
     define('RECURSION', $recursive);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
@@ -104,4 +104,4 @@
   object(stdClass)#1 (0) {
   }
 }
-define(): Argument #2 ($value) cannot be a recursive array
+ValueError: define(): Argument #2 ($value) cannot be a recursive array
diff --git a/Zend/tests/constants/008.phpt b/Zend/tests/constants/008.phpt
index 14e074e5d30..e569cfc5a92 100644
--- a/Zend/tests/constants/008.phpt
+++ b/Zend/tests/constants/008.phpt
@@ -5,8 +5,8 @@

 try {
     var_dump(define(array(1,2,3,4,5), 1));
-} catch (TypeError $e) {
-    echo "TypeError: ", $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump(define("TRUE", 1));
diff --git a/Zend/tests/constants/018.phpt b/Zend/tests/constants/018.phpt
index f348c2b556c..569144e0526 100644
--- a/Zend/tests/constants/018.phpt
+++ b/Zend/tests/constants/018.phpt
@@ -5,8 +5,8 @@

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

 define("TEST_CONST", 1);
@@ -18,7 +18,7 @@
 echo "Done\n";
 ?>
 --EXPECT--
-Undefined constant ""
+Error: Undefined constant ""
 int(1)
 string(4) "test"
 Done
diff --git a/Zend/tests/constants/bug44827.phpt b/Zend/tests/constants/bug44827.phpt
index 8e51087480b..b8f39508a86 100644
--- a/Zend/tests/constants/bug44827.phpt
+++ b/Zend/tests/constants/bug44827.phpt
@@ -5,17 +5,17 @@

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

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

 ?>
 --EXPECT--
-define(): Argument #1 ($constant_name) cannot be a class constant
-define(): Argument #1 ($constant_name) cannot be a class constant
+ValueError: define(): Argument #1 ($constant_name) cannot be a class constant
+ValueError: define(): Argument #1 ($constant_name) cannot be a class constant
diff --git a/Zend/tests/constants/bug51791.phpt b/Zend/tests/constants/bug51791.phpt
index 7675cb564d2..ff104ece7a6 100644
--- a/Zend/tests/constants/bug51791.phpt
+++ b/Zend/tests/constants/bug51791.phpt
@@ -8,10 +8,10 @@ class A  {
 }
 try {
     constant('A::B1');
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Undefined constant A::B1
+Error: Undefined constant A::B1
diff --git a/Zend/tests/constants/dynamic_class_const_fetch.phpt b/Zend/tests/constants/dynamic_class_const_fetch.phpt
index 1924536b964..ae97fdfeaf9 100644
--- a/Zend/tests/constants/dynamic_class_const_fetch.phpt
+++ b/Zend/tests/constants/dynamic_class_const_fetch.phpt
@@ -11,7 +11,7 @@ function test($code) {
     try {
         var_dump(eval($code));
     } catch (Throwable $e) {
-        echo $e->getMessage(), "\n";
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -46,19 +46,19 @@ function test($code) {
 string(3) "bar"

 Warning: Undefined variable $barr in %s : eval()'d code on line %d
-Cannot use value of type null as class constant name
+TypeError: Cannot use value of type null as class constant name

 Warning: Undefined variable $barr in %s : eval()'d code on line %d
-Cannot use value of type null as class constant name
+TypeError: Cannot use value of type null as class constant name
 string(3) "bar"
 string(3) "bar"
 string(3) "Foo"
 string(3) "Foo"
-Cannot use value of type int as class constant name
-Cannot use value of type int as class constant name
-Cannot use value of type int as class constant name
-Cannot use value of type int as class constant name
-Cannot use value of type array as class constant name
-Cannot use value of type array as class constant name
-Cannot use value of type array as class constant name
-Cannot use value of type array as class constant name
+TypeError: Cannot use value of type int as class constant name
+TypeError: Cannot use value of type int as class constant name
+TypeError: Cannot use value of type int as class constant name
+TypeError: Cannot use value of type int as class constant name
+TypeError: Cannot use value of type array as class constant name
+TypeError: Cannot use value of type array as class constant name
+TypeError: Cannot use value of type array as class constant name
+TypeError: Cannot use value of type array as class constant name
diff --git a/Zend/tests/constants/dynamic_class_const_fetch_order.phpt b/Zend/tests/constants/dynamic_class_const_fetch_order.phpt
index 4003c7db928..5f2ce534039 100644
--- a/Zend/tests/constants/dynamic_class_const_fetch_order.phpt
+++ b/Zend/tests/constants/dynamic_class_const_fetch_order.phpt
@@ -21,7 +21,7 @@ function test($c) {
     try {
         echo $c(), "\n";
     } catch (Throwable $e) {
-        echo $e->getMessage(), "\n";
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -32,6 +32,6 @@ function test($c) {
 --EXPECT--
 foo()
 bar()
-Undefined constant Foo::BAR
+Error: Undefined constant Foo::BAR
 bar()
-Undefined constant Foo::BAR
+Error: Undefined constant Foo::BAR
diff --git a/Zend/tests/constants/gh10709.phpt b/Zend/tests/constants/gh10709.phpt
index f394e1a7882..c5ed2395a39 100644
--- a/Zend/tests/constants/gh10709.phpt
+++ b/Zend/tests/constants/gh10709.phpt
@@ -12,8 +12,8 @@ class A { const C = "A"; }

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

 ?>
diff --git a/Zend/tests/constants/gh10709_2.phpt b/Zend/tests/constants/gh10709_2.phpt
index 723fa29cc94..a5a36bce694 100644
--- a/Zend/tests/constants/gh10709_2.phpt
+++ b/Zend/tests/constants/gh10709_2.phpt
@@ -14,8 +14,8 @@ class A { const C = "A"; }

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

 ?>
diff --git a/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt b/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt
index 88c20f10cf6..6823d38137b 100644
--- a/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt
+++ b/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt
@@ -4,11 +4,11 @@
 <?php
 try {
     require("constant_expressions_exceptions.inc");
-} catch (Error $e) {
-    echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
 }
 ?>
 DONE
 --EXPECTF--
-Exception: Unsupported operand types: array - array in %s on line %d
+TypeError: Unsupported operand types: array - array in %s on line %d
 DONE
diff --git a/Zend/tests/constexpr/gh7771_3.phpt b/Zend/tests/constexpr/gh7771_3.phpt
index e44a01a8aec..58205831025 100644
--- a/Zend/tests/constexpr/gh7771_3.phpt
+++ b/Zend/tests/constexpr/gh7771_3.phpt
@@ -13,4 +13,3 @@
 ?>
 --EXPECTF--
 Fatal error: Constant expression contains invalid operations in %sgh7771_3.php(7) : eval()'d code on line 1
-
diff --git a/Zend/tests/constexpr/new.phpt b/Zend/tests/constexpr/new.phpt
index 79bbc41f69b..7cd5611d223 100644
--- a/Zend/tests/constexpr/new.phpt
+++ b/Zend/tests/constexpr/new.phpt
@@ -5,8 +5,8 @@

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

 static $b = new stdClass;
@@ -14,8 +14,8 @@

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

 class Test {
@@ -24,8 +24,8 @@ public function __construct(public $a, public $b) {}

 try {
     eval('static $d = new Test(new stdClass, [] + 0);');
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 static $e = new Test(new stdClass, 42);
@@ -40,17 +40,17 @@ public function __construct() {

 try {
     eval('static $f = new Test2();');
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Class "DoesNotExist" not found
+Error: Class "DoesNotExist" not found
 object(stdClass)#2 (0) {
 }
-Unsupported operand types: array + int
-Unsupported operand types: array + int
+TypeError: Unsupported operand types: array + int
+TypeError: Unsupported operand types: array + int
 object(Test)#4 (2) {
   ["a"]=>
   object(stdClass)#1 (0) {
@@ -59,4 +59,4 @@ public function __construct() {
   int(42)
 }
 Side-effect
-Failed to construct
+Exception: Failed to construct
diff --git a/Zend/tests/constexpr/new_named_params.phpt b/Zend/tests/constexpr/new_named_params.phpt
index 6b57088f60f..3ff3ab6679f 100644
--- a/Zend/tests/constexpr/new_named_params.phpt
+++ b/Zend/tests/constexpr/new_named_params.phpt
@@ -18,8 +18,8 @@ public function __construct(public float $x, public float $y, public float $z) {

 try {
     eval('static $d = new Vec(x: 0.0, x: 1.0);');
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -48,4 +48,4 @@ public function __construct(public float $x, public float $y, public float $z) {
   ["z"]=>
   float(1)
 }
-Named parameter $x overwrites previous argument
+Error: Named parameter $x overwrites previous argument
diff --git a/Zend/tests/constexpr/new_self_parent.phpt b/Zend/tests/constexpr/new_self_parent.phpt
index b134f77a498..80aa36b5b0d 100644
--- a/Zend/tests/constexpr/new_self_parent.phpt
+++ b/Zend/tests/constexpr/new_self_parent.phpt
@@ -19,14 +19,14 @@ function invalid($x = new self) {}

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

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

 ?>
@@ -35,5 +35,5 @@ function invalid($x = new self) {}
 }
 object(A)#2 (0) {
 }
-Cannot access "self" when no class scope is active
-Cannot access "parent" when current class scope has no parent
+Error: Cannot access "self" when no class scope is active
+Error: Cannot access "parent" when current class scope has no parent
diff --git a/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt b/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt
index 206f99fd409..747c42167c1 100644
--- a/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt
+++ b/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt
@@ -12,10 +12,10 @@ public function __construct(public int $x, public int $y, public int $z) {}
 // Check that properties really are typed.
 try {
     $point->x = "foo";
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot assign string to property Point::$x of type int
+TypeError: Cannot assign string to property Point::$x of type int
diff --git a/Zend/tests/div_002.phpt b/Zend/tests/div_002.phpt
index 22ed3f13933..0de52bc2ecb 100644
--- a/Zend/tests/div_002.phpt
+++ b/Zend/tests/div_002.phpt
@@ -8,8 +8,8 @@

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

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

 Fatal error: Uncaught TypeError: Unsupported operand types: array / array in %s:%d
 Stack trace:
diff --git a/Zend/tests/div_by_zero_compound_refcounted.phpt b/Zend/tests/div_by_zero_compound_refcounted.phpt
index 7f0f59622b4..519a8bff42e 100644
--- a/Zend/tests/div_by_zero_compound_refcounted.phpt
+++ b/Zend/tests/div_by_zero_compound_refcounted.phpt
@@ -6,11 +6,11 @@
 $h .= "2";
 try {
     $h /= 0;
-} catch (DivisionByZeroError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($h);
 ?>
 --EXPECT--
-Division by zero
+DivisionByZeroError: Division by zero
 string(2) "12"
diff --git a/Zend/tests/div_by_zero_compound_with_conversion.phpt b/Zend/tests/div_by_zero_compound_with_conversion.phpt
index ba391328169..1c3bcf0a2bf 100644
--- a/Zend/tests/div_by_zero_compound_with_conversion.phpt
+++ b/Zend/tests/div_by_zero_compound_with_conversion.phpt
@@ -5,10 +5,10 @@
 $x = 42;
 try {
     $$x /= 0;
-} catch (DivisionByZeroError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Warning: Undefined variable $42 in %s on line %d
-Division by zero
+DivisionByZeroError: Division by zero
diff --git a/Zend/tests/dynamic_call/bug48770_2.phpt b/Zend/tests/dynamic_call/bug48770_2.phpt
index 14fe28cca23..46f57d0d7a9 100644
--- a/Zend/tests/dynamic_call/bug48770_2.phpt
+++ b/Zend/tests/dynamic_call/bug48770_2.phpt
@@ -25,14 +25,14 @@ public function func($str) {

         try {
             call_user_func_array(array($this, 'parent::func22'), array($str));
-        } catch (\TypeError $e) {
-            echo $e->getMessage() . \PHP_EOL;
+        } catch (\Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }

         try {
             call_user_func_array(array($this, 'parent::inexistent'), array($str));
-        } catch (\TypeError $e) {
-            echo $e->getMessage() . \PHP_EOL;
+        } catch (\Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
     private function func2($str) {
@@ -61,7 +61,7 @@ public function func($str) {
 string(27) "B::func3: This should work!"

 Deprecated: Callables of the form ["C", "parent::func22"] are deprecated in %s on line %d
-call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method B::func22()
+TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method B::func22()

 Deprecated: Callables of the form ["C", "parent::inexistent"] are deprecated in %s on line %d
-call_user_func_array(): Argument #1 ($callback) must be a valid callback, class B does not have a method "inexistent"
+TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class B does not have a method "inexistent"
diff --git a/Zend/tests/dynamic_call/bug48770_3.phpt b/Zend/tests/dynamic_call/bug48770_3.phpt
index 98311eb8ece..6f95117d072 100644
--- a/Zend/tests/dynamic_call/bug48770_3.phpt
+++ b/Zend/tests/dynamic_call/bug48770_3.phpt
@@ -22,8 +22,8 @@ public function func($str) {

         try {
             call_user_func_array(array($this, 'self::inexistent'), array($str));
-        } catch (\TypeError $e) {
-            echo $e->getMessage() . \PHP_EOL;
+        } catch (\Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
     private function func2($str) {
@@ -52,4 +52,4 @@ public function func($str) {
 string(27) "B::func3: This should work!"

 Deprecated: Callables of the form ["C", "self::inexistent"] are deprecated in %s on line %d
-call_user_func_array(): Argument #1 ($callback) must be a valid callback, class C does not have a method "inexistent"
+TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class C does not have a method "inexistent"
diff --git a/Zend/tests/dynamic_call/bug68475.phpt b/Zend/tests/dynamic_call/bug68475.phpt
index fef8173fc64..e3d717b6287 100644
--- a/Zend/tests/dynamic_call/bug68475.phpt
+++ b/Zend/tests/dynamic_call/bug68475.phpt
@@ -36,16 +36,16 @@ public static function staticMethodWithArgs($arg1, $arg2, $arg3)
 $callback = 'TestClass::undefinedMethod';
 try {
     $callback();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // Reference undefined class.
 $callback = 'UndefinedClass::testMethod';
 try {
     $callback();
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
@@ -53,5 +53,5 @@ public static function staticMethodWithArgs($arg1, $arg2, $arg3)
 Static method called!
 Static method called with args: arg1, arg2, arg3
 Static method called with args: arg1, arg2, arg3
-Call to undefined method TestClass::undefinedMethod()
-Class "UndefinedClass" not found
+Error: Call to undefined method TestClass::undefinedMethod()
+Error: Class "UndefinedClass" not found