Commit f978c5ab42e for php.net

commit f978c5ab42e4cd425ad7c392b1e564683088b857
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date:   Sun Sep 20 19:17:47 2026 +0700

    ext/standard: applied fixers to improve test robustness (#23136)

diff --git a/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt b/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt
index 2e3e85357e1..1895562dc17 100644
--- a/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt
+++ b/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt
@@ -7,10 +7,10 @@
 $arr = range(0, 2**$power);
 try {
     array_merge(...array_fill(0, 2**(32-$power), $arr));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
-The total number of elements must be lower than %d
+Error: The total number of elements must be lower than %d
diff --git a/ext/standard/tests/array/array_chunk2.phpt b/ext/standard/tests/array/array_chunk2.phpt
index c83f051a271..e195f07839f 100644
--- a/ext/standard/tests/array/array_chunk2.phpt
+++ b/ext/standard/tests/array/array_chunk2.phpt
@@ -6,14 +6,14 @@

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

 try {
     var_dump(array_chunk($input_array, 0, true));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump(array_chunk($input_array, 1));
@@ -24,8 +24,8 @@
 var_dump(array_chunk($input_array, 10, true));
 ?>
 --EXPECT--
-array_chunk(): Argument #2 ($length) must be greater than 0
-array_chunk(): Argument #2 ($length) must be greater than 0
+ValueError: array_chunk(): Argument #2 ($length) must be greater than 0
+ValueError: array_chunk(): Argument #2 ($length) must be greater than 0
 array(5) {
   [0]=>
   array(1) {
diff --git a/ext/standard/tests/array/array_chunk_variation5.phpt b/ext/standard/tests/array/array_chunk_variation5.phpt
index dfae48974d8..ac0c2c4ddd6 100644
--- a/ext/standard/tests/array/array_chunk_variation5.phpt
+++ b/ext/standard/tests/array/array_chunk_variation5.phpt
@@ -23,18 +23,18 @@
     echo "\n-- Testing array_chunk() when size = $size --\n";
     try {
         var_dump( array_chunk($input_array, $size) );
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         var_dump( array_chunk($input_array, $size, true) );
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         var_dump( array_chunk($input_array, $size, false) );
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 ?>
@@ -42,9 +42,9 @@
 *** Testing array_chunk() : usage variations ***

 -- Testing array_chunk() when size = -1 --
-array_chunk(): Argument #2 ($length) must be greater than 0
-array_chunk(): Argument #2 ($length) must be greater than 0
-array_chunk(): Argument #2 ($length) must be greater than 0
+ValueError: array_chunk(): Argument #2 ($length) must be greater than 0
+ValueError: array_chunk(): Argument #2 ($length) must be greater than 0
+ValueError: array_chunk(): Argument #2 ($length) must be greater than 0

 -- Testing array_chunk() when size = 4 --
 array(1) {
@@ -82,9 +82,9 @@
 }

 -- Testing array_chunk() when size = 0 --
-array_chunk(): Argument #2 ($length) must be greater than 0
-array_chunk(): Argument #2 ($length) must be greater than 0
-array_chunk(): Argument #2 ($length) must be greater than 0
+ValueError: array_chunk(): Argument #2 ($length) must be greater than 0
+ValueError: array_chunk(): Argument #2 ($length) must be greater than 0
+ValueError: array_chunk(): Argument #2 ($length) must be greater than 0

 -- Testing array_chunk() when size = 1 --
 array(3) {
diff --git a/ext/standard/tests/array/array_combine_error2.phpt b/ext/standard/tests/array/array_combine_error2.phpt
index 8d3440eaac5..eca46bf30f7 100644
--- a/ext/standard/tests/array/array_combine_error2.phpt
+++ b/ext/standard/tests/array/array_combine_error2.phpt
@@ -12,24 +12,24 @@
 echo "\n-- Testing array_combine() function with empty array for \$keys argument --\n";
 try {
     var_dump( array_combine(array(), array(1, 2)) );
-} catch (\ValueError $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // Testing array_combine by passing empty array to $values
-echo "\n-- Testing array_combine() function with empty array for \$values argument --\n";
+echo "-- Testing array_combine() function with empty array for \$values argument --\n";
 try {
     var_dump( array_combine(array(1, 2), array()) );
-} catch (\ValueError $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // Testing array_combine with arrays having unequal number of elements
-echo "\n-- Testing array_combine() function by passing array with unequal number of elements --\n";
+echo "-- Testing array_combine() function by passing array with unequal number of elements --\n";
 try {
     var_dump( array_combine(array(1, 2), array(1, 2, 3)) );
-} catch (\ValueError $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -41,8 +41,8 @@
 }

 -- Testing array_combine() function with empty array for $keys argument --
-array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements
+ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements
 -- Testing array_combine() function with empty array for $values argument --
-array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements
+ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements
 -- Testing array_combine() function by passing array with unequal number of elements --
-array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements
+ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements
diff --git a/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt b/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt
index 77aef0ccc08..633a55200cd 100644
--- a/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt
+++ b/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt
@@ -5,10 +5,10 @@

 try {
     array_diff([123], 'x');
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-array_diff(): Argument #2 must be of type array, string given
+TypeError: array_diff(): Argument #2 must be of type array, string given
diff --git a/ext/standard/tests/array/array_diff_max_elements.phpt b/ext/standard/tests/array/array_diff_max_elements.phpt
index 4c65cd049b3..79386ef42c8 100644
--- a/ext/standard/tests/array/array_diff_max_elements.phpt
+++ b/ext/standard/tests/array/array_diff_max_elements.phpt
@@ -7,10 +7,10 @@
 $arr = range(0, 2**$power);
 try {
     array_diff(...array_fill(0, 2**(32-$power), $arr));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
-The total number of elements must be lower than %d
+Error: The total number of elements must be lower than %d
diff --git a/ext/standard/tests/array/array_fill_error.phpt b/ext/standard/tests/array/array_fill_error.phpt
index 9b04f755394..9378233d393 100644
--- a/ext/standard/tests/array/array_fill_error.phpt
+++ b/ext/standard/tests/array/array_fill_error.phpt
@@ -11,11 +11,11 @@

 try {
     var_dump( array_fill($start_key,$num,$val) );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 *** Testing array_fill() : error conditions ***
-array_fill(): Argument #2 ($count) must be greater than or equal to 0
+ValueError: array_fill(): Argument #2 ($count) must be greater than or equal to 0
diff --git a/ext/standard/tests/array/array_fill_error2.phpt b/ext/standard/tests/array/array_fill_error2.phpt
index 1f8b841c842..d8a8fb38800 100644
--- a/ext/standard/tests/array/array_fill_error2.phpt
+++ b/ext/standard/tests/array/array_fill_error2.phpt
@@ -9,8 +9,8 @@
 // calling array_fill() with 'count' larger than INT_MAX
 try {
     $array = array_fill(0, $intMax+1, 1);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // calling array_fill() with 'count' equals to INT_MAX
@@ -18,6 +18,6 @@

 ?>
 --EXPECTF--
-array_fill(): Argument #2 ($count) is too large
+ValueError: array_fill(): Argument #2 ($count) is too large

 Fatal error: Possible integer overflow in memory allocation (%d * %d + %d) in %s on line %d
diff --git a/ext/standard/tests/array/array_fill_variation6.phpt b/ext/standard/tests/array/array_fill_variation6.phpt
index 60dcec7e231..8c541585476 100644
--- a/ext/standard/tests/array/array_fill_variation6.phpt
+++ b/ext/standard/tests/array/array_fill_variation6.phpt
@@ -9,11 +9,11 @@
 );
 try {
     $a[] = "bar";
-} catch (Error $ex) {
-    echo $ex->getMessage(), PHP_EOL;
+} catch (Throwable $ex) {
+    echo $ex::class, ': ', $ex->getMessage(), "\n";
 }
 ?>
 --EXPECT--
 int(1)
 bool(true)
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
diff --git a/ext/standard/tests/array/array_filter_invalid_mode.phpt b/ext/standard/tests/array/array_filter_invalid_mode.phpt
index b312bcfe5a2..4994aa63a00 100644
--- a/ext/standard/tests/array/array_filter_invalid_mode.phpt
+++ b/ext/standard/tests/array/array_filter_invalid_mode.phpt
@@ -6,7 +6,7 @@
 try {
     var_dump(array_filter([], mode: 999));
 } catch (Throwable $e) {
-    echo $e::class . ': '.$e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done"
diff --git a/ext/standard/tests/array/array_filter_variation10.phpt b/ext/standard/tests/array/array_filter_variation10.phpt
index eef7b646203..9e69da73f4f 100644
--- a/ext/standard/tests/array/array_filter_variation10.phpt
+++ b/ext/standard/tests/array/array_filter_variation10.phpt
@@ -32,7 +32,7 @@ function dump2($value, $key)
 try {
     var_dump( array_filter($small, 'dump', false) );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "*** Testing array_filter() with various use types ***\n";
@@ -45,8 +45,8 @@ function dump2($value, $key)

 try {
     var_dump(array_filter($mixed, 'is_numeric', ARRAY_FILTER_USE_BOTH));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done"
@@ -73,7 +73,7 @@ function dump2($value, $key)
   NULL
 }
 *** Testing array_filter() : usage variations - 'callback' expecting second argument ***
-Exception: Too few arguments to function dump(), 1 passed and exactly 2 expected
+ArgumentCountError: Too few arguments to function dump(), 1 passed and exactly 2 expected
 *** Testing array_filter() with various use types ***
 array(2) {
   [1]=>
@@ -87,5 +87,5 @@ function dump2($value, $key)
   ["b"]=>
   int(2)
 }
-is_numeric() expects exactly 1 argument, 2 given
+ArgumentCountError: is_numeric() expects exactly 1 argument, 2 given
 Done
diff --git a/ext/standard/tests/array/array_filter_variation9.phpt b/ext/standard/tests/array/array_filter_variation9.phpt
index 2e6efc0eda5..43919b2542d 100644
--- a/ext/standard/tests/array/array_filter_variation9.phpt
+++ b/ext/standard/tests/array/array_filter_variation9.phpt
@@ -19,15 +19,15 @@
 // using language construct 'echo' as 'callback'
 try {
     var_dump( array_filter($input, 'echo') );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // using language construct 'isset' as 'callback'
 try {
     var_dump( array_filter($input, 'isset') );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done"
@@ -54,6 +54,6 @@
   [3]=>
   int(100)
 }
-array_filter(): Argument #2 ($callback) must be a valid callback or null, function "echo" not found or invalid function name
-array_filter(): Argument #2 ($callback) must be a valid callback or null, function "isset" not found or invalid function name
+TypeError: array_filter(): Argument #2 ($callback) must be a valid callback or null, function "echo" not found or invalid function name
+TypeError: array_filter(): Argument #2 ($callback) must be a valid callback or null, function "isset" not found or invalid function name
 Done
diff --git a/ext/standard/tests/array/array_key_exists.phpt b/ext/standard/tests/array/array_key_exists.phpt
index 92373b04bb4..0960bf76584 100644
--- a/ext/standard/tests/array/array_key_exists.phpt
+++ b/ext/standard/tests/array/array_key_exists.phpt
@@ -63,8 +63,8 @@
 // first args as array
 try {
     array_key_exists(array(), array());
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\n*** Testing operation on objects ***\n";
@@ -76,8 +76,8 @@ class key_check
 $key_check_obj = new key_check; //new object
 try {
     var_dump(array_key_exists("public_var", $key_check_obj));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -250,8 +250,8 @@ class key_check
 bool(true)

 *** Testing error conditions ***
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type array on array

 *** Testing operation on objects ***
-array_key_exists(): Argument #2 ($array) must be of type array, key_check given
+TypeError: array_key_exists(): Argument #2 ($array) must be of type array, key_check given
 Done
diff --git a/ext/standard/tests/array/array_key_exists_variation1.phpt b/ext/standard/tests/array/array_key_exists_variation1.phpt
index d12fbc839b7..366171d4cbb 100644
--- a/ext/standard/tests/array/array_key_exists_variation1.phpt
+++ b/ext/standard/tests/array/array_key_exists_variation1.phpt
@@ -79,8 +79,8 @@ public function __toString() {
   echo "\n-- Iteration $iterator --\n";
   try {
       var_dump( array_key_exists($input, $search) );
-  } catch (TypeError $exception) {
-      echo $exception->getMessage() . "\n";
+  } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
   }
   $iterator++;
 };
@@ -133,7 +133,7 @@ public function __toString() {
 bool(false)

 -- Iteration 13 --
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type array on array

 -- Iteration 14 --
 bool(true)
@@ -145,7 +145,7 @@ public function __toString() {
 bool(true)

 -- Iteration 17 --
-Cannot access offset of type classA on array
+TypeError: Cannot access offset of type classA on array

 -- Iteration 18 --

diff --git a/ext/standard/tests/array/array_key_exists_variation3.phpt b/ext/standard/tests/array/array_key_exists_variation3.phpt
index 5abff19378f..6cdfbd4a4db 100644
--- a/ext/standard/tests/array/array_key_exists_variation3.phpt
+++ b/ext/standard/tests/array/array_key_exists_variation3.phpt
@@ -19,8 +19,8 @@
     echo "Pass float as \$key:\n";
     try {
         var_dump(array_key_exists($key, $search));
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
     echo "Cast float to int:\n";
     var_dump(array_key_exists((int)$key, $search));
diff --git a/ext/standard/tests/array/array_map_error.phpt b/ext/standard/tests/array/array_map_error.phpt
index 7d1d6986aba..e9598469738 100644
--- a/ext/standard/tests/array/array_map_error.phpt
+++ b/ext/standard/tests/array/array_map_error.phpt
@@ -12,7 +12,7 @@ function callback1() {
 try {
     var_dump( array_map('callback1') );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Testing array_map() function with less no. of arrays than callback function arguments --\n";
@@ -23,7 +23,7 @@ function callback2($p, $q) {
 try {
     var_dump( array_map('callback2', $arr1) );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Testing array_map() function with more no. of arrays than callback function arguments --\n";
@@ -37,10 +37,10 @@ function callback2($p, $q) {
 *** Testing array_map() : error conditions ***

 -- Testing array_map() function with one less than expected no. of arguments --
-Exception: array_map() expects at least 2 arguments, 1 given
+ArgumentCountError: array_map() expects at least 2 arguments, 1 given

 -- Testing array_map() function with less no. of arrays than callback function arguments --
-Exception: Too few arguments to function callback2(), 1 passed and exactly 2 expected
+ArgumentCountError: Too few arguments to function callback2(), 1 passed and exactly 2 expected

 -- Testing array_map() function with more no. of arrays than callback function arguments --
 array(2) {
diff --git a/ext/standard/tests/array/array_map_object3.phpt b/ext/standard/tests/array/array_map_object3.phpt
index 55a97a317f2..019b53fb239 100644
--- a/ext/standard/tests/array/array_map_object3.phpt
+++ b/ext/standard/tests/array/array_map_object3.phpt
@@ -48,8 +48,8 @@ public function nonstaticChild($n) {
 echo "-- accessing child method from parent class --\n";
 try {
     var_dump( array_map(array('ParentClass', 'staticChild'), $arr1) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "-- accessing parent method using child class object --\n";
@@ -58,8 +58,8 @@ public function nonstaticChild($n) {
 echo "-- accessing child method using parent class object --\n";
 try {
     var_dump( array_map(array($parentobj, 'staticChild'), $arr1) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done";
@@ -76,7 +76,7 @@ public function nonstaticChild($n) {
   int(7)
 }
 -- accessing child method from parent class --
-array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild"
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild"
 -- accessing parent method using child class object --
 array(3) {
   [0]=>
@@ -87,5 +87,5 @@ public function nonstaticChild($n) {
   int(7)
 }
 -- accessing child method using parent class object --
-array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild"
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild"
 Done
diff --git a/ext/standard/tests/array/array_map_variation10.phpt b/ext/standard/tests/array/array_map_variation10.phpt
index 2f7bac4c914..abd6d53063a 100644
--- a/ext/standard/tests/array/array_map_variation10.phpt
+++ b/ext/standard/tests/array/array_map_variation10.phpt
@@ -18,7 +18,7 @@
 try {
     var_dump( array_map( function($a, $b) { return array($a, $b); }, $array1));
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "-- anonymous function with NULL parameter --\n";
@@ -30,8 +30,8 @@
 echo "-- passing NULL as 'array1' --\n";
 try {
     var_dump( array_map( function($a) { return array($a); }, NULL));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done";
@@ -63,7 +63,7 @@
   }
 }
 -- anonymous function with two parameters and passing one array --
-Exception: Too few arguments to function {closure:%s:%d}(), 1 passed and exactly 2 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 1 passed and exactly 2 expected
 -- anonymous function with NULL parameter --
 array(3) {
   [0]=>
@@ -83,5 +83,5 @@
   NULL
 }
 -- passing NULL as 'array1' --
-array_map(): Argument #2 ($array) must be of type array, null given
+TypeError: array_map(): Argument #2 ($array) must be of type array, null given
 Done
diff --git a/ext/standard/tests/array/array_map_variation12.phpt b/ext/standard/tests/array/array_map_variation12.phpt
index d3fa62e93d6..df8aba9d701 100644
--- a/ext/standard/tests/array/array_map_variation12.phpt
+++ b/ext/standard/tests/array/array_map_variation12.phpt
@@ -17,15 +17,15 @@
 echo "-- with built-in function 'pow' and one parameter --\n";
 try {
     var_dump( array_map('pow', $array1));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "-- with language construct --\n";
 try {
     var_dump( array_map('echo', $array1));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done";
@@ -42,7 +42,7 @@
   int(243)
 }
 -- with built-in function 'pow' and one parameter --
-pow() expects exactly 2 arguments, 1 given
+ArgumentCountError: pow() expects exactly 2 arguments, 1 given
 -- with language construct --
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name
 Done
diff --git a/ext/standard/tests/array/array_map_variation14.phpt b/ext/standard/tests/array/array_map_variation14.phpt
index d8977e73acd..22d59c70a57 100644
--- a/ext/standard/tests/array/array_map_variation14.phpt
+++ b/ext/standard/tests/array/array_map_variation14.phpt
@@ -33,15 +33,15 @@
 echo "-- with empty string --\n";
 try {
     var_dump( array_map("", $arr1, $arr2) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "-- with empty array --\n";
 try {
     var_dump( array_map(array(), $arr1, $arr2) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done";
@@ -118,7 +118,7 @@
   int(2)
 }
 -- with empty string --
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name
 -- with empty array --
-array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members
 Done
diff --git a/ext/standard/tests/array/array_map_variation16.phpt b/ext/standard/tests/array/array_map_variation16.phpt
index 7ee1f04967c..e355f796ebc 100644
--- a/ext/standard/tests/array/array_map_variation16.phpt
+++ b/ext/standard/tests/array/array_map_variation16.phpt
@@ -20,19 +20,19 @@
 {
     try {
         var_dump( array_map($callback, $arg) );
-    } catch (TypeError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 echo "Done";
 ?>
 --EXPECT--
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "array" not found or invalid function name
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "empty" not found or invalid function name
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "eval" not found or invalid function name
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "isset" not found or invalid function name
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "list" not found or invalid function name
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "print" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "array" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "empty" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "eval" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "isset" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "list" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "print" not found or invalid function name
 Done
diff --git a/ext/standard/tests/array/array_map_variation9.phpt b/ext/standard/tests/array/array_map_variation9.phpt
index eb4d400aad4..f452bfb3eb2 100644
--- a/ext/standard/tests/array/array_map_variation9.phpt
+++ b/ext/standard/tests/array/array_map_variation9.phpt
@@ -27,7 +27,7 @@ function callback2($a, $b)
 try {
     var_dump( array_map(b"callback2", $arr1) );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done";
@@ -46,5 +46,5 @@ function callback2($a, $b)
   string(5) "22.22"
 }
 -- checking binary safe array with two parameter callback function --
-Exception: Too few arguments to function callback2(), 1 passed and exactly 2 expected
+ArgumentCountError: Too few arguments to function callback2(), 1 passed and exactly 2 expected
 Done
diff --git a/ext/standard/tests/array/array_pad_too_large_padding.phpt b/ext/standard/tests/array/array_pad_too_large_padding.phpt
index 3a45e834f9a..7067c6de993 100644
--- a/ext/standard/tests/array/array_pad_too_large_padding.phpt
+++ b/ext/standard/tests/array/array_pad_too_large_padding.phpt
@@ -6,8 +6,8 @@
 function test($length) {
     try {
         var_dump(array_pad(array("", -1, 2.0), $length, 0));
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -16,5 +16,5 @@ function test($length) {

 ?>
 --EXPECT--
-array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size
-array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size
+ValueError: array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size
+ValueError: array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size
diff --git a/ext/standard/tests/array/array_product_variation1.phpt b/ext/standard/tests/array/array_product_variation1.phpt
index 330479f4ef8..b84471f00fc 100644
--- a/ext/standard/tests/array/array_product_variation1.phpt
+++ b/ext/standard/tests/array/array_product_variation1.phpt
@@ -53,4 +53,3 @@ static function help() { echo "hello\n"; }

 Warning: array_product(): Multiplication is not supported on type array in %s on line %d
 int(1)
-
diff --git a/ext/standard/tests/array/array_product_variation5.phpt b/ext/standard/tests/array/array_product_variation5.phpt
index 525b6a52bd1..a2ab9cf4144 100644
--- a/ext/standard/tests/array/array_product_variation5.phpt
+++ b/ext/standard/tests/array/array_product_variation5.phpt
@@ -10,8 +10,8 @@
 echo "array_reduce() version:\n";
 try {
     var_dump(array_reduce($input, fn($carry, $value) => $carry * $value, 1));
-} catch (TypeError $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
@@ -20,4 +20,4 @@
 Warning: array_product(): Multiplication is not supported on type resource in %s on line %d
 int(30)
 array_reduce() version:
-Unsupported operand types: int * resource
+TypeError: Unsupported operand types: int * resource
diff --git a/ext/standard/tests/array/array_push_error2.phpt b/ext/standard/tests/array/array_push_error2.phpt
index 0ed0af6e1b4..34cf90bf0b0 100644
--- a/ext/standard/tests/array/array_push_error2.phpt
+++ b/ext/standard/tests/array/array_push_error2.phpt
@@ -12,15 +12,15 @@
 $array = array(PHP_INT_MAX => 'max');
 try {
     var_dump(array_push($array, 'new'));
-} catch (\Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($array);

 ?>
 --EXPECTF--
 *** Testing array_push() : error conditions ***
-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]=>
   string(3) "max"
diff --git a/ext/standard/tests/array/array_rand.phpt b/ext/standard/tests/array/array_rand.phpt
index 24f6966bb08..15ed8785582 100644
--- a/ext/standard/tests/array/array_rand.phpt
+++ b/ext/standard/tests/array/array_rand.phpt
@@ -5,32 +5,32 @@

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

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

 try {
     var_dump(array_rand(array(1,2,3), 0));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     var_dump(array_rand(array(1,2,3), -1));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     var_dump(array_rand(array(1,2,3), 10));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump(array_rand(array(1,2,3), 3));
@@ -38,11 +38,11 @@

 ?>
 --EXPECTF--
-array_rand(): Argument #1 ($array) must not be empty
-array_rand(): Argument #1 ($array) must not be empty
-array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
-array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
-array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
+ValueError: array_rand(): Argument #1 ($array) must not be empty
+ValueError: array_rand(): Argument #1 ($array) must not be empty
+ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
+ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
+ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
 array(3) {
   [0]=>
   int(%d)
diff --git a/ext/standard/tests/array/array_rand_variation5.phpt b/ext/standard/tests/array/array_rand_variation5.phpt
index 57f5ee03af9..b8a13ccba9f 100644
--- a/ext/standard/tests/array/array_rand_variation5.phpt
+++ b/ext/standard/tests/array/array_rand_variation5.phpt
@@ -28,29 +28,29 @@
 echo"\n-- With num_req = 0 --\n";
 try {
     var_dump( array_rand($input, 0) );  // with $num_req=0
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo"\n-- With num_req = -1 --\n";
 try {
     var_dump( array_rand($input, -1) );  // with $num_req=-1
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo"\n-- With num_req = -2 --\n";
 try {
     var_dump( array_rand($input, -2) );  // with $num_req=-2
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo"\n-- With num_req more than number of members in 'input' array --\n";
 try {
     var_dump( array_rand($input, 13) );  // with $num_req=13
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -64,13 +64,13 @@
 int(%d)

 -- With num_req = 0 --
-array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
+ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)

 -- With num_req = -1 --
-array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
+ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)

 -- With num_req = -2 --
-array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
+ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)

 -- With num_req more than number of members in 'input' array --
-array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
+ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)
diff --git a/ext/standard/tests/array/array_reduce_variation1.phpt b/ext/standard/tests/array/array_reduce_variation1.phpt
index d1b6bf204d6..84dc3d4f8e1 100644
--- a/ext/standard/tests/array/array_reduce_variation1.phpt
+++ b/ext/standard/tests/array/array_reduce_variation1.phpt
@@ -22,7 +22,7 @@ function threeArgs($v, $w, $x) {
 try {
     var_dump(array_reduce($array, "threeArgs", 2));
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -33,4 +33,4 @@ function threeArgs($v, $w, $x) {
 int(2)

 --- Testing with a callback with too many parameters ---
-Exception: Too few arguments to function threeArgs(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function threeArgs(), 2 passed and exactly 3 expected
diff --git a/ext/standard/tests/array/array_search_variation3.phpt b/ext/standard/tests/array/array_search_variation3.phpt
index 36a405175e2..01a4a874c09 100644
--- a/ext/standard/tests/array/array_search_variation3.phpt
+++ b/ext/standard/tests/array/array_search_variation3.phpt
@@ -29,14 +29,14 @@ public function foo() {
 //error: as wrong datatype for second argument
 try {
     var_dump( array_search("array_var", $array_search_obj) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 //error: as wrong datatype for second argument
 try {
     var_dump( array_search("foo", $array_search_obj) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 //element found as "one" exists in array $array_var
 var_dump( array_search("one", $array_search_obj->array_var) );
@@ -50,7 +50,7 @@ public function foo() {
 int(5)

 *** Testing objects with array_search() ***
-array_search(): Argument #2 ($haystack) must be of type array, array_search_check given
-array_search(): Argument #2 ($haystack) must be of type array, array_search_check given
+TypeError: array_search(): Argument #2 ($haystack) must be of type array, array_search_check given
+TypeError: array_search(): Argument #2 ($haystack) must be of type array, array_search_check given
 int(1)
 Done
diff --git a/ext/standard/tests/array/array_slice_variation1.phpt b/ext/standard/tests/array/array_slice_variation1.phpt
index b1d80d3f522..b82ab59c2ae 100644
--- a/ext/standard/tests/array/array_slice_variation1.phpt
+++ b/ext/standard/tests/array/array_slice_variation1.phpt
@@ -17,13 +17,13 @@
 $a = 'foo';
 try {
     var_dump(array_slice(range(1, 3), 0, $a));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(array_slice(range(1, 3), 0, $a));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($a);

@@ -61,6 +61,6 @@
   [2]=>
   int(3)
 }
-array_slice(): Argument #3 ($length) must be of type ?int, string given
-array_slice(): Argument #3 ($length) must be of type ?int, string given
+TypeError: array_slice(): Argument #3 ($length) must be of type ?int, string given
+TypeError: array_slice(): Argument #3 ($length) must be of type ?int, string given
 string(3) "foo"
diff --git a/ext/standard/tests/array/array_sum_variation8.phpt b/ext/standard/tests/array/array_sum_variation8.phpt
index 017b1b8b44b..e1e3b3f8597 100644
--- a/ext/standard/tests/array/array_sum_variation8.phpt
+++ b/ext/standard/tests/array/array_sum_variation8.phpt
@@ -10,8 +10,8 @@
 echo "array_reduce() version:\n";
 try {
     var_dump(array_reduce($input, fn($carry, $value) => $carry + $value, 0));
-} catch (TypeError $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
@@ -20,4 +20,4 @@
 Warning: array_sum(): Addition is not supported on type resource in %s on line %d
 int(13)
 array_reduce() version:
-Unsupported operand types: int + resource
+TypeError: Unsupported operand types: int + resource
diff --git a/ext/standard/tests/array/array_udiff_assoc_variation5.phpt b/ext/standard/tests/array/array_udiff_assoc_variation5.phpt
index ea63891067f..a5144564a84 100644
--- a/ext/standard/tests/array/array_udiff_assoc_variation5.phpt
+++ b/ext/standard/tests/array/array_udiff_assoc_variation5.phpt
@@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) {
 try {
     var_dump(array_udiff_assoc($arr1, $arr2, 'too_many_parameters'));
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- comparison function taking too few parameters --\n";
@@ -40,7 +40,7 @@ function too_few_parameters ($val1) {
 }

 -- comparison function taking too many parameters --
-Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected

 -- comparison function taking too few parameters --
 array(1) {
diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt
index 90e3af15333..468ffd7504e 100644
--- a/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt
+++ b/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt
@@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) {
 try {
     var_dump(array_udiff_uassoc($arr1, $arr2, 'too_many_parameters', 'too_many_parameters'));
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- comparison function taking too few parameters --\n";
@@ -40,7 +40,7 @@ function too_few_parameters ($val1) {
 }

 -- comparison function taking too many parameters --
-Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected

 -- comparison function taking too few parameters --
 array(1) {
diff --git a/ext/standard/tests/array/array_udiff_variation5.phpt b/ext/standard/tests/array/array_udiff_variation5.phpt
index ee5ad82d677..c789ca64598 100644
--- a/ext/standard/tests/array/array_udiff_variation5.phpt
+++ b/ext/standard/tests/array/array_udiff_variation5.phpt
@@ -21,7 +21,7 @@ function too_many_parameters ($val1, $val2, $val3) {
 try {
     var_dump(array_udiff($arr1, $arr2, 'too_many_parameters'));
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- comparison function taking too few parameters --\n";
@@ -41,7 +41,7 @@ function too_few_parameters ($val1) {
 }

 -- comparison function taking too many parameters --
-Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected

 -- comparison function taking too few parameters --
 array(0) {
diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt
index ed71142170d..9386afeeee7 100644
--- a/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt
+++ b/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt
@@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) {
 try {
     var_dump(array_uintersect_assoc($arr1, $arr2, 'too_many_parameters'));
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- comparison function taking too few parameters --\n";
@@ -38,9 +38,8 @@ function too_few_parameters ($val1) {
 }

 -- comparison function taking too many parameters --
-Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected

 -- comparison function taking too few parameters --
 array(0) {
 }
-
diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt
index 7574bc119f7..2199f7b0027 100644
--- a/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt
+++ b/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt
@@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) {
 try {
     var_dump(array_uintersect_uassoc($arr1, $arr2, 'too_many_parameters', 'too_many_parameters'));
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- comparison function taking too few parameters --\n";
@@ -38,7 +38,7 @@ function too_few_parameters ($val1) {
 }

 -- comparison function taking too many parameters --
-Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected

 -- comparison function taking too few parameters --
 array(0) {
diff --git a/ext/standard/tests/array/array_uintersect_variation5.phpt b/ext/standard/tests/array/array_uintersect_variation5.phpt
index 836bb80cc26..f9518401112 100644
--- a/ext/standard/tests/array/array_uintersect_variation5.phpt
+++ b/ext/standard/tests/array/array_uintersect_variation5.phpt
@@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) {
 try {
     var_dump(array_uintersect($arr1, $arr2, 'too_many_parameters'));
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- comparison function taking too few parameters --\n";
@@ -38,9 +38,8 @@ function too_few_parameters ($val1) {
 }

 -- comparison function taking too many parameters --
-Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected

 -- comparison function taking too few parameters --
 array(0) {
 }
-
diff --git a/ext/standard/tests/array/array_walk/array_walk.phpt b/ext/standard/tests/array/array_walk/array_walk.phpt
index 151c9c70d04..7e8617a3903 100644
--- a/ext/standard/tests/array/array_walk/array_walk.phpt
+++ b/ext/standard/tests/array/array_walk/array_walk.phpt
@@ -18,8 +18,8 @@ function foo2($v1, $v2, $v3) {

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

 echo "Done\n";
@@ -32,5 +32,5 @@ function foo2($v1, $v2, $v3) {
 int(1)
 string(4) "data"
 bool(true)
-string(4) "data"
+Exception: data
 Done
diff --git a/ext/standard/tests/array/array_walk/array_walk_error2.phpt b/ext/standard/tests/array/array_walk/array_walk_error2.phpt
index 57b082db95a..d537953a3db 100644
--- a/ext/standard/tests/array/array_walk/array_walk_error2.phpt
+++ b/ext/standard/tests/array/array_walk/array_walk_error2.phpt
@@ -20,41 +20,41 @@ function callback2($value, $key, $user_data1, $user_data2) {
 try {
     var_dump( array_walk($input, "callback1") );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( array_walk($input, "callback2", 4) );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // expected: Warning is suppressed
 try {
     var_dump( @array_walk($input, "callback1") );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( @array_walk($input, "callback2", 4) );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "-- Testing array_walk() function with too many callback parameters --\n";
 try {
     var_dump( array_walk($input, "callback1", 20, 10) );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done";
 ?>
 --EXPECT--
 *** Testing array_walk() : error conditions - callback parameters ***
-Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected
-Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected
-Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected
-Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected
+ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected
+ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected
 -- Testing array_walk() function with too many callback parameters --
-Exception: array_walk() expects at most 3 arguments, 4 given
+ArgumentCountError: array_walk() expects at most 3 arguments, 4 given
 Done
diff --git a/ext/standard/tests/array/array_walk/array_walk_objects.phpt b/ext/standard/tests/array/array_walk/array_walk_objects.phpt
index cc50ad38b9c..4637d6b075d 100644
--- a/ext/standard/tests/array/array_walk/array_walk_objects.phpt
+++ b/ext/standard/tests/array/array_walk/array_walk_objects.phpt
@@ -26,8 +26,8 @@ class test {
 $var = "";
 try {
     array_walk($var, "walk");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -46,5 +46,5 @@ class test {
 string(14) "test_protected"
 string(7) "var_pub"
 string(11) "test_public"
-array_walk(): Argument #1 ($array) must be of type array, string given
+TypeError: array_walk(): Argument #1 ($array) must be of type array, string given
 Done
diff --git a/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt b/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt
index 26082134f63..492f3253a1e 100644
--- a/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt
+++ b/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt
@@ -26,8 +26,8 @@ class test {
 $var = "";
 try {
     array_walk_recursive($var, "walk");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -46,5 +46,5 @@ class test {
 string(14) "test_protected"
 string(7) "var_pub"
 string(11) "test_public"
-array_walk_recursive(): Argument #1 ($array) must be of type array, string given
+TypeError: array_walk_recursive(): Argument #1 ($array) must be of type array, string given
 Done
diff --git a/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt b/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt
index d4d3e7d8eb2..aabf23fe2d6 100644
--- a/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt
+++ b/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt
@@ -18,8 +18,8 @@ function foo2($v1, $v2, $v3) {

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

 echo "Done\n";
@@ -38,5 +38,5 @@ function foo2($v1, $v2, $v3) {
 int(1)
 string(4) "data"
 bool(true)
-string(4) "data"
+Exception: data
 Done
diff --git a/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt b/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt
index fa5161e5c1b..44e59692e66 100644
--- a/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt
+++ b/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt
@@ -20,41 +20,41 @@ function callback2($value, $key, $user_data1, $user_data2) {
 try {
     var_dump( array_walk_recursive($input, "callback1") );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( array_walk_recursive($input, "callback2", 4) );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // expected: Warning is suppressed
 try {
     var_dump( @array_walk_recursive($input, "callback1") );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( @array_walk_recursive($input, "callback2", 4) );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "-- Testing array_walk_recursive() function with too many callback parameters --\n";
 try {
     var_dump( array_walk_recursive($input, "callback1", 20, 10) );
 } catch (Throwable $e) {
-    echo "Exception: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done";
 ?>
 --EXPECT--
 *** Testing array_walk_recursive() : error conditions - callback parameters ***
-Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected
-Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected
-Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected
-Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected
+ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected
+ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected
+ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected
 -- Testing array_walk_recursive() function with too many callback parameters --
-Exception: array_walk_recursive() expects at most 3 arguments, 4 given
+ArgumentCountError: array_walk_recursive() expects at most 3 arguments, 4 given
 Done
diff --git a/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt b/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt
index aafa158d6c7..db8feaf3bed 100644
--- a/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt
+++ b/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt
@@ -22,8 +22,8 @@
 echo "-- With 'echo' language construct --\n";
 try {
     var_dump( array_walk_recursive($input, "echo"));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done"
@@ -35,5 +35,5 @@
 -- With 'min' built-in function --
 bool(true)
 -- With 'echo' language construct --
-array_walk_recursive(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name
+TypeError: array_walk_recursive(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name
 Done
diff --git a/ext/standard/tests/array/array_walk/array_walk_variation8.phpt b/ext/standard/tests/array/array_walk/array_walk_variation8.phpt
index a4dae8a7e18..11ad5496d43 100644
--- a/ext/standard/tests/array/array_walk/array_walk_variation8.phpt
+++ b/ext/standard/tests/array/array_walk/array_walk_variation8.phpt
@@ -22,8 +22,8 @@
 echo "-- With 'echo' language construct --\n";
 try {
     var_dump( array_walk($input, "echo"));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done"
@@ -35,5 +35,5 @@
 -- With 'min' built-in function --
 bool(true)
 -- With 'echo' language construct --
-array_walk(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name
+TypeError: array_walk(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name
 Done
diff --git a/ext/standard/tests/array/array_walk/bug30266.phpt b/ext/standard/tests/array/array_walk/bug30266.phpt
index 2579714ae70..2909971f22f 100644
--- a/ext/standard/tests/array/array_walk/bug30266.phpt
+++ b/ext/standard/tests/array/array_walk/bug30266.phpt
@@ -26,10 +26,10 @@ function test($item2, $key, $userd)
 {
     array_walk($fruits, 'test', $myobj);
 }
-catch(Exception $e)
+catch(Throwable $e)
 {
-    echo "Caught: " . $e->getMessage() . "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Caught: Error
+Exception: Error
diff --git a/ext/standard/tests/array/array_walk/bug70713.phpt b/ext/standard/tests/array/array_walk/bug70713.phpt
index fab1661e84e..c68d9b069d3 100644
--- a/ext/standard/tests/array/array_walk/bug70713.phpt
+++ b/ext/standard/tests/array/array_walk/bug70713.phpt
@@ -22,10 +22,10 @@ function __tostring()

 try {
     array_walk_recursive($arr, 'settype');
-} catch (\TypeError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Iterated value is no longer an array or object
+TypeError: Iterated value is no longer an array or object
diff --git a/ext/standard/tests/array/array_walk/bug79839.phpt b/ext/standard/tests/array/array_walk/bug79839.phpt
index fe7db73c468..fa2727abe6b 100644
--- a/ext/standard/tests/array/array_walk/bug79839.phpt
+++ b/ext/standard/tests/array/array_walk/bug79839.phpt
@@ -12,15 +12,15 @@ class Test {
     array_walk($test, function(&$ref) {
         $ref = []; // Should throw
     });
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($test);

 ?>
 --EXPECTF--
 Deprecated: array_walk(): Passing an object for argument #1 $array to array_walk() is deprecated, call get_object_vars() first instead in %s on line %d
-Cannot assign array to reference held by property Test::$prop of type int
+TypeError: Cannot assign array to reference held by property Test::$prop of type int
 object(Test)#1 (1) {
   ["prop"]=>
   int(42)
diff --git a/ext/standard/tests/array/bug40191.phpt b/ext/standard/tests/array/bug40191.phpt
index c1a0d6b6c36..128cd4b1995 100644
--- a/ext/standard/tests/array/bug40191.phpt
+++ b/ext/standard/tests/array/bug40191.phpt
@@ -10,12 +10,12 @@

 try {
     $arr = array_unique($arrObj);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
 ?>
 --EXPECT--
-array_unique(): Argument #1 ($array) must be of type array, ArrayObject given
+TypeError: array_unique(): Argument #1 ($array) must be of type array, ArrayObject given
 Done
diff --git a/ext/standard/tests/array/bug42177.phpt b/ext/standard/tests/array/bug42177.phpt
index dc5297b3020..4b74ae6a3c7 100644
--- a/ext/standard/tests/array/bug42177.phpt
+++ b/ext/standard/tests/array/bug42177.phpt
@@ -20,8 +20,8 @@
 $a1 = array_merge_recursive( $a1, $a2 );
 try {
     $a1 = array_merge_recursive( $a1, $a2 );
-} catch (\Error $e) {
-    echo $e->getMessage() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n";
 }
 unset( $a1, $a2 );

@@ -35,4 +35,4 @@

 ?>
 --EXPECT--
-Recursion detected on line 19
+Error: Recursion detected on line 19
diff --git a/ext/standard/tests/array/bug43495.phpt b/ext/standard/tests/array/bug43495.phpt
index 37c4f6b604b..352b2fedcb4 100644
--- a/ext/standard/tests/array/bug43495.phpt
+++ b/ext/standard/tests/array/bug43495.phpt
@@ -11,8 +11,8 @@

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

 /* Break recursion */
@@ -21,4 +21,4 @@

 ?>
 --EXPECT--
-Recursion detected
+Error: Recursion detected
diff --git a/ext/standard/tests/array/bug61058.phpt b/ext/standard/tests/array/bug61058.phpt
index 6e78b357117..98d50257a9d 100644
--- a/ext/standard/tests/array/bug61058.phpt
+++ b/ext/standard/tests/array/bug61058.phpt
@@ -5,9 +5,9 @@

 try {
     array_fill(PHP_INT_MAX, 2, '*');
-} catch (\Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
diff --git a/ext/standard/tests/array/bug65251.phpt b/ext/standard/tests/array/bug65251.phpt
index 6d9cded21c8..eb0b48b82bb 100644
--- a/ext/standard/tests/array/bug65251.phpt
+++ b/ext/standard/tests/array/bug65251.phpt
@@ -6,8 +6,8 @@
 /* This no longer involves any recursion. */
 try {
     array_merge_recursive($GLOBALS, $GLOBALS);
-} catch (\Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
diff --git a/ext/standard/tests/array/bug68553.phpt b/ext/standard/tests/array/bug68553.phpt
index d309171096c..2f172ba5861 100644
--- a/ext/standard/tests/array/bug68553.phpt
+++ b/ext/standard/tests/array/bug68553.phpt
@@ -24,13 +24,13 @@

 try {
     var_dump(array_column([['a' => new stdClass]], null, 'a'));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(array_column([['a' => []]], null, 'a'));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
@@ -83,5 +83,5 @@
     NULL
   }
 }
-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
diff --git a/ext/standard/tests/array/bug71220.phpt b/ext/standard/tests/array/bug71220.phpt
index 5c5f43eeea8..2d0fdf34071 100644
--- a/ext/standard/tests/array/bug71220.phpt
+++ b/ext/standard/tests/array/bug71220.phpt
@@ -5,9 +5,9 @@
 ob_start("compact");
 try {
     ob_end_clean();
-} catch (\Error $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Cannot call compact() dynamically
+Error: Cannot call compact() dynamically
diff --git a/ext/standard/tests/array/bug74345.phpt b/ext/standard/tests/array/bug74345.phpt
index 64942f126e7..f612a4e6119 100644
--- a/ext/standard/tests/array/bug74345.phpt
+++ b/ext/standard/tests/array/bug74345.phpt
@@ -15,13 +15,13 @@ public function __call($name, $args) {
 array_map($cb, [], []);
 try {
     array_map($cb, null);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     array_map($cb, null, null);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 array_filter([], $cb);
 array_reduce([], $cb);
@@ -33,14 +33,14 @@ public function __call($name, $args) {

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

 ?>
 ===DONE===
 --EXPECT--
-array_map(): Argument #2 ($array) must be of type array, null given
-array_map(): Argument #2 ($array) must be of type array, null given
-preg_replace_callback(): Argument #3 ($subject) must be of type array|string, stdClass given
+TypeError: array_map(): Argument #2 ($array) must be of type array, null given
+TypeError: array_map(): Argument #2 ($array) must be of type array, null given
+TypeError: preg_replace_callback(): Argument #3 ($subject) must be of type array|string, stdClass given
 ===DONE===
diff --git a/ext/standard/tests/array/bug77135.phpt b/ext/standard/tests/array/bug77135.phpt
index 0b23d627662..eda4e234618 100644
--- a/ext/standard/tests/array/bug77135.phpt
+++ b/ext/standard/tests/array/bug77135.phpt
@@ -36,8 +36,8 @@ private function handle(string $name, int $flags): void

             echo "  \$this = " . get_class($this) . "\n";
             echo "  \$v_this = " . (isset($x_this) ? $x_this : "NULL") . "\n";
-        } catch (\Throwable $e) {
-            echo "  Exception: " . $e->getMessage() . "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
@@ -47,8 +47,8 @@ private function handle(string $name, int $flags): void
 ?>
 --EXPECT--
 EXTR_OVERWRITE
-  Exception: Cannot re-assign $this
-  Exception: Cannot re-assign $this
+Error: Cannot re-assign $this
+Error: Cannot re-assign $this

 EXTR_SKIP
   extract() = 0
diff --git a/ext/standard/tests/array/bug77931.phpt b/ext/standard/tests/array/bug77931.phpt
index d876d4b01c6..b6b42067bee 100644
--- a/ext/standard/tests/array/bug77931.phpt
+++ b/ext/standard/tests/array/bug77931.phpt
@@ -5,22 +5,22 @@

 try {
     array_map('trim', array(), 1);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     array_map('trim', array(), array(), true);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     array_map('trim', array(), array(), array(), null);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-array_map(): Argument #3 must be of type array, int given
-array_map(): Argument #4 must be of type array, true given
-array_map(): Argument #5 must be of type array, null given
+TypeError: array_map(): Argument #3 must be of type array, int given
+TypeError: array_map(): Argument #4 must be of type array, true given
+TypeError: array_map(): Argument #5 must be of type array, null given
diff --git a/ext/standard/tests/array/compact_variation1.phpt b/ext/standard/tests/array/compact_variation1.phpt
index afc290ed624..1f5f8b809f8 100644
--- a/ext/standard/tests/array/compact_variation1.phpt
+++ b/ext/standard/tests/array/compact_variation1.phpt
@@ -18,14 +18,14 @@

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

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

 var_dump(compact($arr3));
@@ -33,8 +33,8 @@
 ?>
 --EXPECT--
 *** Testing compact() : usage variations  - arrays containing references ***
-Recursion detected
-Recursion detected
+Error: Recursion detected
+Error: Recursion detected
 array(1) {
   ["c"]=>
   int(3)
diff --git a/ext/standard/tests/array/count_invalid.phpt b/ext/standard/tests/array/count_invalid.phpt
index d05c6a1961e..33c600a44b1 100644
--- a/ext/standard/tests/array/count_invalid.phpt
+++ b/ext/standard/tests/array/count_invalid.phpt
@@ -6,50 +6,50 @@
 try {
     $result = count(null);
     var_dump($result);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $result = count("string");
     var_dump($result);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $result = count(123);
     var_dump($result);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $result = count(true);
     var_dump($result);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $result = count(false);
     var_dump($result);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $result = count((object) []);
     var_dump($result);
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-count(): Argument #1 ($value) must be of type Countable|array, null given
-count(): Argument #1 ($value) must be of type Countable|array, string given
-count(): Argument #1 ($value) must be of type Countable|array, int given
-count(): Argument #1 ($value) must be of type Countable|array, true given
-count(): Argument #1 ($value) must be of type Countable|array, false given
-count(): Argument #1 ($value) must be of type Countable|array, stdClass given
+TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given
+TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given
+TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given
+TypeError: count(): Argument #1 ($value) must be of type Countable|array, true given
+TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given
+TypeError: count(): Argument #1 ($value) must be of type Countable|array, stdClass given
diff --git a/ext/standard/tests/array/count_invalid_mode.phpt b/ext/standard/tests/array/count_invalid_mode.phpt
index be39690e856..dd4c1e4bc26 100644
--- a/ext/standard/tests/array/count_invalid_mode.phpt
+++ b/ext/standard/tests/array/count_invalid_mode.phpt
@@ -17,8 +17,8 @@
 foreach ($modes as $mode) {
     try {
         var_dump(count([], $mode));
-    } catch (\ValueError $error) {
-        echo $error->getMessage() . \PHP_EOL;
+    } catch (Throwable $error) {
+        echo $error::class, ': ', $error->getMessage(), "\n";
     }
 }
 ?>
@@ -27,7 +27,7 @@
 int(0)
 int(0)
 int(0)
-count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE
-count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE
+ValueError: count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE
+ValueError: count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE
 int(0)
 int(0)
diff --git a/ext/standard/tests/array/extract_error.phpt b/ext/standard/tests/array/extract_error.phpt
index f2b0cfa69c7..a379b007ed1 100644
--- a/ext/standard/tests/array/extract_error.phpt
+++ b/ext/standard/tests/array/extract_error.phpt
@@ -11,26 +11,26 @@

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

 try {
     var_dump( extract($arr, 7 , "wddr") );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 /* Two Arguments, second as prefix but without prefix string as third argument */
 try {
     var_dump( extract($arr,EXTR_PREFIX_IF_EXISTS) );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 *** Testing Error Conditions ***
-extract(): Argument #2 ($flags) must be a valid extract type
-extract(): Argument #2 ($flags) must be a valid extract type
-extract(): Argument #3 ($prefix) is required when using this extract type
+ValueError: extract(): Argument #2 ($flags) must be a valid extract type
+ValueError: extract(): Argument #2 ($flags) must be a valid extract type
+ValueError: extract(): Argument #3 ($prefix) is required when using this extract type
diff --git a/ext/standard/tests/array/extract_error_variation1.phpt b/ext/standard/tests/array/extract_error_variation1.phpt
index a8fe2fa8500..182cdf64761 100644
--- a/ext/standard/tests/array/extract_error_variation1.phpt
+++ b/ext/standard/tests/array/extract_error_variation1.phpt
@@ -6,9 +6,9 @@

 try {
     extract($a, EXTR_PREFIX_ALL, '85bogus');
-} catch (\ValueError $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-extract(): Argument #3 ($prefix) must be a valid identifier
+ValueError: extract(): Argument #3 ($prefix) must be a valid identifier
diff --git a/ext/standard/tests/array/extract_typed_ref.phpt b/ext/standard/tests/array/extract_typed_ref.phpt
index 6d2a5a9272d..8dc4794ca63 100644
--- a/ext/standard/tests/array/extract_typed_ref.phpt
+++ b/ext/standard/tests/array/extract_typed_ref.phpt
@@ -13,11 +13,11 @@ class Test {
 $s =& $test->s;
 try {
     extract(['i' => 'foo', 's' => 42]);
-} catch (TypeError $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
 var_dump($test->i, $test->s);

 ?>
 --EXPECT--
-Cannot assign string to reference held by property Test::$i of type int
+TypeError: Cannot assign string to reference held by property Test::$i of type int
 int(0)
 string(0) ""
diff --git a/ext/standard/tests/array/gh14775.phpt b/ext/standard/tests/array/gh14775.phpt
index df4db76031e..89ab32550e3 100644
--- a/ext/standard/tests/array/gh14775.phpt
+++ b/ext/standard/tests/array/gh14775.phpt
@@ -5,8 +5,8 @@
 $var = -PHP_INT_MAX - 1;
 try {
 	range($var,1,$var);
-} catch (\ValueError $e) {
-	echo $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 --EXPECTF--
-range(): Argument #3 ($step) must be greater than %s
+ValueError: range(): Argument #3 ($step) must be greater than %s
diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt
index f5e538122f4..04f926d6335 100644
--- a/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt
+++ b/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt
@@ -14,9 +14,9 @@ function __destruct() {
 try {
     array_splice($arr, 1, 2);
     echo "ERROR: Should have thrown exception\n";
-} catch (Error $e) {
-    echo "Exception caught: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Exception caught: Array was modified during array_splice operation
+Error: Array was modified during array_splice operation
diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt
index 1874ddad893..3c6f2fdb598 100644
--- a/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt
+++ b/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt
@@ -14,9 +14,9 @@ function __destruct() {
 try {
     array_splice($arr, 1, 2);
     echo "ERROR: Should have thrown exception\n";
-} catch (Error $e) {
-    echo "Exception caught: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Exception caught: Array was modified during array_splice operation
+Error: Array was modified during array_splice operation
diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt
index 8ad4133300e..0d50989f6b6 100644
--- a/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt
+++ b/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt
@@ -17,9 +17,9 @@ function __destruct() {
 try {
     array_splice($arr, 1, 1, ["replacement"]);
     echo "ERROR: Should have thrown exception\n";
-} catch (Error $e) {
-    echo "Exception caught: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Exception caught: Array was modified during array_splice operation
+Error: Array was modified during array_splice operation
diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt
index 9e2c6cf8fc7..2b7b85f849d 100644
--- a/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt
+++ b/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt
@@ -23,11 +23,11 @@ function __destruct() {
 try {
     array_splice($arr, 1, 2);
     echo "ERROR: Should have thrown exception\n";
-} catch (Error $e) {
-    echo "Exception caught: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
 Destructor 1 called
 Destructor 2 called
-Exception caught: Array was modified during array_splice operation
+Error: Array was modified during array_splice operation
diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt
index dcfa8f2e759..ae9b2703402 100644
--- a/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt
+++ b/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt
@@ -21,10 +21,10 @@ function __destruct() {
 try {
     array_splice($arr, 1, 2);
     echo "ERROR: Should have thrown exception\n";
-} catch (Error $e) {
-    echo "Exception caught: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Deprecated: Returning a value from a destructor is deprecated in %s on line %d
-Exception caught: Array was modified during array_splice operation
+Error: Array was modified during array_splice operation
diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt
index bd8f511b625..139c9dab8b2 100644
--- a/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt
+++ b/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt
@@ -15,9 +15,9 @@ function __destruct() {
 try {
     array_splice($arr, 1, 2);
     echo "ERROR: Should have thrown exception\n";
-} catch (Error $e) {
-    echo "Exception caught: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Exception caught: Array was modified during array_splice operation
+Error: Array was modified during array_splice operation
diff --git a/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt b/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt
index 8754a913a24..ad0d73258e7 100644
--- a/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt
+++ b/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt
@@ -15,9 +15,9 @@ function __destruct() {
 try {
     array_splice($arr, 1, 1, $replacement);
     echo "ERROR: Should have thrown exception\n";
-} catch (Error $e) {
-    echo "Exception caught: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Exception caught: Array was modified during array_splice operation
+Error: Array was modified during array_splice operation
diff --git a/ext/standard/tests/array/gh19300_2.phpt b/ext/standard/tests/array/gh19300_2.phpt
index 41ae7e82bb7..7b6c061423a 100644
--- a/ext/standard/tests/array/gh19300_2.phpt
+++ b/ext/standard/tests/array/gh19300_2.phpt
@@ -6,8 +6,8 @@
 function error_handle($level, $message, $file = '', $line = 0){
     try {
         array_multisort($a, SORT_ASC); // Trigger multisort abort
-    } catch (TypeError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 set_error_handler('error_handle');
@@ -22,10 +22,10 @@ function error_handle($level, $message, $file = '', $line = 0){
 var_dump($inputs);
 ?>
 --EXPECT--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag
 bool(true)
 array(3) {
   [0]=>
diff --git a/ext/standard/tests/array/gh20043.phpt b/ext/standard/tests/array/gh20043.phpt
index d5c7e06417f..b7a4390db26 100644
--- a/ext/standard/tests/array/gh20043.phpt
+++ b/ext/standard/tests/array/gh20043.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
 	array_unique([new stdClass, new stdClass], SORT_STRING | SORT_FLAG_CASE);
-} catch (Error $e) {
-	echo $e->getMessage();
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
diff --git a/ext/standard/tests/array/in_array/in_array_variation3.phpt b/ext/standard/tests/array/in_array/in_array_variation3.phpt
index 95617e945f3..ef020dea6f0 100644
--- a/ext/standard/tests/array/in_array/in_array_variation3.phpt
+++ b/ext/standard/tests/array/in_array/in_array_variation3.phpt
@@ -31,14 +31,14 @@ public function foo() {
 //error: as wrong datatype for second argument
 try {
     var_dump( in_array("array_var", $in_array_obj) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 //error: as wrong datatype for second argument
 try {
     var_dump( in_array("foo", $in_array_obj) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 //element found as "one" exists in array $array_var
 var_dump( in_array("one", $in_array_obj->array_var) );
@@ -52,7 +52,7 @@ public function foo() {
 bool(true)

 *** Testing objects with in_array() ***
-in_array(): Argument #2 ($haystack) must be of type array, in_array_check given
-in_array(): Argument #2 ($haystack) must be of type array, in_array_check given
+TypeError: in_array(): Argument #2 ($haystack) must be of type array, in_array_check given
+TypeError: in_array(): Argument #2 ($haystack) must be of type array, in_array_check given
 bool(true)
 Done
diff --git a/ext/standard/tests/array/max.phpt b/ext/standard/tests/array/max.phpt
index 06546100169..e7b113bd478 100644
--- a/ext/standard/tests/array/max.phpt
+++ b/ext/standard/tests/array/max.phpt
@@ -7,20 +7,20 @@

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

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

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

 var_dump(max(2,1,2));
@@ -33,9 +33,9 @@

 ?>
 --EXPECT--
-max(): Argument #1 ($value) must be of type array, int given
-max(): Argument #1 ($value) must contain at least one element
-max(): Argument #1 ($value) must be of type array, stdClass given
+TypeError: max(): Argument #1 ($value) must be of type array, int given
+ValueError: max(): Argument #1 ($value) must contain at least one element
+TypeError: max(): Argument #1 ($value) must be of type array, stdClass given
 int(2)
 float(2.11)
 string(1) "t"
diff --git a/ext/standard/tests/array/min.phpt b/ext/standard/tests/array/min.phpt
index 97be4ad6828..3413c97da4d 100644
--- a/ext/standard/tests/array/min.phpt
+++ b/ext/standard/tests/array/min.phpt
@@ -7,20 +7,20 @@

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

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

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

 var_dump(min(2,1,2));
@@ -33,9 +33,9 @@

 ?>
 --EXPECT--
-min(): Argument #1 ($value) must be of type array, int given
-min(): Argument #1 ($value) must contain at least one element
-min(): Argument #1 ($value) must be of type array, stdClass given
+TypeError: min(): Argument #1 ($value) must be of type array, int given
+ValueError: min(): Argument #1 ($value) must contain at least one element
+TypeError: min(): Argument #1 ($value) must be of type array, stdClass given
 int(1)
 float(2.09)
 string(0) ""
diff --git a/ext/standard/tests/array/range/range_bug70239_0.phpt b/ext/standard/tests/array/range/range_bug70239_0.phpt
index 52f046a7e47..ba7fa5280b6 100644
--- a/ext/standard/tests/array/range/range_bug70239_0.phpt
+++ b/ext/standard/tests/array/range/range_bug70239_0.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     range(0, pow(2.0, 100000000));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-range(): Argument #2 ($end) must be a finite number, INF provided
+ValueError: range(): Argument #2 ($end) must be a finite number, INF provided
diff --git a/ext/standard/tests/array/range/range_bug70239_1.phpt b/ext/standard/tests/array/range/range_bug70239_1.phpt
index 681d594a74d..3a318c51680 100644
--- a/ext/standard/tests/array/range/range_bug70239_1.phpt
+++ b/ext/standard/tests/array/range/range_bug70239_1.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     range(pow(2.0, 100000000), pow(2.0, 100000000) + 1);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-range(): Argument #1 ($start) must be a finite number, INF provided
+ValueError: range(): Argument #1 ($start) must be a finite number, INF provided
diff --git a/ext/standard/tests/array/range/range_bug70239_2.phpt b/ext/standard/tests/array/range/range_bug70239_2.phpt
index b20f360dba1..428de421616 100644
--- a/ext/standard/tests/array/range/range_bug70239_2.phpt
+++ b/ext/standard/tests/array/range/range_bug70239_2.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     var_dump(range(0, PHP_INT_MAX));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
-The supplied range exceeds the maximum array size by %d elements: start=0, end=%d, step=1. Calculated size: %d. Maximum size: %d.
+ValueError: The supplied range exceeds the maximum array size by %d elements: start=0, end=%d, step=1. Calculated size: %d. Maximum size: %d.
diff --git a/ext/standard/tests/array/range/range_bug70239_3.phpt b/ext/standard/tests/array/range/range_bug70239_3.phpt
index 6307927438d..ca61890d302 100644
--- a/ext/standard/tests/array/range/range_bug70239_3.phpt
+++ b/ext/standard/tests/array/range/range_bug70239_3.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     var_dump(range(PHP_INT_MIN, 0));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
-The supplied range exceeds the maximum array size by %d elements: start=-%d, end=0, step=1. Calculated size: %d. Maximum size: %d.
+ValueError: The supplied range exceeds the maximum array size by %d elements: start=-%d, end=0, step=1. Calculated size: %d. Maximum size: %d.
diff --git a/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt b/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt
index cbfd2e91441..257ae2f0615 100644
--- a/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt
+++ b/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt
@@ -28,8 +28,8 @@ function safe_to_string(int|float $number): string {
         echo 'range(', safe_to_string($s), ', ', safe_to_string($e), ");\n";
         try {
             var_dump( range($s, $e) );
-        } catch (\ValueError $e) {
-            echo $e->getMessage(), PHP_EOL;
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
@@ -40,35 +40,35 @@ function safe_to_string(int|float $number): string {
 float(NAN)
 float(NAN)
 range(NAN, NAN);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, NAN);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, NAN);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, 5.5);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, NAN);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, NAN);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, NAN);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, 5.5);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, NAN);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, NAN);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, NAN);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(NAN, 5.5);
-range(): Argument #1 ($start) must be a finite number, NAN provided
+ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided
 range(5.5, NAN);
-range(): Argument #2 ($end) must be a finite number, NAN provided
+ValueError: range(): Argument #2 ($end) must be a finite number, NAN provided
 range(5.5, NAN);
-range(): Argument #2 ($end) must be a finite number, NAN provided
+ValueError: range(): Argument #2 ($end) must be a finite number, NAN provided
 range(5.5, NAN);
-range(): Argument #2 ($end) must be a finite number, NAN provided
+ValueError: range(): Argument #2 ($end) must be a finite number, NAN provided
 range(5.5, 5.5);
 array(1) {
   [0]=>
diff --git a/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt b/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt
index 41ae4ef995b..82bd24d682f 100644
--- a/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt
+++ b/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt
@@ -4,15 +4,15 @@
 <?php
 try {
     var_dump(range(0, 100_000_000_000, 0.1));
-} catch (\ValueError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(range(PHP_INT_MIN, PHP_INT_MAX, 1));
-} catch (\ValueError $e) {
-    echo $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
-The supplied range exceeds the maximum array size by %f elements: start=0.0, end=%f, step=0.1. Max size: %d
-The supplied range exceeds the maximum array size by %d elements: start=-%d, end=%d, step=1. Calculated size: %d. Maximum size: %d.
+ValueError: The supplied range exceeds the maximum array size by %f elements: start=0.0, end=%f, step=0.1. Max size: %d
+ValueError: The supplied range exceeds the maximum array size by %d elements: start=-%d, end=%d, step=1. Calculated size: %d. Maximum size: %d.
diff --git a/ext/standard/tests/array/range/range_step_errors.phpt b/ext/standard/tests/array/range/range_step_errors.phpt
index e950c527863..768832d9001 100644
--- a/ext/standard/tests/array/range/range_step_errors.phpt
+++ b/ext/standard/tests/array/range/range_step_errors.phpt
@@ -7,128 +7,128 @@
 echo "Step cannot be 0\n";
 try {
     var_dump( range(1.0, 7.0, 0.0) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( range(1, 7, 0) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( range('A', 'H', 0) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( range('A', 'H', 0.0) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "Step cannot be INF\n";
 try {
     var_dump( range(1.0, 7.0, 10.0**400) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( range(1, 7, 10.0**400) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( range('A', 'H', 10.0**400) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "Step cannot be NAN\n";
 try {
     var_dump( range(1.0, 7.0, fdiv(0, 0)) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( range(1, 7, fdiv(0, 0)) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( range('A', 'H', fdiv(0, 0)) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Step must be within the range of input parameters\n";
 echo "-- Testing ( (low < high) && (high-low < step) ) --\n";
 try {
     var_dump( range(1.0, 7.0, 6.5) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "-- Testing ( (low > high) && (low-high < step) ) --\n";
 try {
     var_dump( range(7.0, 1.0, 6.5) );
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "-- Testing ( (low < high) && (high-low < step) ) for characters --\n";
 try {
     var_dump(range('a', 'z', 100));
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "-- Testing ( (low > high) && (low-high < step) ) for characters --\n";
 try {
     var_dump(range('z', 'a', 100));
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Step must not be negative for increasing ranges\n";
 try {
     var_dump(range('a', 'c', -1));
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(range(1, 3, -1));
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(range(1.5, 3.5, -1.5));
-} catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
 Step cannot be 0
-range(): Argument #3 ($step) cannot be 0
-range(): Argument #3 ($step) cannot be 0
-range(): Argument #3 ($step) cannot be 0
-range(): Argument #3 ($step) cannot be 0
+ValueError: range(): Argument #3 ($step) cannot be 0
+ValueError: range(): Argument #3 ($step) cannot be 0
+ValueError: range(): Argument #3 ($step) cannot be 0
+ValueError: range(): Argument #3 ($step) cannot be 0
 Step cannot be INF
-range(): Argument #3 ($step) must be a finite number, INF provided
-range(): Argument #3 ($step) must be a finite number, INF provided
-range(): Argument #3 ($step) must be a finite number, INF provided
+ValueError: range(): Argument #3 ($step) must be a finite number, INF provided
+ValueError: range(): Argument #3 ($step) must be a finite number, INF provided
+ValueError: range(): Argument #3 ($step) must be a finite number, INF provided
 Step cannot be NAN
-range(): Argument #3 ($step) must be a finite number, NAN provided
-range(): Argument #3 ($step) must be a finite number, NAN provided
-range(): Argument #3 ($step) must be a finite number, NAN provided
+ValueError: range(): Argument #3 ($step) must be a finite number, NAN provided
+ValueError: range(): Argument #3 ($step) must be a finite number, NAN provided
+ValueError: range(): Argument #3 ($step) must be a finite number, NAN provided
 Step must be within the range of input parameters
 -- Testing ( (low < high) && (high-low < step) ) --
-range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
+ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
 -- Testing ( (low > high) && (low-high < step) ) --
-range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
+ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
 -- Testing ( (low < high) && (high-low < step) ) for characters --
-range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
+ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
 -- Testing ( (low > high) && (low-high < step) ) for characters --
-range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
+ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
 Step must not be negative for increasing ranges
-range(): Argument #3 ($step) must be greater than 0 for increasing ranges
-range(): Argument #3 ($step) must be greater than 0 for increasing ranges
-range(): Argument #3 ($step) must be greater than 0 for increasing ranges
+ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges
+ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges
+ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges
diff --git a/ext/standard/tests/array/sizeof_object2.phpt b/ext/standard/tests/array/sizeof_object2.phpt
index 115283d6613..caeb878a4e3 100644
--- a/ext/standard/tests/array/sizeof_object2.phpt
+++ b/ext/standard/tests/array/sizeof_object2.phpt
@@ -76,22 +76,22 @@ protected function display()
   echo "Default Mode: ";
   try {
     var_dump( sizeof($var) );
-  } catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }

   echo "COUNT_NORMAL Mode: ";
   try {
     var_dump( sizeof($var, COUNT_NORMAL) );
-  } catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }

   echo "COUNT_RECURSIVE Mode: ";
   try {
     var_dump( sizeof($var, COUNT_RECURSIVE) );
-  } catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }

   $counter++;
@@ -103,23 +103,23 @@ protected function display()
 *** Testing sizeof() : object functionality ***
 --- Testing sizeof() with objects which doesn't implement Countable interface ---
 -- Iteration 1 --
-Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
-COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
-COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
+Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
+COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
+COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
 -- Iteration 2 --
-Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
-COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
-COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
+Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
+COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
+COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
 -- Iteration 3 --
-Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
-COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
-COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
+Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
+COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
+COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
 -- Iteration 4 --
-Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
-COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
-COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
+Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
+COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
+COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
 -- Iteration 5 --
-Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
-COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
-COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
+Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
+COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
+COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
 Done
diff --git a/ext/standard/tests/array/sort/array_multisort_error.phpt b/ext/standard/tests/array/sort/array_multisort_error.phpt
index 4f2d979f71d..64f35aecddc 100644
--- a/ext/standard/tests/array/sort/array_multisort_error.phpt
+++ b/ext/standard/tests/array/sort/array_multisort_error.phpt
@@ -8,16 +8,16 @@
 $ar1 = array(1);
 try {
     var_dump( array_multisort($ar1, SORT_ASC, SORT_ASC) );
-} catch (\TypeError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Testing array_multisort() function with repeated flags --\n";
 $ar1 = array(1);
 try {
     var_dump( array_multisort($ar1, SORT_STRING, SORT_NUMERIC) );
-} catch (\TypeError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -25,7 +25,7 @@
 *** Testing array_multisort() : error conditions ***

 -- Testing array_multisort() function with repeated flags --
-array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified

 -- Testing array_multisort() function with repeated flags --
-array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified
diff --git a/ext/standard/tests/array/sort/array_multisort_variation1.phpt b/ext/standard/tests/array/sort/array_multisort_variation1.phpt
index c6cb286231e..8e004fcceba 100644
--- a/ext/standard/tests/array/sort/array_multisort_variation1.phpt
+++ b/ext/standard/tests/array/sort/array_multisort_variation1.phpt
@@ -93,8 +93,8 @@ class classWithoutToString
       echo "\n--$key--\n";
       try {
           var_dump( array_multisort($value));
-      } catch (\ValueError | \TypeError $e) {
-          echo $e->getMessage() . "\n";
+      } catch (Throwable $e) {
+          echo $e::class, ': ', $e->getMessage(), "\n";
       }
 };

@@ -103,76 +103,76 @@ class classWithoutToString
 *** Testing array_multisort() : usage variation ***

 --int 0--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified

 --int 1--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified

 --int 12345--
-array_multisort(): Argument #1 ($array) must be a valid sort flag
+ValueError: array_multisort(): Argument #1 ($array) must be a valid sort flag

 --int -12345--
-array_multisort(): Argument #1 ($array) must be a valid sort flag
+ValueError: array_multisort(): Argument #1 ($array) must be a valid sort flag

 --float 10.5--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --float -10.5--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --float 12.3456789000e10--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --float -12.3456789000e10--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --float .5--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --uppercase NULL--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --lowercase null--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --lowercase true--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --lowercase false--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --uppercase TRUE--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --uppercase FALSE--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --empty string DQ--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --empty string SQ--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --string DQ--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --string SQ--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --mixed case string--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --heredoc--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --instance of classWithToString--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --instance of classWithoutToString--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --undefined var--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag

 --unset var--
-array_multisort(): Argument #1 ($array) must be an array or a sort flag
+TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag
diff --git a/ext/standard/tests/array/sort/array_multisort_variation2.phpt b/ext/standard/tests/array/sort/array_multisort_variation2.phpt
index b491b87bfda..8d1bd3d7f4d 100644
--- a/ext/standard/tests/array/sort/array_multisort_variation2.phpt
+++ b/ext/standard/tests/array/sort/array_multisort_variation2.phpt
@@ -101,8 +101,8 @@ class classWithoutToString
     echo "\n--$key--\n";
     try {
         var_dump( array_multisort($ar1, $value) );
-    } catch (\ValueError | \TypeError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 };

@@ -117,82 +117,82 @@ class classWithoutToString
 bool(true)

 --int 12345--
-array_multisort(): Argument #2 must be a valid sort flag
+ValueError: array_multisort(): Argument #2 must be a valid sort flag

 --int -12345--
-array_multisort(): Argument #2 must be a valid sort flag
+ValueError: array_multisort(): Argument #2 must be a valid sort flag

 --float 10.5--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --float -10.5--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --float 12.3456789000e10--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --float -12.3456789000e10--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --float .5--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --empty array--
-Array sizes are inconsistent
+ValueError: Array sizes are inconsistent

 --int indexed array--
-Array sizes are inconsistent
+ValueError: Array sizes are inconsistent

 --associative array--
 bool(true)

 --nested arrays--
-Array sizes are inconsistent
+ValueError: Array sizes are inconsistent

 --uppercase NULL--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --lowercase null--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --lowercase true--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --lowercase false--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --uppercase TRUE--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --uppercase FALSE--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --empty string DQ--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --empty string SQ--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --string DQ--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --string SQ--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --mixed case string--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --heredoc--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --instance of classWithToString--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --instance of classWithoutToString--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --undefined var--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag

 --unset var--
-array_multisort(): Argument #2 must be an array or a sort flag
+TypeError: array_multisort(): Argument #2 must be an array or a sort flag
diff --git a/ext/standard/tests/array/sort/array_multisort_variation3.phpt b/ext/standard/tests/array/sort/array_multisort_variation3.phpt
index 71f837acd86..d28f3a7c2bc 100644
--- a/ext/standard/tests/array/sort/array_multisort_variation3.phpt
+++ b/ext/standard/tests/array/sort/array_multisort_variation3.phpt
@@ -93,8 +93,8 @@ class classWithoutToString
     echo "\n--$key--\n";
     try {
         var_dump( array_multisort($ar1, SORT_REGULAR, $value) );
-    } catch (\ValueError | \TypeError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 };

@@ -103,76 +103,76 @@ class classWithoutToString
 *** Testing array_multisort() : usage variation ***

 --int 0--
-array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified

 --int 1--
-array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified

 --int 12345--
-array_multisort(): Argument #3 must be a valid sort flag
+ValueError: array_multisort(): Argument #3 must be a valid sort flag

 --int -12345--
-array_multisort(): Argument #3 must be a valid sort flag
+ValueError: array_multisort(): Argument #3 must be a valid sort flag

 --float 10.5--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --float -10.5--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --float 12.3456789000e10--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --float -12.3456789000e10--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --float .5--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --uppercase NULL--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --lowercase null--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --lowercase true--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --lowercase false--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --uppercase TRUE--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --uppercase FALSE--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --empty string DQ--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --empty string SQ--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --string DQ--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --string SQ--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --mixed case string--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --heredoc--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --instance of classWithToString--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --instance of classWithoutToString--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --undefined var--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag

 --unset var--
-array_multisort(): Argument #3 must be an array or a sort flag
+TypeError: array_multisort(): Argument #3 must be an array or a sort flag
diff --git a/ext/standard/tests/array/sort/asort_variation5.phpt b/ext/standard/tests/array/sort/asort_variation5.phpt
index d5a8930f090..766832a3a55 100644
--- a/ext/standard/tests/array/sort/asort_variation5.phpt
+++ b/ext/standard/tests/array/sort/asort_variation5.phpt
@@ -118,4 +118,4 @@
   string(2) "ww"
   ["x"]=>
   string(1) "x"
-}
\ No newline at end of file
+}
diff --git a/ext/standard/tests/array/sort/bug77395.phpt b/ext/standard/tests/array/sort/bug77395.phpt
index a4a79f5e2f5..880512a3ae8 100644
--- a/ext/standard/tests/array/sort/bug77395.phpt
+++ b/ext/standard/tests/array/sort/bug77395.phpt
@@ -13,9 +13,9 @@ function error_handle($level, $message, $file = '', $line = 0){

 try {
     array_multisort(array_column($data, 'bb'),SORT_DESC, $data); // PHP Warning error
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Array sizes are inconsistent
+ValueError: Array sizes are inconsistent
diff --git a/ext/standard/tests/assert/assert_basic6.phpt b/ext/standard/tests/assert/assert_basic6.phpt
index b531425912c..a3214a9df16 100644
--- a/ext/standard/tests/assert/assert_basic6.phpt
+++ b/ext/standard/tests/assert/assert_basic6.phpt
@@ -15,8 +15,8 @@ function f1()

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

 echo "\n";
@@ -26,8 +26,8 @@ function f1()

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

 ?>
@@ -41,7 +41,7 @@ function f1()
 Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d
 string(2) "f1"
 foo
-assert(false)
+AssertionError: assert(false)


 Deprecated: Constant ASSERT_CALLBACK is deprecated since 8.3, as assert_options() is deprecated in %s on line %d
@@ -52,4 +52,4 @@ function f1()

 Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d
 NULL
-assert(false)
+AssertionError: assert(false)
diff --git a/ext/standard/tests/assert/assert_options_error.phpt b/ext/standard/tests/assert/assert_options_error.phpt
index d3b055e65f9..8c70ca32524 100644
--- a/ext/standard/tests/assert/assert_options_error.phpt
+++ b/ext/standard/tests/assert/assert_options_error.phpt
@@ -5,10 +5,10 @@
 <?php
 try {
     assert_options(1000);
-} catch (\ValueError $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d
-assert_options(): Argument #1 ($option) must be an ASSERT_* constant
+ValueError: assert_options(): Argument #1 ($option) must be an ASSERT_* constant
diff --git a/ext/standard/tests/assert/assert_variation.phpt b/ext/standard/tests/assert/assert_variation.phpt
index 6824f7246d5..6889e46e24c 100644
--- a/ext/standard/tests/assert/assert_variation.phpt
+++ b/ext/standard/tests/assert/assert_variation.phpt
@@ -53,8 +53,8 @@ static function assert($file, $line, $unused, $desc)
 echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n";
 try {
     var_dump($r2=assert(0 != 0));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo"\n";

@@ -133,7 +133,7 @@ static function assert($file, $line, $unused, $desc)
 Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d
 assert_options(ASSERT_CALLBACK) => [c1]
 ini.get("assert.callback") => [f2]
-Invalid callback c1, function "c1" not found or invalid function name
+Error: Invalid callback c1, function "c1" not found or invalid function name

 Reset callback options to use a class method

diff --git a/ext/standard/tests/assert/gh22290.phpt b/ext/standard/tests/assert/gh22290.phpt
index e519a60f557..d2b57779e1b 100644
--- a/ext/standard/tests/assert/gh22290.phpt
+++ b/ext/standard/tests/assert/gh22290.phpt
@@ -9,31 +9,31 @@
 try {
 	$string = "Foo\x00bar";
 	assert(!str_contains($string, "\x00"));
-} catch (AssertionError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(["a\x00b" => 1] === []);
-} catch (AssertionError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

 try {
 	assert(str_contains("plain", "zzz"));
-} catch (AssertionError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-assert(!str_contains($string, "\000"))
-assert(["a\000b" => 1] === [])
-assert("tab\there" === '')
-assert(str_contains('plain', 'zzz'))
+AssertionError: assert(!str_contains($string, "\000"))
+AssertionError: assert(["a\000b" => 1] === [])
+AssertionError: assert("tab\there" === '')
+AssertionError: assert(str_contains('plain', 'zzz'))
diff --git a/ext/standard/tests/assert/gh22291.phpt b/ext/standard/tests/assert/gh22291.phpt
index a50bd5861f0..01453159579 100644
--- a/ext/standard/tests/assert/gh22291.phpt
+++ b/ext/standard/tests/assert/gh22291.phpt
@@ -8,12 +8,12 @@
 	var_dump("{{$foo}}");
 	var_dump("{$foo}");
 	assert(!"{{$foo}}");
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 string(5) "{abc}"
 string(3) "abc"
-assert(!"{{$foo}}")
+AssertionError: assert(!"{{$foo}}")
diff --git a/ext/standard/tests/assert/gh22292.phpt b/ext/standard/tests/assert/gh22292.phpt
index e3aa72bf231..97c742a981d 100644
--- a/ext/standard/tests/assert/gh22292.phpt
+++ b/ext/standard/tests/assert/gh22292.phpt
@@ -11,21 +11,21 @@ public function __get($name) { return $name; }
 	${'---'} = 'abc';
 	var_dump(${'---'});
 	assert(!${'---'});
-} catch (Error $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

 ?>
 --EXPECT--
 string(3) "abc"
-assert(!${'---'})
+AssertionError: assert(!${'---'})
 string(3) "---"
-assert(!$f->{'---'})
+AssertionError: assert(!$f->{'---'})
diff --git a/ext/standard/tests/assert/gh22373.phpt b/ext/standard/tests/assert/gh22373.phpt
index 8c26f77f490..2d9fe9f5e79 100644
--- a/ext/standard/tests/assert/gh22373.phpt
+++ b/ext/standard/tests/assert/gh22373.phpt
@@ -11,18 +11,18 @@ public function __construct(
 	) {
 		try {
 			assert(($this->f)('abc') !== 'cba');
-		} catch (Error $e) {
-			echo $e->getMessage(), PHP_EOL;
+		} catch (Throwable $e) {
+			echo $e::class, ': ', $e->getMessage(), "\n";
 		}
 		try {
 			assert(($this?->f)('abc') !== 'cba');
-		} catch (Error $e) {
-			echo $e->getMessage(), PHP_EOL;
+		} catch (Throwable $e) {
+			echo $e::class, ': ', $e->getMessage(), "\n";
 		}
 		try {
 			assert((self::$sf)('abc') !== 'cba');
-		} catch (Error $e) {
-			echo $e->getMessage(), PHP_EOL;
+		} catch (Throwable $e) {
+			echo $e::class, ': ', $e->getMessage(), "\n";
 		}
 	}
 }
@@ -31,6 +31,6 @@ public function __construct(

 ?>
 --EXPECT--
-assert(($this->f)('abc') !== 'cba')
-assert(($this?->f)('abc') !== 'cba')
-assert((self::$sf)('abc') !== 'cba')
+AssertionError: assert(($this->f)('abc') !== 'cba')
+AssertionError: assert(($this?->f)('abc') !== 'cba')
+AssertionError: assert((self::$sf)('abc') !== 'cba')
diff --git a/ext/standard/tests/assert/gh22387.phpt b/ext/standard/tests/assert/gh22387.phpt
index 38c93921608..deb66b94aa5 100644
--- a/ext/standard/tests/assert/gh22387.phpt
+++ b/ext/standard/tests/assert/gh22387.phpt
@@ -18,45 +18,45 @@ public static function m() {

 try {
 	assert(!$foo instanceof (bar));
-} catch (AssertionError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(!new (bar)());
-} catch (AssertionError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(!(bar)::m());
-} catch (AssertionError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(!(bar)::$p);
-} catch (AssertionError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	assert(!(bar)::C);
-} catch (AssertionError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

 ?>
 --EXPECT--
-assert(!$foo instanceof (bar))
-assert(!new (bar)())
-assert(!(bar)::m())
-assert(!(bar)::$p)
-assert(!(bar)::C)
-assert((baz)::class !== 'stdClass')
+AssertionError: assert(!$foo instanceof (bar))
+AssertionError: assert(!new (bar)())
+AssertionError: assert(!(bar)::m())
+AssertionError: assert(!(bar)::$p)
+AssertionError: assert(!(bar)::C)
+AssertionError: assert((baz)::class !== 'stdClass')
diff --git a/ext/standard/tests/class_object/get_class_methods_basic_001.phpt b/ext/standard/tests/class_object/get_class_methods_basic_001.phpt
index fdfaf232ee0..27f36f0e867 100644
--- a/ext/standard/tests/class_object/get_class_methods_basic_001.phpt
+++ b/ext/standard/tests/class_object/get_class_methods_basic_001.phpt
@@ -27,8 +27,8 @@ class D {}
 echo "Argument is non existent class:\n";
 try {
     var_dump( get_class_methods("NonExistent") );
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "Done";
@@ -57,5 +57,5 @@ class D {}
 array(0) {
 }
 Argument is non existent class:
-get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, "NonExistent" given
+TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, "NonExistent" given
 Done
diff --git a/ext/standard/tests/class_object/method_exists_variation_001.phpt b/ext/standard/tests/class_object/method_exists_variation_001.phpt
index d45d2652d11..c021fc75b02 100644
--- a/ext/standard/tests/class_object/method_exists_variation_001.phpt
+++ b/ext/standard/tests/class_object/method_exists_variation_001.phpt
@@ -74,8 +74,8 @@ function test_error_handler($err_no, $err_msg, $filename, $linenum) {
       echo "\nArg value $value \n";
       try {
         var_dump( method_exists($value, $method) );
-      } catch (TypeError $e) {
-        echo $e->getMessage(), PHP_EOL;
+      } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
       }
 };

@@ -87,69 +87,69 @@ function test_error_handler($err_no, $err_msg, $filename, $linenum) {
 Error: 2 - Undefined variable $unset_var

 Arg value 0
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given

 Arg value 1
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given

 Arg value 12345
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given

 Arg value -2345
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given

 Arg value 10.5
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given

 Arg value -10.5
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given

 Arg value 101234567000
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given

 Arg value 1.07654321E-9
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given

 Arg value 0.5
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
 Error: 2 - Array to string conversion

 Arg value Array
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
 Error: 2 - Array to string conversion

 Arg value Array
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
 Error: 2 - Array to string conversion

 Arg value Array
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
 Error: 2 - Array to string conversion

 Arg value Array
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
 Error: 2 - Array to string conversion

 Arg value Array
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given

 Arg value
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given

 Arg value
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given

 Arg value 1
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given

 Arg value
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given

 Arg value 1
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given

 Arg value
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given

 Arg value
 bool(false)
@@ -166,8 +166,8 @@ function test_error_handler($err_no, $err_msg, $filename, $linenum) {
 bool(false)

 Arg value
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given

 Arg value
-method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
+TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
 Done
diff --git a/ext/standard/tests/constant_with_typed_class_constant.phpt b/ext/standard/tests/constant_with_typed_class_constant.phpt
index 87a1c006426..767f91f5f75 100644
--- a/ext/standard/tests/constant_with_typed_class_constant.phpt
+++ b/ext/standard/tests/constant_with_typed_class_constant.phpt
@@ -14,12 +14,12 @@ class Foo {

 try {
     constant("FOO::CONST2");
-} catch (TypeError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 object(stdClass)#1 (0) {
 }
-Cannot assign stdClass to class constant Foo::CONST2 of type array
+TypeError: Cannot assign stdClass to class constant Foo::CONST2 of type array
diff --git a/ext/standard/tests/dir/bug41693.phpt b/ext/standard/tests/dir/bug41693.phpt
index 05722b9558d..382244e0fbe 100644
--- a/ext/standard/tests/dir/bug41693.phpt
+++ b/ext/standard/tests/dir/bug41693.phpt
@@ -5,10 +5,10 @@

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

 ?>
 --EXPECT--
-scandir(): Argument #1 ($directory) must not be empty
+ValueError: scandir(): Argument #1 ($directory) must not be empty
diff --git a/ext/standard/tests/dir/closedir_variation2.phpt b/ext/standard/tests/dir/closedir_variation2.phpt
index 7898c9ae0ff..c210f6dfd6b 100644
--- a/ext/standard/tests/dir/closedir_variation2.phpt
+++ b/ext/standard/tests/dir/closedir_variation2.phpt
@@ -22,8 +22,8 @@
 echo "\n-- Close directory handle second time: --\n";
 try {
     var_dump(closedir($dh));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "Directory Handle: ";
 var_dump($dh);
@@ -41,5 +41,5 @@
 Directory Handle: resource(%d) of type (Unknown)

 -- Close directory handle second time: --
-closedir(): Argument #1 ($dir_handle) must be an open stream resource
+TypeError: closedir(): Argument #1 ($dir_handle) must be an open stream resource
 Directory Handle: resource(%d) of type (Unknown)
diff --git a/ext/standard/tests/dir/closedir_variation3.phpt b/ext/standard/tests/dir/closedir_variation3.phpt
index 053c8a947eb..1f8c260dccd 100644
--- a/ext/standard/tests/dir/closedir_variation3.phpt
+++ b/ext/standard/tests/dir/closedir_variation3.phpt
@@ -14,8 +14,8 @@
 echo "\n-- Try to close the file pointer using closedir() --\n";
 try {
     var_dump(closedir($fp));
-} catch (\TypeError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "\n-- Check file pointer: --\n";
 var_dump($fp);
@@ -31,7 +31,7 @@
 resource(%d) of type (stream)

 -- Try to close the file pointer using closedir() --
-closedir(): Argument #1 ($dir_handle) must be a valid Directory resource
+TypeError: closedir(): Argument #1 ($dir_handle) must be a valid Directory resource

 -- Check file pointer: --
 resource(%d) of type (stream)
diff --git a/ext/standard/tests/dir/closedir_without_arg.phpt b/ext/standard/tests/dir/closedir_without_arg.phpt
index f248764ed2a..79ce1dc3e58 100644
--- a/ext/standard/tests/dir/closedir_without_arg.phpt
+++ b/ext/standard/tests/dir/closedir_without_arg.phpt
@@ -4,10 +4,10 @@
 <?php
 try {
     closedir();
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Deprecated: closedir(): Passing null is deprecated, instead the last opened directory stream should be provided in %s on line %d
-No resource supplied
+TypeError: No resource supplied
diff --git a/ext/standard/tests/dir/dir_basic.phpt b/ext/standard/tests/dir/dir_basic.phpt
index 17a2b42bcda..9a530120da6 100644
--- a/ext/standard/tests/dir/dir_basic.phpt
+++ b/ext/standard/tests/dir/dir_basic.phpt
@@ -35,8 +35,8 @@
 echo "\nTest read after closing the dir:\n";
 try {
     var_dump( $d->read() );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // delete temp files
@@ -79,5 +79,5 @@
 }

 Test read after closing the dir:
-Directory::read(): cannot use Directory resource after it has been closed
+TypeError: Directory::read(): cannot use Directory resource after it has been closed
 Done
diff --git a/ext/standard/tests/dir/readdir_variation7.phpt b/ext/standard/tests/dir/readdir_variation7.phpt
index b3e3d88ccd5..d207a3162f8 100644
--- a/ext/standard/tests/dir/readdir_variation7.phpt
+++ b/ext/standard/tests/dir/readdir_variation7.phpt
@@ -12,12 +12,12 @@
 var_dump($fp = fopen(__FILE__, "r"));
 try {
     var_dump( readdir($fp) );
-} catch (\TypeError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
 *** Testing readdir() : usage variations ***
 resource(%d) of type (stream)
-readdir(): Argument #1 ($dir_handle) must be a valid Directory resource
+TypeError: readdir(): Argument #1 ($dir_handle) must be a valid Directory resource
diff --git a/ext/standard/tests/dir/rewinddir_variation2.phpt b/ext/standard/tests/dir/rewinddir_variation2.phpt
index 7ce3c522352..400d22ed9c8 100644
--- a/ext/standard/tests/dir/rewinddir_variation2.phpt
+++ b/ext/standard/tests/dir/rewinddir_variation2.phpt
@@ -19,8 +19,8 @@
 echo "\n-- Call to rewinddir() --\n";
 try {
     var_dump(rewinddir($dir_handle));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --CLEAN--
@@ -36,4 +36,4 @@
 string(%d) "%s"

 -- Call to rewinddir() --
-rewinddir(): Argument #1 ($dir_handle) must be an open stream resource
+TypeError: rewinddir(): Argument #1 ($dir_handle) must be an open stream resource
diff --git a/ext/standard/tests/dir/rewinddir_variation3.phpt b/ext/standard/tests/dir/rewinddir_variation3.phpt
index 21bddca1036..38ee45a141a 100644
--- a/ext/standard/tests/dir/rewinddir_variation3.phpt
+++ b/ext/standard/tests/dir/rewinddir_variation3.phpt
@@ -15,8 +15,8 @@

 try {
     var_dump(rewinddir($fp));
-} catch (\TypeError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 $result2 = fread($fp, 5);

@@ -32,7 +32,7 @@

 -- Open a file using fopen --
 resource(%d) of type (stream)
-rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource
+TypeError: rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource

 -- Check if rewinddir() has repositioned the file pointer --
 rewinddir() does not work on file pointers
diff --git a/ext/standard/tests/dir/scandir_invalid_flag.phpt b/ext/standard/tests/dir/scandir_invalid_flag.phpt
index 76838dc869b..81ffbdbe66f 100644
--- a/ext/standard/tests/dir/scandir_invalid_flag.phpt
+++ b/ext/standard/tests/dir/scandir_invalid_flag.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     scandir('something', -1);
-} catch (ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-scandir(): Argument #2 ($sorting_order) must be one of the SCANDIR_SORT_ASCENDING, SCANDIR_SORT_DESCENDING, or SCANDIR_SORT_NONE constants
+ValueError: scandir(): Argument #2 ($sorting_order) must be one of the SCANDIR_SORT_ASCENDING, SCANDIR_SORT_DESCENDING, or SCANDIR_SORT_NONE constants
diff --git a/ext/standard/tests/file/006_variation2.phpt b/ext/standard/tests/file/006_variation2.phpt
index 6b32f2246f1..aa30c545ec0 100644
--- a/ext/standard/tests/file/006_variation2.phpt
+++ b/ext/standard/tests/file/006_variation2.phpt
@@ -54,8 +54,8 @@
     printf("%o", fileperms($file_name) );
     echo "\n";
     clearstatcache();
-  } catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }

   try {
@@ -63,8 +63,8 @@
     printf("%o", fileperms($dir_name) );
     echo "\n";
     clearstatcache();
-  } catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   $count++;
 }
@@ -137,15 +137,15 @@
 bool(true)
 43567
 -- Iteration 12 --
-chmod(): Argument #2 ($permissions) must be of type int, string given
-chmod(): Argument #2 ($permissions) must be of type int, string given
+TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given
+TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given
 -- Iteration 13 --
-chmod(): Argument #2 ($permissions) must be of type int, string given
-chmod(): Argument #2 ($permissions) must be of type int, string given
+TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given
+TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given
 -- Iteration 14 --
-chmod(): Argument #2 ($permissions) must be of type int, string given
-chmod(): Argument #2 ($permissions) must be of type int, string given
+TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given
+TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given
 -- Iteration 15 --
-chmod(): Argument #2 ($permissions) must be of type int, string given
-chmod(): Argument #2 ($permissions) must be of type int, string given
+TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given
+TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given
 *** Done ***
diff --git a/ext/standard/tests/file/007_basic.phpt b/ext/standard/tests/file/007_basic.phpt
index 6a0c918ea39..503b34f6443 100644
--- a/ext/standard/tests/file/007_basic.phpt
+++ b/ext/standard/tests/file/007_basic.phpt
@@ -42,13 +42,13 @@
   // confirm the closure, using ftell() and feof()
   try {
     var_dump( ftell($handle) );
-  } catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   try {
     var_dump( feof($handle) );
-  } catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
 }

@@ -77,13 +77,13 @@
   // confirm the closure, using ftell() and feof()
   try {
     var_dump( ftell($handle) );
-  } catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   try {
     var_dump( feof($handle) );
-  } catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   var_dump( $handle );

@@ -102,8 +102,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'wb' --
 resource(%d) of type (stream)
@@ -111,8 +111,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'wt' --
 resource(%d) of type (stream)
@@ -120,8 +120,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'w+' --
 resource(%d) of type (stream)
@@ -129,8 +129,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'w+b' --
 resource(%d) of type (stream)
@@ -138,8 +138,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'w+t' --
 resource(%d) of type (stream)
@@ -147,8 +147,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'r' --
 resource(%d) of type (stream)
@@ -156,8 +156,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'rb' --
 resource(%d) of type (stream)
@@ -165,8 +165,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'rt' --
 resource(%d) of type (stream)
@@ -174,8 +174,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'r+' --
 resource(%d) of type (stream)
@@ -183,8 +183,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'r+b' --
 resource(%d) of type (stream)
@@ -192,8 +192,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'r+t' --
 resource(%d) of type (stream)
@@ -201,8 +201,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'a' --
 resource(%d) of type (stream)
@@ -210,8 +210,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'ab' --
 resource(%d) of type (stream)
@@ -219,8 +219,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'at' --
 resource(%d) of type (stream)
@@ -228,8 +228,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'a+' --
 resource(%d) of type (stream)
@@ -237,8 +237,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'a+t' --
 resource(%d) of type (stream)
@@ -246,8 +246,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'a+b' --
 resource(%d) of type (stream)
@@ -255,8 +255,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource

 -- Iteration with mode 'x' --
 resource(%d) of type (stream)
@@ -264,8 +264,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource
 resource(%d) of type (Unknown)

 -- Iteration with mode 'xb' --
@@ -274,8 +274,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource
 resource(%d) of type (Unknown)

 -- Iteration with mode 'xt' --
@@ -284,8 +284,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource
 resource(%d) of type (Unknown)

 -- Iteration with mode 'x+' --
@@ -294,8 +294,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource
 resource(%d) of type (Unknown)

 -- Iteration with mode 'x+b' --
@@ -304,8 +304,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource
 resource(%d) of type (Unknown)

 -- Iteration with mode 'x+t' --
@@ -314,8 +314,8 @@
 bool(false)
 bool(true)
 resource(%d) of type (Unknown)
-ftell(): Argument #1 ($stream) must be an open stream resource
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource
 resource(%d) of type (Unknown)

 *** Done ***
diff --git a/ext/standard/tests/file/bug71882.phpt b/ext/standard/tests/file/bug71882.phpt
index 68f98f19b6a..39d6a52a30d 100644
--- a/ext/standard/tests/file/bug71882.phpt
+++ b/ext/standard/tests/file/bug71882.phpt
@@ -5,9 +5,9 @@
 $fd = fopen("php://memory", "w+");
 try {
     var_dump(ftruncate($fd, -1));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
diff --git a/ext/standard/tests/file/chgrp.phpt b/ext/standard/tests/file/chgrp.phpt
index 1e4899e4657..2d4726642c8 100644
--- a/ext/standard/tests/file/chgrp.phpt
+++ b/ext/standard/tests/file/chgrp.phpt
@@ -9,8 +9,8 @@
 <?php
 try {
     chgrp("sjhgfskhagkfdgskjfhgskfsdgfkdsajf", 0);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
diff --git a/ext/standard/tests/file/disk_free_space_variation.phpt b/ext/standard/tests/file/disk_free_space_variation.phpt
index aaeae022af4..1395c6d67a4 100644
--- a/ext/standard/tests/file/disk_free_space_variation.phpt
+++ b/ext/standard/tests/file/disk_free_space_variation.phpt
@@ -43,13 +43,13 @@
   echo "\n-- Iteration $count --\n";
   try {
     var_dump( disk_free_space( $dir1 ) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   try {
     var_dump( diskfreespace( $dir1 ) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   $count++;
 }
@@ -103,19 +103,19 @@
 float(%f)

 -- Iteration 9 --
-disk_free_space(): Argument #1 ($directory) must not contain any null bytes
-diskfreespace(): Argument #1 ($directory) must not contain any null bytes
+ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes
+ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes

 -- Iteration 10 --
-disk_free_space(): Argument #1 ($directory) must not contain any null bytes
-diskfreespace(): Argument #1 ($directory) must not contain any null bytes
+ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes
+ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes

 -- Iteration 11 --
-disk_free_space(): Argument #1 ($directory) must not contain any null bytes
-diskfreespace(): Argument #1 ($directory) must not contain any null bytes
+ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes
+ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes

 -- Iteration 12 --
-disk_free_space(): Argument #1 ($directory) must not contain any null bytes
-diskfreespace(): Argument #1 ($directory) must not contain any null bytes
+ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes
+ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes

 --- Done ---
diff --git a/ext/standard/tests/file/disk_total_space_variation.phpt b/ext/standard/tests/file/disk_total_space_variation.phpt
index 25d7e5a1c7d..d9b8bbe875e 100644
--- a/ext/standard/tests/file/disk_total_space_variation.phpt
+++ b/ext/standard/tests/file/disk_total_space_variation.phpt
@@ -46,8 +46,8 @@
   echo "\n-- Iteration $count --\n";
   try {
     var_dump( disk_total_space( $dir1 ) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   $count++;
 }
@@ -95,16 +95,16 @@
 float(%f)

 -- Iteration 9 --
-disk_total_space(): Argument #1 ($directory) must not contain any null bytes
+ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes

 -- Iteration 10 --
-disk_total_space(): Argument #1 ($directory) must not contain any null bytes
+ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes

 -- Iteration 11 --
-disk_total_space(): Argument #1 ($directory) must not contain any null bytes
+ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes

 -- Iteration 12 --
-disk_total_space(): Argument #1 ($directory) must not contain any null bytes
+ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes
 *** Testing with Binary Input ***
 float(%s)

diff --git a/ext/standard/tests/file/fclose_variation1.phpt b/ext/standard/tests/file/fclose_variation1.phpt
index 56a6d4bd4c1..9195c60f786 100644
--- a/ext/standard/tests/file/fclose_variation1.phpt
+++ b/ext/standard/tests/file/fclose_variation1.phpt
@@ -9,12 +9,12 @@ function separate_zval(&$var) { }
 fclose($s);
 try {
     echo fread($s2, strlen("<?php"));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "\nDone.\n";
 ?>
 --EXPECT--
-fread(): Argument #1 ($stream) must be an open stream resource
+TypeError: fread(): Argument #1 ($stream) must be an open stream resource

 Done.
diff --git a/ext/standard/tests/file/feof_basic.phpt b/ext/standard/tests/file/feof_basic.phpt
index 943af213e39..4ffb2994b08 100644
--- a/ext/standard/tests/file/feof_basic.phpt
+++ b/ext/standard/tests/file/feof_basic.phpt
@@ -60,8 +60,8 @@
 fclose($h);
 try {
     feof($h);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 unlink($tmpFile1);
 unlink($tmpFile2);
@@ -94,5 +94,5 @@
 *** testing feof after a seek passed the end ***
 bool(false)
 *** closing file, testing eof ***
-feof(): Argument #1 ($stream) must be an open stream resource
+TypeError: feof(): Argument #1 ($stream) must be an open stream resource
 Done
diff --git a/ext/standard/tests/file/fgetc_variation2.phpt b/ext/standard/tests/file/fgetc_variation2.phpt
index 89161d08819..2852576959d 100644
--- a/ext/standard/tests/file/fgetc_variation2.phpt
+++ b/ext/standard/tests/file/fgetc_variation2.phpt
@@ -21,8 +21,8 @@
 // read from closed file
 try {
     var_dump( fgetc($file_handle) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done";
@@ -30,5 +30,5 @@
 --EXPECT--
 *** Testing fgetc() : usage variations ***
 -- Testing fgetc() with closed handle --
-fgetc(): Argument #1 ($stream) must be an open stream resource
+TypeError: fgetc(): Argument #1 ($stream) must be an open stream resource
 Done
diff --git a/ext/standard/tests/file/fgetcsv_error_conditions.phpt b/ext/standard/tests/file/fgetcsv_error_conditions.phpt
index 3c1353cb3c2..bd98a86f42b 100644
--- a/ext/standard/tests/file/fgetcsv_error_conditions.phpt
+++ b/ext/standard/tests/file/fgetcsv_error_conditions.phpt
@@ -13,49 +13,49 @@
 echo 'fgetcsv() with negative length' . \PHP_EOL;
 try {
     var_dump( fgetcsv($file_handle, -10, escape: "\\") );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( fgetcsv($file_handle, -10, $delimiter, escape: "\\") );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( fgetcsv($file_handle, -10, $delimiter, $enclosure, escape: "\\") );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo 'fgetcsv() with delimiter as empty string' . \PHP_EOL;
 try {
     var_dump( fgetcsv($file_handle, $length, '', $enclosure, escape: "\\") );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo 'fgetcsv() with enclosure as empty string' . \PHP_EOL;
 try {
     var_dump( fgetcsv($file_handle, $length, $delimiter, '', escape: "\\") );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo 'fgetcsv() with delimiter & enclosure as empty string' . \PHP_EOL;
 try {
     var_dump( fgetcsv($file_handle, $length, '', '', escape: "\\") );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 fgetcsv() with negative length
-fgetcsv(): Argument #2 ($length) must be between 0 and %d
-fgetcsv(): Argument #2 ($length) must be between 0 and %d
-fgetcsv(): Argument #2 ($length) must be between 0 and %d
+ValueError: fgetcsv(): Argument #2 ($length) must be between 0 and %d
+ValueError: fgetcsv(): Argument #2 ($length) must be between 0 and %d
+ValueError: fgetcsv(): Argument #2 ($length) must be between 0 and %d
 fgetcsv() with delimiter as empty string
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 fgetcsv() with enclosure as empty string
-fgetcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fgetcsv(): Argument #4 ($enclosure) must be a single character
 fgetcsv() with delimiter & enclosure as empty string
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
diff --git a/ext/standard/tests/file/fgetcsv_variation12.phpt b/ext/standard/tests/file/fgetcsv_variation12.phpt
index b2297668e7b..56210dbd271 100644
--- a/ext/standard/tests/file/fgetcsv_variation12.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation12.phpt
@@ -71,8 +71,8 @@
     $enc = "%%";
     try {
         var_dump( fgetcsv($file_handle, 1024, $del, $enc) );
-    } catch (ValueError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     // check the file pointer position and if eof
     var_dump( ftell($file_handle) );
@@ -91,362 +91,362 @@
 *** Testing fgetcsv() : with two chars as enclosure & delimiter ***

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 Done
diff --git a/ext/standard/tests/file/fgetcsv_variation19.phpt b/ext/standard/tests/file/fgetcsv_variation19.phpt
index 0451e21447f..0bdf329bfd2 100644
--- a/ext/standard/tests/file/fgetcsv_variation19.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation19.phpt
@@ -69,8 +69,8 @@
     $del = "++";
     try {
         var_dump( fgetcsv($file_handle, 1024, $del, escape: "\\") );
-    } catch (ValueError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     // check the file pointer position and if eof
     var_dump( ftell($file_handle) );
@@ -89,377 +89,377 @@
 *** Testing fgetcsv() : with default enclosure & delimiter of two chars ***

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rb mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using rt mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using r+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using a+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using w+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+ mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+b mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)

 -- Testing fgetcsv() with file opened using x+t mode --
-fgetcsv(): Argument #3 ($separator) must be a single character
+ValueError: fgetcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 Done
diff --git a/ext/standard/tests/file/fgets_error.phpt b/ext/standard/tests/file/fgets_error.phpt
index fefbd723bc5..528665decf6 100644
--- a/ext/standard/tests/file/fgets_error.phpt
+++ b/ext/standard/tests/file/fgets_error.phpt
@@ -11,15 +11,15 @@
 $len = 0;
 try {
     var_dump( fgets($fp, $len) );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $len = -10;
 try {
     var_dump( fgets($fp, $len) );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 $len = 1;
 var_dump( fgets($fp, $len) ); // return length - 1 always, expect false
@@ -28,6 +28,6 @@
 --EXPECT--
 *** Testing error conditions ***
 -- Testing fgets() with invalid length arguments --
-fgets(): Argument #2 ($length) must be greater than 0
-fgets(): Argument #2 ($length) must be greater than 0
+ValueError: fgets(): Argument #2 ($length) must be greater than 0
+ValueError: fgets(): Argument #2 ($length) must be greater than 0
 bool(false)
diff --git a/ext/standard/tests/file/fgets_variation2.phpt b/ext/standard/tests/file/fgets_variation2.phpt
index 5d262cde295..acdf6699e18 100644
--- a/ext/standard/tests/file/fgets_variation2.phpt
+++ b/ext/standard/tests/file/fgets_variation2.phpt
@@ -21,13 +21,13 @@
 // read from closed file
 try {
     var_dump( fgets($file_handle) ); // default length
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( fgets($file_handle, 10) ); // with specific length
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done";
@@ -35,6 +35,6 @@
 --EXPECT--
 *** Testing fgets() : usage variations ***
 -- Testing fgets() with closed handle --
-fgets(): Argument #1 ($stream) must be an open stream resource
-fgets(): Argument #1 ($stream) must be an open stream resource
+TypeError: fgets(): Argument #1 ($stream) must be an open stream resource
+TypeError: fgets(): Argument #1 ($stream) must be an open stream resource
 Done
diff --git a/ext/standard/tests/file/file_error.phpt b/ext/standard/tests/file/file_error.phpt
index fffad3c59b6..c26aec9072c 100644
--- a/ext/standard/tests/file/file_error.phpt
+++ b/ext/standard/tests/file/file_error.phpt
@@ -9,13 +9,13 @@
 $filename = $file_path."/file.tmp";
 try {
     var_dump( file($filename, 10, NULL) );  //  Incorrect flag
-} catch(ValueError $e) {
-    echo "ValueError: " . $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( file($filename, FILE_APPEND) );  //  Incorrect flag
-} catch(ValueError $e) {
-    echo "ValueError: " . $e->getMessage() . "\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump( file("temp.tmp") );  // non existing filename
 fclose($file_handle);
diff --git a/ext/standard/tests/file/file_get_contents_error.phpt b/ext/standard/tests/file/file_get_contents_error.phpt
index add7831ef39..747e99f5910 100644
--- a/ext/standard/tests/file/file_get_contents_error.phpt
+++ b/ext/standard/tests/file/file_get_contents_error.phpt
@@ -19,8 +19,8 @@
 echo "\n-- Testing for invalid negative maxlen values --\n";
 try {
     file_get_contents($file_path."/file_get_contents_error1.tmp", FALSE, $file_handle, 0, -5);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 delete_files($file_path, 1, "file_get_contents_error", 1);
@@ -48,6 +48,6 @@
 bool(false)

 -- Testing for invalid negative maxlen values --
-file_get_contents(): Argument #5 ($length) must be greater than or equal to 0
+ValueError: file_get_contents(): Argument #5 ($length) must be greater than or equal to 0

 *** Done ***
diff --git a/ext/standard/tests/file/file_get_contents_error002.phpt b/ext/standard/tests/file/file_get_contents_error002.phpt
index d47efa26a1b..d38ede46e1d 100644
--- a/ext/standard/tests/file/file_get_contents_error002.phpt
+++ b/ext/standard/tests/file/file_get_contents_error002.phpt
@@ -9,9 +9,9 @@
 <?php
 try {
     file_get_contents("http://checkip.dyndns.com",null,null,0,-1);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-file_get_contents(): Argument #5 ($length) must be greater than or equal to 0
+ValueError: file_get_contents(): Argument #5 ($length) must be greater than or equal to 0
diff --git a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt
index 7133ae766d6..72c7395d066 100644
--- a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt
+++ b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt
@@ -14,8 +14,8 @@
 file_put_contents($file_path."/file_put_contents_error1.tmp", "Garbage data in the file");
 try {
     file_get_contents($file_path."/file_put_contents_error1.tmp", FALSE, NULL, 0, -5);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\n*** Done ***\n";
@@ -34,6 +34,6 @@
 Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d

 -- Testing for invalid negative maxlen values --
-file_get_contents(): Argument #5 ($length) must be greater than or equal to 0
+ValueError: file_get_contents(): Argument #5 ($length) must be greater than or equal to 0

 *** Done ***
diff --git a/ext/standard/tests/file/file_get_contents_variation8.phpt b/ext/standard/tests/file/file_get_contents_variation8.phpt
index 94d3a31c775..d5624967566 100644
--- a/ext/standard/tests/file/file_get_contents_variation8.phpt
+++ b/ext/standard/tests/file/file_get_contents_variation8.phpt
@@ -34,8 +34,8 @@
     echo "-- Iteration $i --\n";
     try {
         var_dump(file_get_contents($names_arr[$i]));
-    } catch (\TypeError|\ValueError $e) {
-        echo get_class($e) . ': ' . $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

diff --git a/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt b/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt
index 01ee940d953..73122d3502b 100644
--- a/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt
+++ b/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt
@@ -10,8 +10,8 @@
         ],
     ]);
     var_dump(file_get_contents("http://example.com", context: $context));
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $context = stream_context_create([
@@ -37,7 +37,7 @@

 ?>
 --EXPECTF--
-file_get_contents(): Provided stream context has invalid value for the "uri_parser_class" option
+ValueError: file_get_contents(): Provided stream context has invalid value for the "uri_parser_class" option

 Warning: file_get_contents(): Failed to open stream: operation failed in %s on line %d
 bool(false)
diff --git a/ext/standard/tests/file/file_put_contents.phpt b/ext/standard/tests/file/file_put_contents.phpt
index 97094e92d0e..0db4fc52aae 100644
--- a/ext/standard/tests/file/file_put_contents.phpt
+++ b/ext/standard/tests/file/file_put_contents.phpt
@@ -13,16 +13,16 @@ function __toString() {

 try {
     var_dump(file_put_contents($file, $context));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(file_put_contents($file, new stdClass));
 var_dump(file_put_contents($file, new foo));
 $fp = fopen($file, "r");
 try {
     var_dump(file_put_contents($file, "string", 0, $fp));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -33,8 +33,8 @@ function __toString() {
 unlink($file);
 ?>
 --EXPECT--
-file_put_contents(): supplied resource is not a valid stream resource
+TypeError: file_put_contents(): supplied resource is not a valid stream resource
 bool(false)
 int(15)
-file_put_contents(): supplied resource is not a valid Stream-Context resource
+TypeError: file_put_contents(): supplied resource is not a valid Stream-Context resource
 Done
diff --git a/ext/standard/tests/file/file_put_contents_variation8.phpt b/ext/standard/tests/file/file_put_contents_variation8.phpt
index 12ae8379f69..7f1ad5c4a66 100644
--- a/ext/standard/tests/file/file_put_contents_variation8.phpt
+++ b/ext/standard/tests/file/file_put_contents_variation8.phpt
@@ -44,8 +44,8 @@
         } else {
             echo "Failed to write data to: '$names_arr[$i]'\n";
         }
-    } catch (\TypeError|\ValueError $e) {
-        echo get_class($e) . ': ' . $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

diff --git a/ext/standard/tests/file/file_variation6.phpt b/ext/standard/tests/file/file_variation6.phpt
index 9bd91cfd40d..c88dbfdf257 100644
--- a/ext/standard/tests/file/file_variation6.phpt
+++ b/ext/standard/tests/file/file_variation6.phpt
@@ -11,8 +11,8 @@
 for ($flags = 0; $flags <= 32; $flags++) {
     try {
         var_dump(file($filepath, $flags));
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -95,14 +95,14 @@
   [2]=>
   string(6) "Line 3"
 }
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
 array(3) {
   [0]=>
   string(7) "Line 1
@@ -175,12 +175,12 @@
   [2]=>
   string(6) "Line 3"
 }
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
-file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
+ValueError: file(): Argument #2 ($flags) must be a valid flag value
diff --git a/ext/standard/tests/file/filegroup_variation3.phpt b/ext/standard/tests/file/filegroup_variation3.phpt
index 94562850f58..fbee0d01734 100644
--- a/ext/standard/tests/file/filegroup_variation3.phpt
+++ b/ext/standard/tests/file/filegroup_variation3.phpt
@@ -34,8 +34,8 @@
   echo "- Iteration $count -\n";
   try {
     var_dump( filegroup( $file_path."/".$file ) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   clearstatcache();
   $count++;
diff --git a/ext/standard/tests/file/fileinode_variation3.phpt b/ext/standard/tests/file/fileinode_variation3.phpt
index 506984d4177..a90120bbec6 100644
--- a/ext/standard/tests/file/fileinode_variation3.phpt
+++ b/ext/standard/tests/file/fileinode_variation3.phpt
@@ -33,8 +33,8 @@
   echo "- Iteration $count -\n";
   try {
     var_dump( fileinode( $file_path."/".$file ) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   clearstatcache();
   $count++;
diff --git a/ext/standard/tests/file/fileowner_variation3.phpt b/ext/standard/tests/file/fileowner_variation3.phpt
index e6360b47571..a3906bf54e5 100644
--- a/ext/standard/tests/file/fileowner_variation3.phpt
+++ b/ext/standard/tests/file/fileowner_variation3.phpt
@@ -34,8 +34,8 @@
   echo "- Iteration $count -\n";
   try {
     var_dump( fileowner( $file_path."/".$file ) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   clearstatcache();
   $count++;
diff --git a/ext/standard/tests/file/fileperms_variation3.phpt b/ext/standard/tests/file/fileperms_variation3.phpt
index 6c1da17d6bf..dcce3e5937a 100644
--- a/ext/standard/tests/file/fileperms_variation3.phpt
+++ b/ext/standard/tests/file/fileperms_variation3.phpt
@@ -33,8 +33,8 @@
   echo "- Iteration $count -\n";
   try {
     var_dump( fileperms( $file_path."/".$file ) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   clearstatcache();
   $count++;
diff --git a/ext/standard/tests/file/filesize_variation3.phpt b/ext/standard/tests/file/filesize_variation3.phpt
index bf27c893b6e..aeefe1db423 100644
--- a/ext/standard/tests/file/filesize_variation3.phpt
+++ b/ext/standard/tests/file/filesize_variation3.phpt
@@ -18,8 +18,8 @@
     $file_handle = fopen($filename, "r+");
     try {
         var_dump( ftruncate($file_handle, $size) );
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     fclose($file_handle);
     var_dump( filesize($filename) );
@@ -57,5 +57,5 @@
 int(1200)
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
diff --git a/ext/standard/tests/file/flock.phpt b/ext/standard/tests/file/flock.phpt
index 0e07114f9cd..ad612f868a2 100644
--- a/ext/standard/tests/file/flock.phpt
+++ b/ext/standard/tests/file/flock.phpt
@@ -10,8 +10,8 @@

 try {
     var_dump(flock($fp, LOCK_SH|LOCK_NB));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 /*
@@ -41,8 +41,8 @@

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

 ?>
@@ -52,7 +52,7 @@
 unlink($file);
 ?>
 --EXPECT--
-flock(): Argument #1 ($stream) must be an open stream resource
+TypeError: flock(): Argument #1 ($stream) must be an open stream resource
 bool(true)
 bool(true)
 bool(true)
@@ -66,4 +66,4 @@
 bool(true)
 int(0)
 bool(true)
-flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
+ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
diff --git a/ext/standard/tests/file/flock_error.phpt b/ext/standard/tests/file/flock_error.phpt
index 2ca20c3436a..cb4186eccf9 100644
--- a/ext/standard/tests/file/flock_error.phpt
+++ b/ext/standard/tests/file/flock_error.phpt
@@ -31,8 +31,8 @@
     echo "--- Iteration $i ---" . \PHP_EOL;
     try {
         var_dump(flock($fp, $operation));
-    } catch (\TypeError|\ValueError $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     $i++;
 }
@@ -43,8 +43,8 @@
 fclose($fp);
 try {
     var_dump(flock($fp, LOCK_SH|LOCK_NB));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --CLEAN--
@@ -55,19 +55,19 @@
 --EXPECT--
 *** Testing error conditions ***
 --- Iteration 0 ---
-flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
+ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
 --- Iteration 1 ---
-flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
+ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
 --- Iteration 2 ---
-flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
+ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
 --- Iteration 3 ---
-flock(): Argument #2 ($operation) must be of type int, array given
+TypeError: flock(): Argument #2 ($operation) must be of type int, array given
 --- Iteration 4 ---
-flock(): Argument #2 ($operation) must be of type int, array given
+TypeError: flock(): Argument #2 ($operation) must be of type int, array given
 --- Iteration 5 ---
-flock(): Argument #2 ($operation) must be of type int, string given
+TypeError: flock(): Argument #2 ($operation) must be of type int, string given
 --- Iteration 6 ---
-flock(): Argument #2 ($operation) must be of type int, string given
+TypeError: flock(): Argument #2 ($operation) must be of type int, string given
 --- Iteration 7 ---
-flock(): Argument #2 ($operation) must be of type int, string given
-flock(): Argument #1 ($stream) must be an open stream resource
+TypeError: flock(): Argument #2 ($operation) must be of type int, string given
+TypeError: flock(): Argument #1 ($stream) must be an open stream resource
diff --git a/ext/standard/tests/file/fnmatch_variation.phpt b/ext/standard/tests/file/fnmatch_variation.phpt
index 3413c3e6f76..8f1e92eb5d1 100644
--- a/ext/standard/tests/file/fnmatch_variation.phpt
+++ b/ext/standard/tests/file/fnmatch_variation.phpt
@@ -64,8 +64,8 @@
   echo "-- Iteration $i --\n";
   try {
     var_dump( fnmatch($pattern_arr[$i], $file_name) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
 }
 unlink($file_name);
@@ -80,8 +80,8 @@ function match_( $pattern, $string ) {
     for( $j = 0; $j<count($string); $j++ ) {
       try {
         var_dump( fnmatch($pattern[$i], $string[$j]) );
-      } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+      } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
       }
     }
   }
@@ -185,9 +185,9 @@ function match_( $pattern, $string ) {
 -- Iteration 22 --
 bool(false)
 -- Iteration 23 --
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
 -- Iteration 24 --
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
 -- Iteration 25 --
 bool(false)
 -- Iteration 26 --
@@ -261,44 +261,44 @@ function match_( $pattern, $string ) {
 --- With Strings ---
 -- Iteration 0 --
 bool(true)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(true)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(false)
 bool(true)
 -- Iteration 1 --
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
 -- Iteration 2 --
 bool(true)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(true)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(false)
 bool(true)
 -- Iteration 3 --
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
 -- Iteration 4 --
 bool(false)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(false)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(true)
 bool(false)
 -- Iteration 5 --
 bool(true)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(true)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(false)
 bool(true)

@@ -397,22 +397,22 @@ function match_( $pattern, $string ) {
 --- With NULL ---
 -- Iteration 0 --
 bool(true)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(false)
 bool(false)
 -- Iteration 1 --
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
-fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes
 -- Iteration 2 --
 bool(false)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(true)
 bool(false)
 -- Iteration 3 --
 bool(false)
-fnmatch(): Argument #2 ($filename) must not contain any null bytes
+ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes
 bool(false)
 bool(true)

diff --git a/ext/standard/tests/file/fputcsv_variation13.phpt b/ext/standard/tests/file/fputcsv_variation13.phpt
index 2a2e1ef0470..ef3a1984a47 100644
--- a/ext/standard/tests/file/fputcsv_variation13.phpt
+++ b/ext/standard/tests/file/fputcsv_variation13.phpt
@@ -53,8 +53,8 @@
     // write to a file in csv format
     try {
       var_dump( fputcsv($file_handle, $csv_field, '+', '%%', escape: "\\") );
-    } catch (ValueError $e) {
-      echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+      echo $e::class, ': ', $e->getMessage(), "\n";
     }
     // check the file pointer position and eof
     var_dump( ftell($file_handle) );
@@ -76,649 +76,649 @@
 *** Testing fputcsv() : with default enclosure & delimiter of two chars ***

 -- file opened in r+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #4 ($enclosure) must be a single character
+ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character
 int(0)
 bool(false)
 string(0) ""
diff --git a/ext/standard/tests/file/fputcsv_variation17.phpt b/ext/standard/tests/file/fputcsv_variation17.phpt
index 786b0649467..f96fe0720c7 100644
--- a/ext/standard/tests/file/fputcsv_variation17.phpt
+++ b/ext/standard/tests/file/fputcsv_variation17.phpt
@@ -28,4 +28,4 @@
 123,456,789
 """aaa""","""bbb"""

-aaa,bbb,ccc,dddd%0123,456,789%0"""aaa""","""bbb"""
\ No newline at end of file
+aaa,bbb,ccc,dddd%0123,456,789%0"""aaa""","""bbb"""
diff --git a/ext/standard/tests/file/fputcsv_variation9.phpt b/ext/standard/tests/file/fputcsv_variation9.phpt
index b2bc895cd87..4becae1b1e8 100644
--- a/ext/standard/tests/file/fputcsv_variation9.phpt
+++ b/ext/standard/tests/file/fputcsv_variation9.phpt
@@ -52,8 +52,8 @@
     // write to a file in csv format
     try {
       var_dump( fputcsv($file_handle, $csv_field, '++', '%%') );
-    } catch (ValueError $e) {
-      echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+      echo $e::class, ': ', $e->getMessage(), "\n";
     }
     // check the file pointer position and eof
     var_dump( ftell($file_handle) );
@@ -75,649 +75,649 @@
 *** Testing fputcsv() : with two chars as enclosure & delimiter ***

 -- file opened in r+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in r+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in a+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in w+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+ --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+b --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""

 -- file opened in x+t --
-fputcsv(): Argument #3 ($separator) must be a single character
+ValueError: fputcsv(): Argument #3 ($separator) must be a single character
 int(0)
 bool(false)
 string(0) ""
diff --git a/ext/standard/tests/file/fread_error.phpt b/ext/standard/tests/file/fread_error.phpt
index b89369e288e..89eb8076853 100644
--- a/ext/standard/tests/file/fread_error.phpt
+++ b/ext/standard/tests/file/fread_error.phpt
@@ -11,20 +11,20 @@
 $len = 0;
 try {
     var_dump( fread($file_handle, $len) );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $len = -10;
 try {
     var_dump( fread($file_handle, $len) );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 *** Testing error conditions ***
 -- Testing fread() with invalid length arguments --
-fread(): Argument #2 ($length) must be greater than 0
-fread(): Argument #2 ($length) must be greater than 0
+ValueError: fread(): Argument #2 ($length) must be greater than 0
+ValueError: fread(): Argument #2 ($length) must be greater than 0
diff --git a/ext/standard/tests/file/fscanf.phpt b/ext/standard/tests/file/fscanf.phpt
index 4acadc6169b..e081bfb3619 100644
--- a/ext/standard/tests/file/fscanf.phpt
+++ b/ext/standard/tests/file/fscanf.phpt
@@ -20,8 +20,8 @@
 $fp = fopen($filename, "rt");
 try {
     fscanf($fp, "%s", $v, $v1);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 var_dump($v);
 var_dump($v1);
@@ -32,8 +32,8 @@
 $fp = fopen($filename, "rt");
 try {
     fscanf($fp, "", $v, $v1);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 var_dump($v);
 var_dump($v1);
@@ -44,8 +44,8 @@
 $fp = fopen($filename, "rt");
 try {
     fscanf($fp, "%.a", $v, $v1);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 var_dump($v);
 var_dump($v1);
@@ -64,8 +64,8 @@
 $fp = fopen($filename, "rt");
 try {
     var_dump(fscanf($fp, "%s%d", $v));
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "Done\n";
@@ -80,15 +80,15 @@
 NULL
 int(1)
 string(4) "data"
-Variable is not assigned by any conversion specifiers
+ValueError: Variable is not assigned by any conversion specifiers
 string(4) "data"
 NULL
-Variable is not assigned by any conversion specifiers
+ValueError: Variable is not assigned by any conversion specifiers
 array(0) {
 }
 array(0) {
 }
-Bad scan conversion character "."
+ValueError: Bad scan conversion character "."
 array(0) {
 }
 array(0) {
@@ -96,5 +96,5 @@
 bool(false)
 array(0) {
 }
-Different numbers of variable names and field specifiers
+ValueError: Different numbers of variable names and field specifiers
 Done
diff --git a/ext/standard/tests/file/fscanf_error.phpt b/ext/standard/tests/file/fscanf_error.phpt
index da586555be0..fe30b36b4a5 100644
--- a/ext/standard/tests/file/fscanf_error.phpt
+++ b/ext/standard/tests/file/fscanf_error.phpt
@@ -15,8 +15,8 @@
 // invalid file handle
 try {
     fscanf($file_handle, "%s");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // number of formats in format strings not matching the no of variables
@@ -25,8 +25,8 @@
   exit("Error:failed to open file $filename");
 try {
     fscanf($file_handle, "%d%s%f", $int_var, $string_var);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 fclose($file_handle);

@@ -41,8 +41,8 @@
     exit("Error:failed to open file $filename");
   try {
     var_dump(fscanf($file_handle, $format));
-  } catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+  } catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
   }
   fclose($file_handle);
 }
@@ -57,13 +57,13 @@
 ?>
 --EXPECT--
 *** Testing fscanf() for error conditions ***
-fscanf(): supplied resource is not a valid File-Handle resource
-Different numbers of variable names and field specifiers
+TypeError: fscanf(): supplied resource is not a valid File-Handle resource
+ValueError: Different numbers of variable names and field specifiers
 array(0) {
 }
-Bad scan conversion character "
-Bad scan conversion character "
-Bad scan conversion character "."
-Bad scan conversion character "m"
+ValueError: Bad scan conversion character "
+ValueError: Bad scan conversion character "
+ValueError: Bad scan conversion character "."
+ValueError: Bad scan conversion character "m"

 *** Done ***
diff --git a/ext/standard/tests/file/fscanf_variation10.phpt b/ext/standard/tests/file/fscanf_variation10.phpt
index 1de7d25ffd9..ec9e0785051 100644
--- a/ext/standard/tests/file/fscanf_variation10.phpt
+++ b/ext/standard/tests/file/fscanf_variation10.phpt
@@ -58,8 +58,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump( fscanf($file_handle,$float_format) );
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -147,8 +147,8 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation11.phpt b/ext/standard/tests/file/fscanf_variation11.phpt
index 40560cfb39d..af1516d8063 100644
--- a/ext/standard/tests/file/fscanf_variation11.phpt
+++ b/ext/standard/tests/file/fscanf_variation11.phpt
@@ -63,8 +63,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$float_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -388,18 +388,18 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation12.phpt b/ext/standard/tests/file/fscanf_variation12.phpt
index 0969d05febc..875935ad949 100644
--- a/ext/standard/tests/file/fscanf_variation12.phpt
+++ b/ext/standard/tests/file/fscanf_variation12.phpt
@@ -64,8 +64,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$float_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -497,24 +497,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation13.phpt b/ext/standard/tests/file/fscanf_variation13.phpt
index 73806dc6e48..7dbff56b5c1 100644
--- a/ext/standard/tests/file/fscanf_variation13.phpt
+++ b/ext/standard/tests/file/fscanf_variation13.phpt
@@ -50,8 +50,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$float_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -147,10 +147,10 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation14.phpt b/ext/standard/tests/file/fscanf_variation14.phpt
index 97a07a98f2e..7f1546eefa4 100644
--- a/ext/standard/tests/file/fscanf_variation14.phpt
+++ b/ext/standard/tests/file/fscanf_variation14.phpt
@@ -96,8 +96,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$string_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -565,30 +565,30 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation15.phpt b/ext/standard/tests/file/fscanf_variation15.phpt
index b35bb1bebe2..54a0540413e 100644
--- a/ext/standard/tests/file/fscanf_variation15.phpt
+++ b/ext/standard/tests/file/fscanf_variation15.phpt
@@ -66,8 +66,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$string_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -463,21 +463,21 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation16.phpt b/ext/standard/tests/file/fscanf_variation16.phpt
index 199db82a026..89158474c09 100644
--- a/ext/standard/tests/file/fscanf_variation16.phpt
+++ b/ext/standard/tests/file/fscanf_variation16.phpt
@@ -57,8 +57,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$string_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -146,8 +146,8 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation17.phpt b/ext/standard/tests/file/fscanf_variation17.phpt
index 64080a1a83b..d88d758c905 100644
--- a/ext/standard/tests/file/fscanf_variation17.phpt
+++ b/ext/standard/tests/file/fscanf_variation17.phpt
@@ -62,8 +62,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$string_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -387,18 +387,18 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation18.phpt b/ext/standard/tests/file/fscanf_variation18.phpt
index eef94173c58..d785c34c81b 100644
--- a/ext/standard/tests/file/fscanf_variation18.phpt
+++ b/ext/standard/tests/file/fscanf_variation18.phpt
@@ -70,8 +70,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$string_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -539,24 +539,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation19.phpt b/ext/standard/tests/file/fscanf_variation19.phpt
index f5bc3f19e38..00d60ee31ce 100644
--- a/ext/standard/tests/file/fscanf_variation19.phpt
+++ b/ext/standard/tests/file/fscanf_variation19.phpt
@@ -54,8 +54,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$string_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -151,10 +151,10 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation2.phpt b/ext/standard/tests/file/fscanf_variation2.phpt
index f2c5593c3ee..bf1d280d685 100644
--- a/ext/standard/tests/file/fscanf_variation2.phpt
+++ b/ext/standard/tests/file/fscanf_variation2.phpt
@@ -64,8 +64,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$int_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -533,24 +533,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation20.phpt b/ext/standard/tests/file/fscanf_variation20.phpt
index 70b13dd55c9..22b1edf0c9e 100644
--- a/ext/standard/tests/file/fscanf_variation20.phpt
+++ b/ext/standard/tests/file/fscanf_variation20.phpt
@@ -68,8 +68,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$char_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -537,24 +537,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation21.phpt b/ext/standard/tests/file/fscanf_variation21.phpt
index 86968ddd117..7d6e8bfbfee 100644
--- a/ext/standard/tests/file/fscanf_variation21.phpt
+++ b/ext/standard/tests/file/fscanf_variation21.phpt
@@ -66,8 +66,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$char_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -463,21 +463,21 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation22.phpt b/ext/standard/tests/file/fscanf_variation22.phpt
index 87a5fe21bc2..be049ca06c2 100644
--- a/ext/standard/tests/file/fscanf_variation22.phpt
+++ b/ext/standard/tests/file/fscanf_variation22.phpt
@@ -57,8 +57,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$char_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -146,8 +146,8 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation23.phpt b/ext/standard/tests/file/fscanf_variation23.phpt
index f7bb4ee5520..f96278d7e17 100644
--- a/ext/standard/tests/file/fscanf_variation23.phpt
+++ b/ext/standard/tests/file/fscanf_variation23.phpt
@@ -62,8 +62,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$char_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -387,18 +387,18 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation24.phpt b/ext/standard/tests/file/fscanf_variation24.phpt
index 4c46cf58dad..9f41f68cba1 100644
--- a/ext/standard/tests/file/fscanf_variation24.phpt
+++ b/ext/standard/tests/file/fscanf_variation24.phpt
@@ -68,8 +68,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$char_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -531,24 +531,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation25.phpt b/ext/standard/tests/file/fscanf_variation25.phpt
index dc9d9936022..1a2b9f2a3d0 100644
--- a/ext/standard/tests/file/fscanf_variation25.phpt
+++ b/ext/standard/tests/file/fscanf_variation25.phpt
@@ -54,8 +54,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$char_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -181,10 +181,10 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation26.phpt b/ext/standard/tests/file/fscanf_variation26.phpt
index 19db8f45abf..c91fba1aee2 100644
--- a/ext/standard/tests/file/fscanf_variation26.phpt
+++ b/ext/standard/tests/file/fscanf_variation26.phpt
@@ -49,8 +49,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$char_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -206,11 +206,11 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation27.phpt b/ext/standard/tests/file/fscanf_variation27.phpt
index a9560e04250..dd34a100e9e 100644
--- a/ext/standard/tests/file/fscanf_variation27.phpt
+++ b/ext/standard/tests/file/fscanf_variation27.phpt
@@ -69,8 +69,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$octal_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -538,24 +538,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation28.phpt b/ext/standard/tests/file/fscanf_variation28.phpt
index 18c9726f853..b327d0a7059 100644
--- a/ext/standard/tests/file/fscanf_variation28.phpt
+++ b/ext/standard/tests/file/fscanf_variation28.phpt
@@ -67,8 +67,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$octal_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -464,21 +464,21 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation29.phpt b/ext/standard/tests/file/fscanf_variation29.phpt
index a35d782fcd4..af3ec2ebaba 100644
--- a/ext/standard/tests/file/fscanf_variation29.phpt
+++ b/ext/standard/tests/file/fscanf_variation29.phpt
@@ -58,8 +58,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$octal_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -147,8 +147,8 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation30.phpt b/ext/standard/tests/file/fscanf_variation30.phpt
index 9afde0f093a..0fa139cd0d2 100644
--- a/ext/standard/tests/file/fscanf_variation30.phpt
+++ b/ext/standard/tests/file/fscanf_variation30.phpt
@@ -63,8 +63,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$octal_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -388,18 +388,18 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation31.phpt b/ext/standard/tests/file/fscanf_variation31.phpt
index a9e2c8b2686..905d4b04979 100644
--- a/ext/standard/tests/file/fscanf_variation31.phpt
+++ b/ext/standard/tests/file/fscanf_variation31.phpt
@@ -64,8 +64,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$octal_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -497,24 +497,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation32.phpt b/ext/standard/tests/file/fscanf_variation32.phpt
index df393f9d839..0b0351c10f2 100644
--- a/ext/standard/tests/file/fscanf_variation32.phpt
+++ b/ext/standard/tests/file/fscanf_variation32.phpt
@@ -55,8 +55,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$octal_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -152,10 +152,10 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation35.phpt b/ext/standard/tests/file/fscanf_variation35.phpt
index 61b939d3212..03b672d9757 100644
--- a/ext/standard/tests/file/fscanf_variation35.phpt
+++ b/ext/standard/tests/file/fscanf_variation35.phpt
@@ -53,8 +53,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$hexa_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -142,8 +142,8 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation36.phpt b/ext/standard/tests/file/fscanf_variation36.phpt
index 61571f6c6cb..cfd5b95efb9 100644
--- a/ext/standard/tests/file/fscanf_variation36.phpt
+++ b/ext/standard/tests/file/fscanf_variation36.phpt
@@ -58,8 +58,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$hexa_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -383,18 +383,18 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation37.phpt b/ext/standard/tests/file/fscanf_variation37.phpt
index d597ebe307c..9f7d299df2a 100644
--- a/ext/standard/tests/file/fscanf_variation37.phpt
+++ b/ext/standard/tests/file/fscanf_variation37.phpt
@@ -64,8 +64,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$hexa_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -497,24 +497,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation38.phpt b/ext/standard/tests/file/fscanf_variation38.phpt
index 236d547f6b7..28563727eff 100644
--- a/ext/standard/tests/file/fscanf_variation38.phpt
+++ b/ext/standard/tests/file/fscanf_variation38.phpt
@@ -50,8 +50,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$hexa_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -147,10 +147,10 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation4.phpt b/ext/standard/tests/file/fscanf_variation4.phpt
index 45a3b5702b1..96c9cbb0f5f 100644
--- a/ext/standard/tests/file/fscanf_variation4.phpt
+++ b/ext/standard/tests/file/fscanf_variation4.phpt
@@ -54,8 +54,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$int_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -143,8 +143,8 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation41.phpt b/ext/standard/tests/file/fscanf_variation41.phpt
index 4c993bbeec5..0747c25a5db 100644
--- a/ext/standard/tests/file/fscanf_variation41.phpt
+++ b/ext/standard/tests/file/fscanf_variation41.phpt
@@ -53,8 +53,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$unsigned_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -142,8 +142,8 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation42.phpt b/ext/standard/tests/file/fscanf_variation42.phpt
index 90436ff1249..be126b8b36f 100644
--- a/ext/standard/tests/file/fscanf_variation42.phpt
+++ b/ext/standard/tests/file/fscanf_variation42.phpt
@@ -58,8 +58,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$unsigned_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -383,18 +383,18 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation43.phpt b/ext/standard/tests/file/fscanf_variation43.phpt
index 72afbba0c38..5341f6eff5a 100644
--- a/ext/standard/tests/file/fscanf_variation43.phpt
+++ b/ext/standard/tests/file/fscanf_variation43.phpt
@@ -64,8 +64,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$unsigned_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -497,24 +497,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation44.phpt b/ext/standard/tests/file/fscanf_variation44.phpt
index 3dfd5d6d7bd..5e58ad2df68 100644
--- a/ext/standard/tests/file/fscanf_variation44.phpt
+++ b/ext/standard/tests/file/fscanf_variation44.phpt
@@ -50,8 +50,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$unsigned_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -147,10 +147,10 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation45.phpt b/ext/standard/tests/file/fscanf_variation45.phpt
index b694da0e555..0d8ef5a1b53 100644
--- a/ext/standard/tests/file/fscanf_variation45.phpt
+++ b/ext/standard/tests/file/fscanf_variation45.phpt
@@ -64,8 +64,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$scientific_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -533,24 +533,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation46.phpt b/ext/standard/tests/file/fscanf_variation46.phpt
index bc96af6dbe3..26e71d4a9d8 100644
--- a/ext/standard/tests/file/fscanf_variation46.phpt
+++ b/ext/standard/tests/file/fscanf_variation46.phpt
@@ -62,8 +62,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$scientific_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -459,21 +459,21 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation47.phpt b/ext/standard/tests/file/fscanf_variation47.phpt
index 04b92b7e9f7..9d77347bac4 100644
--- a/ext/standard/tests/file/fscanf_variation47.phpt
+++ b/ext/standard/tests/file/fscanf_variation47.phpt
@@ -53,8 +53,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$scientific_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -142,8 +142,8 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation48.phpt b/ext/standard/tests/file/fscanf_variation48.phpt
index aa717bd83e0..08baeea192e 100644
--- a/ext/standard/tests/file/fscanf_variation48.phpt
+++ b/ext/standard/tests/file/fscanf_variation48.phpt
@@ -58,8 +58,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$scientific_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -383,18 +383,18 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation49.phpt b/ext/standard/tests/file/fscanf_variation49.phpt
index 43505fc2491..ca1c86f9284 100644
--- a/ext/standard/tests/file/fscanf_variation49.phpt
+++ b/ext/standard/tests/file/fscanf_variation49.phpt
@@ -64,8 +64,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$scientific_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -497,24 +497,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation5.phpt b/ext/standard/tests/file/fscanf_variation5.phpt
index 7ccdbf6402e..b6b9a8d7fcc 100644
--- a/ext/standard/tests/file/fscanf_variation5.phpt
+++ b/ext/standard/tests/file/fscanf_variation5.phpt
@@ -58,8 +58,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$int_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -383,18 +383,18 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation50.phpt b/ext/standard/tests/file/fscanf_variation50.phpt
index 1e6ecb865e9..c52f5a571d7 100644
--- a/ext/standard/tests/file/fscanf_variation50.phpt
+++ b/ext/standard/tests/file/fscanf_variation50.phpt
@@ -50,8 +50,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$scientific_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -147,10 +147,10 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation6.phpt b/ext/standard/tests/file/fscanf_variation6.phpt
index 577477e5de6..1b1f3eadbed 100644
--- a/ext/standard/tests/file/fscanf_variation6.phpt
+++ b/ext/standard/tests/file/fscanf_variation6.phpt
@@ -64,8 +64,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$int_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -497,24 +497,24 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation7.phpt b/ext/standard/tests/file/fscanf_variation7.phpt
index 42e2455eea8..36af4e193da 100644
--- a/ext/standard/tests/file/fscanf_variation7.phpt
+++ b/ext/standard/tests/file/fscanf_variation7.phpt
@@ -50,8 +50,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$int_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -147,10 +147,10 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fscanf_variation8.phpt b/ext/standard/tests/file/fscanf_variation8.phpt
index 2851d7c0277..38b93abdd53 100644
--- a/ext/standard/tests/file/fscanf_variation8.phpt
+++ b/ext/standard/tests/file/fscanf_variation8.phpt
@@ -82,8 +82,8 @@
   while( !feof($file_handle) ) {
     try {
       var_dump(fscanf($file_handle,$float_format));
-    } catch (ValueError $exception) {
-      echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
   }
   $counter++;
@@ -839,36 +839,36 @@
 bool(false)

 -- iteration 7 --
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
-Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
+ValueError: Bad scan conversion character " "
 bool(false)

 -- iteration 8 --
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt
index c38f7905399..8f123b2fb71 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt
@@ -11,8 +11,8 @@
 fclose($fp);
 try {
     var_dump(fseek($fp,10));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -20,5 +20,5 @@
 --EXPECT--
 *** Testing fseek() : error conditions ***
 -- Testing fseek() with closed/unset file handle --
-fseek(): Argument #1 ($stream) must be an open stream resource
+TypeError: fseek(): Argument #1 ($stream) must be an open stream resource
 Done
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt
index 58c3b5330d8..ae2ccd73be5 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt
@@ -11,8 +11,8 @@
 fclose($fp);
 try {
     var_dump(ftell($fp));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -20,5 +20,5 @@
 --EXPECT--
 *** Testing ftell() : error conditions ***
 -- Testing ftell with closed/unset file handle --
-ftell(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftell(): Argument #1 ($stream) must be an open stream resource
 Done
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt
index ad50244edb3..d9c188ea4ba 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt
@@ -11,8 +11,8 @@
 fclose($fp);
 try {
     var_dump(rewind($fp));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -20,5 +20,5 @@
 --EXPECT--
 *** Testing rewind() : error conditions ***
 -- Testing rewind() with closed/unset file handle --
-rewind(): Argument #1 ($stream) must be an open stream resource
+TypeError: rewind(): Argument #1 ($stream) must be an open stream resource
 Done
diff --git a/ext/standard/tests/file/fstat.phpt b/ext/standard/tests/file/fstat.phpt
index 86d1453f1b7..5199a556288 100644
--- a/ext/standard/tests/file/fstat.phpt
+++ b/ext/standard/tests/file/fstat.phpt
@@ -10,8 +10,8 @@
 fclose($fp);
 try {
     var_dump(fstat($fp));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 @unlink($filename);
@@ -72,5 +72,5 @@
   ["blocks"]=>
   int(%i)
 }
-fstat(): Argument #1 ($stream) must be an open stream resource
+TypeError: fstat(): Argument #1 ($stream) must be an open stream resource
 Done
diff --git a/ext/standard/tests/file/ftruncate.phpt b/ext/standard/tests/file/ftruncate.phpt
index 2bdefefaaf1..093dc911ad1 100644
--- a/ext/standard/tests/file/ftruncate.phpt
+++ b/ext/standard/tests/file/ftruncate.phpt
@@ -34,8 +34,8 @@
 $fp = fopen($filename, "a");
 try {
     var_dump(ftruncate($fp, -1000000000));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 fclose($fp);
 var_dump(file_get_contents($filename));
@@ -52,5 +52,5 @@
 string(10) "some test "
 bool(true)
 string(0) ""
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 string(21) "some test data inside"
diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt
index 3397fc25f44..9783dca116d 100644
--- a/ext/standard/tests/file/ftruncate_error.phpt
+++ b/ext/standard/tests/file/ftruncate_error.phpt
@@ -17,8 +17,8 @@
 fclose($file_handle);
 try {
     var_dump( ftruncate($file_handle,10) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 // check the first size
 var_dump( filesize($filename) );
@@ -35,6 +35,6 @@

  Initial file size = 36
 -- Testing ftruncate() with closed/unset file handle --
-ftruncate(): Argument #1 ($stream) must be an open stream resource
+TypeError: ftruncate(): Argument #1 ($stream) must be an open stream resource
 int(36)
 Done
diff --git a/ext/standard/tests/file/ftruncate_variation4.phpt b/ext/standard/tests/file/ftruncate_variation4.phpt
index 865b6ff902a..4a4099ec483 100644
--- a/ext/standard/tests/file/ftruncate_variation4.phpt
+++ b/ext/standard/tests/file/ftruncate_variation4.phpt
@@ -48,8 +48,8 @@
         var_dump( ftell($file_handle) );
         try {
             var_dump( ftruncate($file_handle, $new_size) ); // truncate it
-        } catch (\ValueError $e) {
-            echo $e->getMessage() . \PHP_EOL;
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
         var_dump( ftell($file_handle) );
         var_dump( feof($file_handle) );
@@ -72,7 +72,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -80,7 +80,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -88,7 +88,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -96,7 +96,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -104,7 +104,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -112,7 +112,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -120,7 +120,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -128,7 +128,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -136,7 +136,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -144,7 +144,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -152,7 +152,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -160,7 +160,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -168,7 +168,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -176,7 +176,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -184,7 +184,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -192,7 +192,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -200,7 +200,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -208,7 +208,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -216,7 +216,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -224,7 +224,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -232,7 +232,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -240,7 +240,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -248,7 +248,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -256,7 +256,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -266,7 +266,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -274,7 +274,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -282,7 +282,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -290,7 +290,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -298,7 +298,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -306,7 +306,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -314,7 +314,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -322,7 +322,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -330,7 +330,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -338,7 +338,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -346,7 +346,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -354,7 +354,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -362,7 +362,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -370,7 +370,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -378,7 +378,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -386,7 +386,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -394,7 +394,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -402,7 +402,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -410,7 +410,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -418,7 +418,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -426,7 +426,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -434,7 +434,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -442,7 +442,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
@@ -450,7 +450,7 @@
 -- Testing ftruncate(): try truncating file to a negative size --
 bool(true)
 int(0)
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 int(0)
 bool(false)
 bool(true)
diff --git a/ext/standard/tests/file/fwrite_error.phpt b/ext/standard/tests/file/fwrite_error.phpt
index 62ec928a29d..0ffda1c7595 100644
--- a/ext/standard/tests/file/fwrite_error.phpt
+++ b/ext/standard/tests/file/fwrite_error.phpt
@@ -23,8 +23,8 @@
 fclose($file_handle);
 try {
     var_dump(fwrite($file_handle,"data"));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -40,5 +40,5 @@
 int(0)
 int(0)
 -- Testing fwrite() with closed/unset file handle --
-fwrite(): Argument #1 ($stream) must be an open stream resource
+TypeError: fwrite(): Argument #1 ($stream) must be an open stream resource
 Done
diff --git a/ext/standard/tests/file/gh18212.phpt b/ext/standard/tests/file/gh18212.phpt
index 6e4d8ad9bd3..07f5780d66c 100644
--- a/ext/standard/tests/file/gh18212.phpt
+++ b/ext/standard/tests/file/gh18212.phpt
@@ -10,4 +10,3 @@
 --EXPECT--
 int(-1)
 int(-1)
-
diff --git a/ext/standard/tests/file/glob_variation.phpt b/ext/standard/tests/file/glob_variation.phpt
index 4fc1c240b4d..b36793d3f3e 100644
--- a/ext/standard/tests/file/glob_variation.phpt
+++ b/ext/standard/tests/file/glob_variation.phpt
@@ -51,8 +51,8 @@
     var_dump( glob($pattern, GLOB_NOCHECK) );
     var_dump( glob($pattern, GLOB_NOESCAPE) );
     var_dump( glob($pattern, GLOB_ERR) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   $counter++;
 }
@@ -77,8 +77,8 @@
   echo "-- Iteration $counter --\n";
   try {
     var_dump( glob($pattern, GLOB_ONLYDIR) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   $counter++;
 }
@@ -332,7 +332,7 @@
 }

 -- Iteration 8 --
-glob(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: glob(): Argument #1 ($pattern) must not contain any null bytes

 -- Iteration 9 --
 array(0) {
@@ -435,7 +435,7 @@
 array(0) {
 }
 -- Iteration 8 --
-glob(): Argument #1 ($pattern) must not contain any null bytes
+ValueError: glob(): Argument #1 ($pattern) must not contain any null bytes
 -- Iteration 9 --
 array(0) {
 }
diff --git a/ext/standard/tests/file/is_dir_variation4.phpt b/ext/standard/tests/file/is_dir_variation4.phpt
index 30285804a33..4dd3aca9c2e 100644
--- a/ext/standard/tests/file/is_dir_variation4.phpt
+++ b/ext/standard/tests/file/is_dir_variation4.phpt
@@ -31,8 +31,8 @@
   echo "\n-- Iteration $count --\n";
   try {
     var_dump( is_dir($file_path."/".$dir ) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   $count++;
 }
diff --git a/ext/standard/tests/file/is_executable_variation1.phpt b/ext/standard/tests/file/is_executable_variation1.phpt
index 289abb1a265..153fad15d35 100644
--- a/ext/standard/tests/file/is_executable_variation1.phpt
+++ b/ext/standard/tests/file/is_executable_variation1.phpt
@@ -44,8 +44,8 @@
   echo "-- Iteration $counter --\n";
   try {
     var_dump( is_executable($file) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   $counter++;
   clearstatcache();
diff --git a/ext/standard/tests/file/is_file_variation4.phpt b/ext/standard/tests/file/is_file_variation4.phpt
index 9d98b7fd90d..a69d62e5280 100644
--- a/ext/standard/tests/file/is_file_variation4.phpt
+++ b/ext/standard/tests/file/is_file_variation4.phpt
@@ -31,8 +31,8 @@
   echo "- Iteration $count -\n";
   try {
     var_dump( is_file( $file_path."/".$file ) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   clearstatcache();
   $count++;
diff --git a/ext/standard/tests/file/is_readable_variation1.phpt b/ext/standard/tests/file/is_readable_variation1.phpt
index 8548a840ccb..ca697320eeb 100644
--- a/ext/standard/tests/file/is_readable_variation1.phpt
+++ b/ext/standard/tests/file/is_readable_variation1.phpt
@@ -43,8 +43,8 @@
   echo "-- Iteration $counter --\n";
   try {
     var_dump( is_readable($file) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   $counter++;
   clearstatcache();
diff --git a/ext/standard/tests/file/is_writable_variation1.phpt b/ext/standard/tests/file/is_writable_variation1.phpt
index 181b1ba4e26..337e3e5986f 100644
--- a/ext/standard/tests/file/is_writable_variation1.phpt
+++ b/ext/standard/tests/file/is_writable_variation1.phpt
@@ -42,13 +42,13 @@
   echo "-- Iteration $counter --\n";
   try {
     var_dump( is_writable($file) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   try {
     var_dump( is_writeable($file) );
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   $counter++;
   clearstatcache();
diff --git a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt
index 831cb0c9566..0c63c287463 100644
--- a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt
+++ b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt
@@ -25,13 +25,13 @@
 echo "\n*** Testing mkdir() and rmdir() for binary safe functionality ***\n";
 try {
     var_dump( mkdir("$file_path/temp".chr(0)."/") );
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( rmdir("$file_path/temp".chr(0)."/") );
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n*** Testing mkdir() with miscellaneous input ***\n";
@@ -60,8 +60,8 @@
 bool(false)

 *** Testing mkdir() and rmdir() for binary safe functionality ***
-mkdir(): Argument #1 ($directory) must not contain any null bytes
-rmdir(): Argument #1 ($directory) must not contain any null bytes
+ValueError: mkdir(): Argument #1 ($directory) must not contain any null bytes
+ValueError: rmdir(): Argument #1 ($directory) must not contain any null bytes

 *** Testing mkdir() with miscellaneous input ***
 bool(true)
diff --git a/ext/standard/tests/file/pathinfo_variation3.phpt b/ext/standard/tests/file/pathinfo_variation3.phpt
index 86f88677d81..57e1d8f6856 100644
--- a/ext/standard/tests/file/pathinfo_variation3.phpt
+++ b/ext/standard/tests/file/pathinfo_variation3.phpt
@@ -18,33 +18,33 @@

 try {
 	pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_DIRNAME);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo($testfile, PATHINFO_FILENAME|PATHINFO_BASENAME);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_EXTENSION);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_BASENAME);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -84,9 +84,9 @@
 string(4) "inet"
 string(1) "h"
 string(17) "/usr/include/arpa"
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
diff --git a/ext/standard/tests/file/popen_pclose_error.phpt b/ext/standard/tests/file/popen_pclose_error.phpt
index 6c92708dddb..9258e2c8092 100644
--- a/ext/standard/tests/file/popen_pclose_error.phpt
+++ b/ext/standard/tests/file/popen_pclose_error.phpt
@@ -5,24 +5,24 @@

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

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

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

 ?>
 --EXPECT--
-popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb"
-popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb"
-popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb"
+ValueError: popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb"
+ValueError: popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb"
+ValueError: popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb"
diff --git a/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt b/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt
index f48c7b87200..00488b9d1c6 100644
--- a/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt
+++ b/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt
@@ -6,9 +6,9 @@
     try {
       proc_open('not_a_real_command_but_I_dont_care', array(0 => $context), $pipes);
       echo "Not reached";
-    } catch (TypeError $e) {
-      echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+      echo $e::class, ': ', $e->getMessage(), "\n";
     }
 ?>
 --EXPECT--
-proc_open(): supplied resource is not a valid stream resource
+TypeError: proc_open(): supplied resource is not a valid stream resource
diff --git a/ext/standard/tests/file/readfile_error.phpt b/ext/standard/tests/file/readfile_error.phpt
index d21554296a1..cc47ca7560e 100644
--- a/ext/standard/tests/file/readfile_error.phpt
+++ b/ext/standard/tests/file/readfile_error.phpt
@@ -10,13 +10,13 @@
 // invalid arguments
 try {
     var_dump( readfile('') );  // empty string as $filename
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( readfile(false) );  // boolean false as $filename
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Testing readfile() with non-existent file --\n";
@@ -29,8 +29,8 @@
 *** Test readfile(): error conditions ***

 -- Testing readfile() with invalid arguments --
-Path must not be empty
-Path must not be empty
+ValueError: Path must not be empty
+ValueError: Path must not be empty

 -- Testing readfile() with non-existent file --

diff --git a/ext/standard/tests/file/readfile_variation10.phpt b/ext/standard/tests/file/readfile_variation10.phpt
index 3782f738451..90910ebc65d 100644
--- a/ext/standard/tests/file/readfile_variation10.phpt
+++ b/ext/standard/tests/file/readfile_variation10.phpt
@@ -35,8 +35,8 @@
     echo "-- testing '$name' --\n";
     try {
         readfile($name);
-    } catch (\TypeError|\ValueError $e) {
-        echo get_class($e) . ': ' . $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 ?>
diff --git a/ext/standard/tests/file/stream_rfc2397_006.phpt b/ext/standard/tests/file/stream_rfc2397_006.phpt
index bde1d4e0ceb..39184320e77 100644
--- a/ext/standard/tests/file/stream_rfc2397_006.phpt
+++ b/ext/standard/tests/file/stream_rfc2397_006.phpt
@@ -16,15 +16,15 @@
 {
     try {
         var_dump(file_get_contents($stream));
-    } catch (ValueError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 ?>
 --EXPECTF--
-file_get_contents(): Argument #1 ($filename) must not contain any null bytes
-file_get_contents(): Argument #1 ($filename) must not contain any null bytes
+ValueError: file_get_contents(): Argument #1 ($filename) must not contain any null bytes
+ValueError: file_get_contents(): Argument #1 ($filename) must not contain any null bytes

 Warning: file_get_contents(): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d
 bool(false)
diff --git a/ext/standard/tests/file/stream_supports_lock.phpt b/ext/standard/tests/file/stream_supports_lock.phpt
index 76249e9106e..6225000392b 100644
--- a/ext/standard/tests/file/stream_supports_lock.phpt
+++ b/ext/standard/tests/file/stream_supports_lock.phpt
@@ -28,8 +28,8 @@
 var_dump($sock);
 try {
     var_dump(stream_supports_lock($sock));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -44,5 +44,5 @@
 resource(%d) of type (stream)
 bool(false)
 resource(%d) of type (stream-context)
-stream_supports_lock(): Argument #1 ($stream) must be an open stream resource
+TypeError: stream_supports_lock(): Argument #1 ($stream) must be an open stream resource
 Done
diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt
index c8420ea86fb..a247967823c 100644
--- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt
+++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt
@@ -29,8 +29,8 @@
 //invalid arguments
 try {
     var_dump(linkinfo(''));  // empty string as linkname
-} catch (ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -56,5 +56,5 @@
 bool(false)

 *** Testing linkinfo() for error conditions ***
-linkinfo(): Argument #1 ($path) must not be empty
+ValueError: linkinfo(): Argument #1 ($path) must not be empty
 Done
diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt
index 6f20ec140ef..008b7f6dc46 100644
--- a/ext/standard/tests/file/tempnam_variation3.phpt
+++ b/ext/standard/tests/file/tempnam_variation3.phpt
@@ -36,8 +36,8 @@
   echo "-- Iteration $i --\n";
   try {
     $file_name = tempnam("$file_path", $names_arr[$i]);
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     continue;
   }

@@ -97,9 +97,9 @@
 File permissions are => 100600
 File created in => directory specified
 -- Iteration 5 --
-tempnam(): Argument #2 ($prefix) must not contain any null bytes
+ValueError: tempnam(): Argument #2 ($prefix) must not contain any null bytes
 -- Iteration 6 --
-tempnam(): Argument #2 ($prefix) must be of type string, array given
+TypeError: tempnam(): Argument #2 ($prefix) must be of type string, array given
 -- Iteration 7 --
 File name is => %s/dir%s
 File permissions are => 100600
diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt
index 1928da4f896..6e8baec0d66 100644
--- a/ext/standard/tests/file/tempnam_variation7.phpt
+++ b/ext/standard/tests/file/tempnam_variation7.phpt
@@ -34,8 +34,8 @@
   echo "-- Iteration $i --\n";
   try {
     $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp");
-  } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     continue;
   }

@@ -96,9 +96,9 @@
 File permissions are => 100600
 File created in => temp dir
 -- Iteration 5 --
-tempnam(): Argument #1 ($directory) must not contain any null bytes
+ValueError: tempnam(): Argument #1 ($directory) must not contain any null bytes
 -- Iteration 6 --
-tempnam(): Argument #1 ($directory) must be of type string, array given
+TypeError: tempnam(): Argument #1 ($directory) must be of type string, array given
 -- Iteration 7 --

 Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7.php on line %d
diff --git a/ext/standard/tests/file/tempnam_variation9.phpt b/ext/standard/tests/file/tempnam_variation9.phpt
index 61178a022ce..8696eeba1d6 100644
--- a/ext/standard/tests/file/tempnam_variation9.phpt
+++ b/ext/standard/tests/file/tempnam_variation9.phpt
@@ -30,8 +30,8 @@
     echo "-- Iteration $i --\n";
     try {
         $file_name = tempnam("$file_path", $prefix);
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
         continue;
     }

diff --git a/ext/standard/tests/file/touch.phpt b/ext/standard/tests/file/touch.phpt
index 9e3972631aa..93df50282cb 100644
--- a/ext/standard/tests/file/touch.phpt
+++ b/ext/standard/tests/file/touch.phpt
@@ -37,8 +37,8 @@

 try {
     touch("/no/such/file/or/directory", null, 1599492068);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "Done\n";
@@ -57,5 +57,5 @@

 Warning: touch(): Unable to create file /no/such/file/or/directory because %s in %s on line %d
 bool(false)
-touch(): Argument #2 ($mtime) cannot be null when argument #3 ($atime) is an integer
+ValueError: touch(): Argument #2 ($mtime) cannot be null when argument #3 ($atime) is an integer
 Done
diff --git a/ext/standard/tests/file/userstreams.phpt b/ext/standard/tests/file/userstreams.phpt
index 6ed35e1871f..7e104471d82 100644
--- a/ext/standard/tests/file/userstreams.phpt
+++ b/ext/standard/tests/file/userstreams.phpt
@@ -160,8 +160,8 @@ function stream_seek($offset, $whence)
 try {
     stream_wrapper_register("bogus", "class_not_exist");
     die("Registered a non-existent class!!!???");
-} catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo "Not Registered\n";

@@ -319,7 +319,7 @@ function stream_seek($offset, $whence)

 ?>
 --EXPECT--
-stream_wrapper_register(): Argument #2 ($class) must be a valid class name, "class_not_exist" given
+TypeError: stream_wrapper_register(): Argument #2 ($class) must be a valid class name, "class_not_exist" given
 Not Registered
 Registered
 Registered
diff --git a/ext/standard/tests/file/userstreams_002.phpt b/ext/standard/tests/file/userstreams_002.phpt
index ec16ed43207..47d0b922cd1 100644
--- a/ext/standard/tests/file/userstreams_002.phpt
+++ b/ext/standard/tests/file/userstreams_002.phpt
@@ -25,8 +25,8 @@ function test($name, $fd, $return_value) {
     $w = $e = null;
     try {
         var_dump(stream_select($r, $w, $e, 0) !== false);
-    } catch (TypeError|ValueError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

@@ -56,26 +56,26 @@ function test($name, $fd, $return_value) {
 Warning: stream_select(): test_wrapper_base::stream_cast is not implemented! in %s

 Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s
-No stream arrays were passed
+ValueError: No stream arrays were passed

 ------ return value is false: -------

 Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s
-No stream arrays were passed
+ValueError: No stream arrays were passed

 ------ return value not a stream resource: -------

 Warning: stream_select(): test_wrapper::stream_cast must return a stream resource in %s

 Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s
-No stream arrays were passed
+ValueError: No stream arrays were passed

 ------ return value is stream itself: -------

 Warning: stream_select(): test_wrapper::stream_cast must not return itself in %s

 Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s
-No stream arrays were passed
+ValueError: No stream arrays were passed

 ------ return value cannot be casted: -------

@@ -84,4 +84,4 @@ function test($name, $fd, $return_value) {
 Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s

 Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s
-No stream arrays were passed
+ValueError: No stream arrays were passed
diff --git a/ext/standard/tests/file/userstreams_005.phpt b/ext/standard/tests/file/userstreams_005.phpt
index 11dc8d45b0c..3b7e521d688 100644
--- a/ext/standard/tests/file/userstreams_005.phpt
+++ b/ext/standard/tests/file/userstreams_005.phpt
@@ -41,8 +41,8 @@ function test($name, $fd, $dest_size) {
 test("stream_truncate size 10", $fd, 10);
 try {
     test("stream_truncate negative size", $fd, -1);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 test("stream_truncate bad return", $fd3, 0);
 ?>
@@ -61,7 +61,7 @@ function test($name, $fd, $dest_size) {
 truncation with new_size=10
 bool(true)
 ------ stream_truncate negative size: -------
-ftruncate(): Argument #2 ($size) must be greater than or equal to 0
+ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0
 ------ stream_truncate bad return: -------
 truncation with new_size=0

diff --git a/ext/standard/tests/filters/bug54350.phpt b/ext/standard/tests/filters/bug54350.phpt
index ec3cd857f1a..3a03e839489 100644
--- a/ext/standard/tests/filters/bug54350.phpt
+++ b/ext/standard/tests/filters/bug54350.phpt
@@ -9,8 +9,8 @@ function filter($in, $out, &$consumed, $closing): int {
         }
         try {
             fclose($this->stream);
-        } catch (TypeError $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
         return 0;
     }
@@ -23,4 +23,4 @@ function filter($in, $out, &$consumed, $closing): int {
 ?>
 --EXPECTF--
 Warning: fclose(): cannot close the provided stream, as it must not be manually closed in %s on line %d
-fclose(): Argument #1 ($stream) must be of type resource, null given
+TypeError: fclose(): Argument #1 ($stream) must be of type resource, null given
diff --git a/ext/standard/tests/filters/bug77231.phpt b/ext/standard/tests/filters/bug77231.phpt
index 17967ee80fc..b499e4b4eb6 100644
--- a/ext/standard/tests/filters/bug77231.phpt
+++ b/ext/standard/tests/filters/bug77231.phpt
@@ -8,4 +8,4 @@
 array(1) {
   [0]=>
   string(74) "=BFAAAAAAAAFAAAAAAAAAAAAAA=FF=FF=FF=FF=FF=FF=FF=FFAAAAAAAAAAAAAAAAAAAAAAAA"
-}
\ No newline at end of file
+}
diff --git a/ext/standard/tests/filters/bug79468.phpt b/ext/standard/tests/filters/bug79468.phpt
index 0373f317102..fea45aa8e82 100644
--- a/ext/standard/tests/filters/bug79468.phpt
+++ b/ext/standard/tests/filters/bug79468.phpt
@@ -13,9 +13,9 @@
 fclose($fp);
 try {
     stream_filter_remove($rot13_filter);
-} catch (\Throwable $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(79) "stream_filter_remove(): supplied resource is not a valid stream filter resource"
+TypeError: stream_filter_remove(): supplied resource is not a valid stream filter resource
diff --git a/ext/standard/tests/filters/object_init_failure.phpt b/ext/standard/tests/filters/object_init_failure.phpt
index 3a88d87ccab..8c06a5d5078 100644
--- a/ext/standard/tests/filters/object_init_failure.phpt
+++ b/ext/standard/tests/filters/object_init_failure.phpt
@@ -8,12 +8,12 @@ class SampleFilter extends php_user_filter {
 stream_filter_register('sample.filter', SampleFilter::class);
 try {
     var_dump(file_get_contents('php://filter/read=sample.filter/resource='. __FILE__));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Warning: file_get_contents(): Unable to create or locate filter "sample.filter" in %s on line %d

 Warning: file_get_contents(): Unable to create filter (sample.filter) in %s on line %d
-Undefined constant "FOO"
+Error: Undefined constant "FOO"
diff --git a/ext/standard/tests/filters/object_init_failure_2.phpt b/ext/standard/tests/filters/object_init_failure_2.phpt
index 32473bc8312..69ceeae4192 100644
--- a/ext/standard/tests/filters/object_init_failure_2.phpt
+++ b/ext/standard/tests/filters/object_init_failure_2.phpt
@@ -8,12 +8,12 @@ class SampleFilter extends php_user_filter {
 stream_filter_register('sample.filter', SampleFilter::class);
 try {
     include 'php://filter/read=sample.filter/resource='. __FILE__;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Warning: main(): Unable to create or locate filter "sample.filter" in %s on line %d

 Warning: main(): Unable to create filter (sample.filter) in %s on line %d
-Undefined constant "FOO"
+Error: Undefined constant "FOO"
diff --git a/ext/standard/tests/filters/stream_filter_remove_error.phpt b/ext/standard/tests/filters/stream_filter_remove_error.phpt
index c16614f5941..b00c94d2ca6 100644
--- a/ext/standard/tests/filters/stream_filter_remove_error.phpt
+++ b/ext/standard/tests/filters/stream_filter_remove_error.phpt
@@ -17,8 +17,8 @@
 echo "\n-- Testing stream_filter_remove() function with bad resource --\n";
 try {
     stream_filter_remove($fp);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\n-- Testing stream_filter_remove() function with an already removed filter --\n";
@@ -26,8 +26,8 @@
 var_dump(stream_filter_remove( $filter ));
 try {
     stream_filter_remove($filter);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 fclose( $fp );
@@ -42,8 +42,8 @@
 *** Testing stream_filter_remove() : error conditions ***

 -- Testing stream_filter_remove() function with bad resource --
-stream_filter_remove(): supplied resource is not a valid stream filter resource
+TypeError: stream_filter_remove(): supplied resource is not a valid stream filter resource

 -- Testing stream_filter_remove() function with an already removed filter --
 bool(true)
-stream_filter_remove(): supplied resource is not a valid stream filter resource
+TypeError: stream_filter_remove(): supplied resource is not a valid stream filter resource
diff --git a/ext/standard/tests/general_functions/010.phpt b/ext/standard/tests/general_functions/010.phpt
index 08c941331f5..063e465dfaf 100644
--- a/ext/standard/tests/general_functions/010.phpt
+++ b/ext/standard/tests/general_functions/010.phpt
@@ -13,12 +13,12 @@ function __call($name=null, $args=null) {

 try {
     var_dump(register_shutdown_function(array("test","__call")));
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "Done\n";
 ?>
 --EXPECT--
-register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method test::__call() cannot be called statically
+TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method test::__call() cannot be called statically
 Done
diff --git a/ext/standard/tests/general_functions/bug25038.phpt b/ext/standard/tests/general_functions/bug25038.phpt
index 58acf1c977c..6a8c777686f 100644
--- a/ext/standard/tests/general_functions/bug25038.phpt
+++ b/ext/standard/tests/general_functions/bug25038.phpt
@@ -11,20 +11,20 @@ function bar($x='no argument')
 {
     bar('first try');
 }
-catch (Exception $e)
+catch (Throwable $e)
 {
-    print $e->getMessage()."\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try
 {
     call_user_func('bar','second try');
 }
-catch (Exception $e)
+catch (Throwable $e)
 {
-    print $e->getMessage()."\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-This is an exception from bar(first try).
-This is an exception from bar(second try).
+Exception: This is an exception from bar(first try).
+Exception: This is an exception from bar(second try).
diff --git a/ext/standard/tests/general_functions/bug31190.phpt b/ext/standard/tests/general_functions/bug31190.phpt
index 1a7917d47e4..a0008c9143e 100644
--- a/ext/standard/tests/general_functions/bug31190.phpt
+++ b/ext/standard/tests/general_functions/bug31190.phpt
@@ -4,22 +4,22 @@
 <?php

 class test {
-     function throwException() { throw new Exception("Hello World!\n");
+     function throwException() { throw new Exception("Hello World!");
 } }

 $array = array(new test(), 'throwException');
 try {
      call_user_func($array, 1, 2);
-} catch (Exception $e) {
-     echo $e->getMessage();
+} catch (Throwable $e) {
+     echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
      call_user_func_array($array, array(1, 2));
-} catch (Exception $e) {
-     echo $e->getMessage();
+} catch (Throwable $e) {
+     echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Hello World!
-Hello World!
+Exception: Hello World!
+Exception: Hello World!
diff --git a/ext/standard/tests/general_functions/bug32647.phpt b/ext/standard/tests/general_functions/bug32647.phpt
index 2e388d47420..e3ece8ef5fe 100644
--- a/ext/standard/tests/general_functions/bug32647.phpt
+++ b/ext/standard/tests/general_functions/bug32647.phpt
@@ -18,54 +18,54 @@ function barfoo ()

 try {
     register_shutdown_function(array($obj,""));
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     register_shutdown_function(array($obj,"some string"));
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     register_shutdown_function(array(0,""));
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

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

 try {
     register_shutdown_function(array(0,"some string"));
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

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

 register_shutdown_function('foo');

 try {
     register_shutdown_function(array('bar','barfoo'));
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 $obj = new bar;

 try {
     register_shutdown_function(array($obj,'foobar'));
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 register_shutdown_function(array($obj,'barfoo'));
@@ -73,15 +73,15 @@ function barfoo ()
 ?>
 --EXPECTF--
 Warning: Undefined variable $obj in %s on line %d
-register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object

 Warning: Undefined variable $obj in %s on line %d
-register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
-register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
-register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foo"
-register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
-register_shutdown_function(): Argument #1 ($callback) must be a valid callback, function "bar" not found or invalid function name
-register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method bar::barfoo() cannot be called statically
-register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foobar"
+TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foo"
+TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, function "bar" not found or invalid function name
+TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method bar::barfoo() cannot be called statically
+TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foobar"
 foo!
 bar!
diff --git a/ext/standard/tests/general_functions/bug41037.phpt b/ext/standard/tests/general_functions/bug41037.phpt
index 683b18ec251..64ef9ccce5c 100644
--- a/ext/standard/tests/general_functions/bug41037.phpt
+++ b/ext/standard/tests/general_functions/bug41037.phpt
@@ -7,8 +7,8 @@ function a() {
     echo "hello\n";
     try {
         unregister_tick_function('a');
-    } catch (Error $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -20,7 +20,7 @@ function a() {
 ?>
 --EXPECT--
 hello
-Registered tick function cannot be unregistered while it is being executed
+Error: Registered tick function cannot be unregistered while it is being executed
 Done
 hello
-Registered tick function cannot be unregistered while it is being executed
+Error: Registered tick function cannot be unregistered while it is being executed
diff --git a/ext/standard/tests/general_functions/bug41970.phpt b/ext/standard/tests/general_functions/bug41970.phpt
index 4d782612085..80868e6447a 100644
--- a/ext/standard/tests/general_functions/bug41970.phpt
+++ b/ext/standard/tests/general_functions/bug41970.phpt
@@ -8,14 +8,14 @@
 var_dump(call_user_func_array("sort", array($a)));
 try {
     var_dump(call_user_func_array("strlen", array($a)));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(call_user_func("sort", $a));
 try {
     var_dump(call_user_func("strlen", $a));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -23,9 +23,9 @@
 --EXPECTF--
 Warning: sort(): Argument #1 ($array) must be passed by reference, value given in %s on line %d
 bool(true)
-strlen(): Argument #1 ($string) must be of type string, array given
+TypeError: strlen(): Argument #1 ($string) must be of type string, array given

 Warning: sort(): Argument #1 ($array) must be passed by reference, value given in %s on line %d
 bool(true)
-strlen(): Argument #1 ($string) must be of type string, array given
+TypeError: strlen(): Argument #1 ($string) must be of type string, array given
 Done
diff --git a/ext/standard/tests/general_functions/bug44295.phpt b/ext/standard/tests/general_functions/bug44295.phpt
index 131f6496b7b..f715b63ea2d 100644
--- a/ext/standard/tests/general_functions/bug44295.phpt
+++ b/ext/standard/tests/general_functions/bug44295.phpt
@@ -17,13 +17,13 @@ function my_error_handler() {$a = func_get_args(); print "in error handler\n"; }
         $iter = new DirectoryIterator($dir);
         print get_class($iter) . "\n";
         print "after\n";
-} catch (Exception $e) {
-        print "in catch: ".$e->getMessage()."\n";
+} catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 ==DONE==
 <?php exit(0); ?>
 --EXPECT--
 before
-in catch: DirectoryIterator::__construct(): Failed to open directory: No such file or directory
+UnexpectedValueException: DirectoryIterator::__construct(): Failed to open directory: No such file or directory
 ==DONE==
diff --git a/ext/standard/tests/general_functions/bug47857.phpt b/ext/standard/tests/general_functions/bug47857.phpt
index 0d2b35b09f7..eb5fc0955fe 100644
--- a/ext/standard/tests/general_functions/bug47857.phpt
+++ b/ext/standard/tests/general_functions/bug47857.phpt
@@ -10,18 +10,18 @@ function bar() {
 var_dump(is_callable(array('foo','bar')));
 try {
     foo::bar();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(is_callable(array('Exception','getMessage')));
 try {
     Exception::getMessage();
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
 bool(false)
-Non-static method foo::bar() cannot be called statically
+Error: Non-static method foo::bar() cannot be called statically
 bool(false)
-Non-static method Exception::getMessage() cannot be called statically
+Error: Non-static method Exception::getMessage() cannot be called statically
diff --git a/ext/standard/tests/general_functions/bug72920.phpt b/ext/standard/tests/general_functions/bug72920.phpt
index cee43561de9..8e3d6558398 100644
--- a/ext/standard/tests/general_functions/bug72920.phpt
+++ b/ext/standard/tests/general_functions/bug72920.phpt
@@ -8,9 +8,9 @@ class Foo {

 try {
     var_dump(constant('Foo::C1'));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Cannot access private constant Foo::C1
+Error: Cannot access private constant Foo::C1
diff --git a/ext/standard/tests/general_functions/callbacks_001.phpt b/ext/standard/tests/general_functions/callbacks_001.phpt
index f173ca85161..4b745c0d5bd 100644
--- a/ext/standard/tests/general_functions/callbacks_001.phpt
+++ b/ext/standard/tests/general_functions/callbacks_001.phpt
@@ -71,8 +71,8 @@ public function test() {
         $this->call(array($this, 'O::who'));
         try {
             $this->call(array($this, 'B::who'));
-        } catch (TypeError $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
     }
 }
@@ -120,4 +120,4 @@ public function test() {
 Deprecated: Callables of the form ["P", "O::who"] are deprecated in %s on line %d
 O
 $this|B::who
-call_user_func(): Argument #1 ($callback) must be a valid callback, class P is not a subclass of B
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class P is not a subclass of B
diff --git a/ext/standard/tests/general_functions/callbacks_002.phpt b/ext/standard/tests/general_functions/callbacks_002.phpt
index 11d8d9a690e..43ad00bf922 100644
--- a/ext/standard/tests/general_functions/callbacks_002.phpt
+++ b/ext/standard/tests/general_functions/callbacks_002.phpt
@@ -5,22 +5,22 @@

 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(NULL, 'bar'));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     call_user_func(array('stdclass', NULL));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-call_user_func(): Argument #1 ($callback) must be a valid callback, class "Foo" not found
-call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
-call_user_func(): Argument #1 ($callback) must be a valid callback, second array member is not a valid method
+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, first array member is not a valid class name or object
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, second array member is not a valid method
diff --git a/ext/standard/tests/general_functions/dl_null_bytes.phpt b/ext/standard/tests/general_functions/dl_null_bytes.phpt
index 7f251393ba3..3ee035b9294 100644
--- a/ext/standard/tests/general_functions/dl_null_bytes.phpt
+++ b/ext/standard/tests/general_functions/dl_null_bytes.phpt
@@ -5,10 +5,10 @@

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

 ?>
 --EXPECT--
-dl(): Argument #1 ($extension_filename) must not contain any null bytes
+ValueError: dl(): Argument #1 ($extension_filename) must not contain any null bytes
diff --git a/ext/standard/tests/general_functions/error_get_last.phpt b/ext/standard/tests/general_functions/error_get_last.phpt
index 1e7516970ef..478c52e4fa5 100644
--- a/ext/standard/tests/general_functions/error_get_last.phpt
+++ b/ext/standard/tests/general_functions/error_get_last.phpt
@@ -6,8 +6,8 @@
 var_dump(error_get_last());
 try {
     var_dump(error_get_last(true));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(error_get_last());

@@ -19,7 +19,7 @@
 ?>
 --EXPECTF--
 NULL
-error_get_last() expects exactly 0 arguments, 1 given
+ArgumentCountError: error_get_last() expects exactly 0 arguments, 1 given
 NULL

 Warning: Undefined variable $b in %s on line %d
diff --git a/ext/standard/tests/general_functions/gettype_settype_basic.phpt b/ext/standard/tests/general_functions/gettype_settype_basic.phpt
index a5e1a0b5bf3..3f6c5ca3c3f 100644
--- a/ext/standard/tests/general_functions/gettype_settype_basic.phpt
+++ b/ext/standard/tests/general_functions/gettype_settype_basic.phpt
@@ -96,8 +96,8 @@ function __toString() {

         // check the new type
         var_dump( gettype($var) );
-     } catch (ValueError $exception) {
-         echo $exception->getMessage() . "\n";
+     } catch (Throwable $exception) {
+         echo $exception::class, ': ', $exception->getMessage(), "\n";
      }
   }
 }
@@ -537,33 +537,33 @@ function __toString() {

 -- Setting type of data to resource --
 -- Iteration 1 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 2 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 3 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 4 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 5 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 6 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 7 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 8 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 9 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 10 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 11 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 12 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 13 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
 -- Iteration 14 --
-Cannot convert to resource type
+ValueError: Cannot convert to resource type

 -- Setting type of data to array --
 -- Iteration 1 --
diff --git a/ext/standard/tests/general_functions/gettype_settype_error.phpt b/ext/standard/tests/general_functions/gettype_settype_error.phpt
index a495ff6c291..b0271ac47fc 100644
--- a/ext/standard/tests/general_functions/gettype_settype_error.phpt
+++ b/ext/standard/tests/general_functions/gettype_settype_error.phpt
@@ -11,8 +11,8 @@
 // passing an invalid type to set
 try {
     settype( $var, "unknown" );
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "Done\n";
@@ -21,5 +21,5 @@
 **** Testing gettype() and settype() functions ****

 *** Testing settype(): error conditions ***
-settype(): Argument #2 ($type) must be a valid type
+ValueError: settype(): Argument #2 ($type) must be a valid type
 Done
diff --git a/ext/standard/tests/general_functions/gh21058.phpt b/ext/standard/tests/general_functions/gh21058.phpt
index 598625a2017..3140c2f2997 100644
--- a/ext/standard/tests/general_functions/gh21058.phpt
+++ b/ext/standard/tests/general_functions/gh21058.phpt
@@ -5,9 +5,9 @@

 try {
 	error_log("test", 3, null);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Path must not be empty
+ValueError: Path must not be empty
diff --git a/ext/standard/tests/general_functions/gh9905.phpt b/ext/standard/tests/general_functions/gh9905.phpt
index 33d2f4f7370..5a590bc888b 100644
--- a/ext/standard/tests/general_functions/gh9905.phpt
+++ b/ext/standard/tests/general_functions/gh9905.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     \constant("\NonExistantClass::non_existant_constant");
-} catch (\Throwable|\Error|\Exception $e) {
-    echo($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Class "NonExistantClass" not found
+Error: Class "NonExistantClass" not found
diff --git a/ext/standard/tests/general_functions/ini_set_types.phpt b/ext/standard/tests/general_functions/ini_set_types.phpt
index 16def381db8..0c6466c4a5f 100644
--- a/ext/standard/tests/general_functions/ini_set_types.phpt
+++ b/ext/standard/tests/general_functions/ini_set_types.phpt
@@ -20,8 +20,8 @@

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

 ?>
@@ -31,4 +31,4 @@
 string(0) ""
 string(1) "6"
 string(4) "3.14"
-ini_set(): Argument #2 ($value) must be of type string|int|float|bool|null
+TypeError: ini_set(): Argument #2 ($value) must be of type string|int|float|bool|null
diff --git a/ext/standard/tests/general_functions/is_countable_with_variables.phpt b/ext/standard/tests/general_functions/is_countable_with_variables.phpt
index e2711a8c54d..19caf64ea2f 100644
--- a/ext/standard/tests/general_functions/is_countable_with_variables.phpt
+++ b/ext/standard/tests/general_functions/is_countable_with_variables.phpt
@@ -18,8 +18,8 @@
 if (!is_countable($bar)) {
     try {
         count($bar);
-    } catch (\TypeError $e) {
-        echo $e->getMessage() . \PHP_EOL;
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 ?>
@@ -28,4 +28,4 @@
 bool(true)
 bool(false)
 int(2)
-count(): Argument #1 ($value) must be of type Countable|array, null given
+TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given
diff --git a/ext/standard/tests/general_functions/proc_open_array.phpt b/ext/standard/tests/general_functions/proc_open_array.phpt
index a76f1111ef2..6a970ea7554 100644
--- a/ext/standard/tests/general_functions/proc_open_array.phpt
+++ b/ext/standard/tests/general_functions/proc_open_array.phpt
@@ -13,29 +13,29 @@
 echo "Empty command array:\n";
 try {
     proc_open([], $ds, $pipes);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\nNul byte in program name:\n";
 try {
     proc_open(["php\0oops"], $ds, $pipes);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\nNul byte in argument:\n";
 try {
     proc_open(["php", "array\0oops"], $ds, $pipes);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\nEmpty program name:\n";
 try {
      proc_open([""], $ds, $pipes);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\nBasic usage:\n";
@@ -76,16 +76,16 @@
 ?>
 --EXPECT--
 Empty command array:
-proc_open(): Argument #1 ($command) must not be empty
+ValueError: proc_open(): Argument #1 ($command) must not be empty

 Nul byte in program name:
-Command array element 1 contains a null byte
+ValueError: Command array element 1 contains a null byte

 Nul byte in argument:
-Command array element 2 contains a null byte
+ValueError: Command array element 2 contains a null byte

 Empty program name:
-First element must contain a non-empty program name
+ValueError: First element must contain a non-empty program name

 Basic usage:
 Hello World!
diff --git a/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt b/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt
index faa86c82417..967c1f33575 100644
--- a/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt
+++ b/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt
@@ -9,10 +9,10 @@

 try {
     proc_open("does_not_matter", [], $pipes, "foo\0bar");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-proc_open(): Argument #4 ($cwd) must not contain any null bytes
+ValueError: proc_open(): Argument #4 ($cwd) must not contain any null bytes
diff --git a/ext/standard/tests/general_functions/proc_open_pipes3.phpt b/ext/standard/tests/general_functions/proc_open_pipes3.phpt
index 8f065401eb1..5101793eb06 100644
--- a/ext/standard/tests/general_functions/proc_open_pipes3.phpt
+++ b/ext/standard/tests/general_functions/proc_open_pipes3.phpt
@@ -17,8 +17,8 @@
 $spec[$i] = 1;
 try {
     proc_open("$php -n $callee_escaped", $spec, $pipes);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 $spec[$i] = array('pipe', "test");
@@ -33,7 +33,7 @@
 ?>
 --EXPECTF--
 Warning: proc_open(): pi is not a valid descriptor spec/mode in %s on line %d
-proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams
+ValueError: proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams
 array(4) {
   [3]=>
   resource(%d) of type (Unknown)
diff --git a/ext/standard/tests/general_functions/proc_open_redirect.phpt b/ext/standard/tests/general_functions/proc_open_redirect.phpt
index 76940b715d8..a3d185d04f7 100644
--- a/ext/standard/tests/general_functions/proc_open_redirect.phpt
+++ b/ext/standard/tests/general_functions/proc_open_redirect.phpt
@@ -6,20 +6,20 @@
 $php = getenv('TEST_PHP_EXECUTABLE');
 try {
     proc_open([$php], [['redirect']], $pipes);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     proc_open([$php], [['redirect', 'foo']], $pipes);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     proc_open([$php], [['redirect', 42]], $pipes);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\nWith pipe:\n";
@@ -52,8 +52,8 @@

 ?>
 --EXPECTF--
-Missing redirection target
-Redirection target must be of type int, string given
+ValueError: Missing redirection target
+ValueError: Redirection target must be of type int, string given

 Warning: proc_open(): Redirection target 42 not found in %s

diff --git a/ext/standard/tests/general_functions/putenv.phpt b/ext/standard/tests/general_functions/putenv.phpt
index 40799b25790..4a3fd2e6b86 100644
--- a/ext/standard/tests/general_functions/putenv.phpt
+++ b/ext/standard/tests/general_functions/putenv.phpt
@@ -17,14 +17,14 @@

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

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

 echo "Done\n";
@@ -37,6 +37,6 @@
 string(0) ""
 bool(true)
 bool(false)
-putenv(): Argument #1 ($assignment) must have a valid syntax
-putenv(): Argument #1 ($assignment) must have a valid syntax
+ValueError: putenv(): Argument #1 ($assignment) must have a valid syntax
+ValueError: putenv(): Argument #1 ($assignment) must have a valid syntax
 Done
diff --git a/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt b/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt
index 28a34623733..0870a6154d3 100644
--- a/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt
+++ b/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt
@@ -6,8 +6,8 @@
 foreach ([false, true] as $local_only) {
     try {
         getenv("PHP_GETENV_NUL_TEST\0SUFFIX", $local_only);
-    } catch (ValueError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -19,8 +19,8 @@
 ] as $assignment) {
     try {
         putenv($assignment);
-    } catch (ValueError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -28,8 +28,8 @@

 ?>
 --EXPECT--
-getenv(): Argument #1 ($name) must not contain any null bytes
-getenv(): Argument #1 ($name) must not contain any null bytes
-putenv(): Argument #1 ($assignment) must not contain any null bytes
-putenv(): Argument #1 ($assignment) must not contain any null bytes
+ValueError: getenv(): Argument #1 ($name) must not contain any null bytes
+ValueError: getenv(): Argument #1 ($name) must not contain any null bytes
+ValueError: putenv(): Argument #1 ($assignment) must not contain any null bytes
+ValueError: putenv(): Argument #1 ($assignment) must not contain any null bytes
 bool(false)
diff --git a/ext/standard/tests/general_functions/register_tick_function_error.phpt b/ext/standard/tests/general_functions/register_tick_function_error.phpt
index 9eae12c5b69..6b530ad2599 100644
--- a/ext/standard/tests/general_functions/register_tick_function_error.phpt
+++ b/ext/standard/tests/general_functions/register_tick_function_error.phpt
@@ -6,9 +6,9 @@

 try {
     register_tick_function("a");
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-register_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name
+TypeError: register_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name
diff --git a/ext/standard/tests/general_functions/settype_typed_property.phpt b/ext/standard/tests/general_functions/settype_typed_property.phpt
index a206a4ba41b..c8f027ae5db 100644
--- a/ext/standard/tests/general_functions/settype_typed_property.phpt
+++ b/ext/standard/tests/general_functions/settype_typed_property.phpt
@@ -16,13 +16,13 @@ class Test {

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

 ?>
 --EXPECT--
 int(42)
-Cannot assign array to reference held by property Test::$x of type int
+TypeError: Cannot assign array to reference held by property Test::$x of type int
 int(42)
diff --git a/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt b/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt
index 6f0a7b3fa9e..f7a5bc01846 100644
--- a/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt
+++ b/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt
@@ -13,13 +13,13 @@
 foreach (['sleep', 'usleep'] as $function) {
     try {
         $function(4294967296);
-    } catch (ValueError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 ?>
 --EXPECTF--
 int(0)
 usleep(0) ok
-sleep(): Argument #1 ($seconds) must be between 0 and %d
-usleep(): Argument #1 ($microseconds) must be between 0 and 4294967295
+ValueError: sleep(): Argument #1 ($seconds) must be between 0 and %d
+ValueError: usleep(): Argument #1 ($microseconds) must be between 0 and 4294967295
diff --git a/ext/standard/tests/general_functions/type.phpt b/ext/standard/tests/general_functions/type.phpt
index a43640f09eb..51fd42aca44 100644
--- a/ext/standard/tests/general_functions/type.phpt
+++ b/ext/standard/tests/general_functions/type.phpt
@@ -49,8 +49,8 @@ function foo($errno, $errstr, $errfile, $errline) {
     foreach ($array as $var) {
         try {
             var_dump(settype($var, $type));
-        } catch (Error $e) {
-            echo "Error: ", $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
         var_dump($var);
     }
@@ -160,7 +160,7 @@ function foo($errno, $errstr, $errfile, $errline) {
 bool(true)
 bool(true)
 bool(true)
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 array(3) {
   [0]=>
   int(1)
@@ -169,9 +169,9 @@ function foo($errno, $errstr, $errfile, $errline) {
   [2]=>
   int(3)
 }
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 string(14) "another string"
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 array(3) {
   [0]=>
   int(2)
@@ -180,21 +180,21 @@ function foo($errno, $errstr, $errfile, $errline) {
   [2]=>
   int(4)
 }
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 int(1)
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 float(2)
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 NULL
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 bool(false)
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 string(11) "some string"
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 resource(%d) of type (Unknown)
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 resource(%d) of type (stream)
-Error: Cannot convert to resource type
+ValueError: Cannot convert to resource type
 object(stdClass)#%d (0) {
 }
 bool(true)
diff --git a/ext/standard/tests/general_functions/unregister_tick_function_error.phpt b/ext/standard/tests/general_functions/unregister_tick_function_error.phpt
index fd96a4658fa..08e38f75e9c 100644
--- a/ext/standard/tests/general_functions/unregister_tick_function_error.phpt
+++ b/ext/standard/tests/general_functions/unregister_tick_function_error.phpt
@@ -6,9 +6,9 @@

 try {
     unregister_tick_function("a");
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-unregister_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name
+TypeError: unregister_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name
diff --git a/ext/standard/tests/general_functions/var_export_basic2.phpt b/ext/standard/tests/general_functions/var_export_basic2.phpt
index b5895f805da..f9387b5a6af 100644
--- a/ext/standard/tests/general_functions/var_export_basic2.phpt
+++ b/ext/standard/tests/general_functions/var_export_basic2.phpt
@@ -65,4 +65,3 @@
 false
 false
 string(5) "false"
-
diff --git a/ext/standard/tests/general_functions/var_export_basic3.phpt b/ext/standard/tests/general_functions/var_export_basic3.phpt
index 66e87f093ac..51a30a92171 100644
--- a/ext/standard/tests/general_functions/var_export_basic3.phpt
+++ b/ext/standard/tests/general_functions/var_export_basic3.phpt
@@ -164,4 +164,3 @@
 3.4000000000000001E-33
 3.4000000000000001E-33
 string(22) "3.4000000000000001E-33"
-
diff --git a/ext/standard/tests/general_functions/var_export_basic4.phpt b/ext/standard/tests/general_functions/var_export_basic4.phpt
index 4d41d2f38d0..193e5ea10e6 100644
--- a/ext/standard/tests/general_functions/var_export_basic4.phpt
+++ b/ext/standard/tests/general_functions/var_export_basic4.phpt
@@ -135,4 +135,3 @@
 '8'
 '8'
 string(3) "'8'"
-
diff --git a/ext/standard/tests/general_functions/var_export_basic5.phpt b/ext/standard/tests/general_functions/var_export_basic5.phpt
index 4712ba37a90..5b1a137eea9 100644
--- a/ext/standard/tests/general_functions/var_export_basic5.phpt
+++ b/ext/standard/tests/general_functions/var_export_basic5.phpt
@@ -267,4 +267,3 @@
   0 => 'string',
   1 => 'test',
 )"
-
diff --git a/ext/standard/tests/general_functions/var_export_basic7.phpt b/ext/standard/tests/general_functions/var_export_basic7.phpt
index 01ffd5fbe53..8ae60844101 100644
--- a/ext/standard/tests/general_functions/var_export_basic7.phpt
+++ b/ext/standard/tests/general_functions/var_export_basic7.phpt
@@ -48,4 +48,3 @@
 NULL
 NULL
 string(4) "NULL"
-
diff --git a/ext/standard/tests/http/gh15650.phpt b/ext/standard/tests/http/gh15650.phpt
index 69655ce407e..9cea248b667 100644
--- a/ext/standard/tests/http/gh15650.phpt
+++ b/ext/standard/tests/http/gh15650.phpt
@@ -20,13 +20,13 @@ enum E3 {
 try {
     echo http_build_query(['e3' => E3::C]);
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     echo http_build_query(E1::C);
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
diff --git a/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt b/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt
index 980b44e9489..39e6bd29148 100644
--- a/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt
+++ b/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt
@@ -11,7 +11,7 @@
 try {
     [$_POST, $_FILES] = request_parse_body();
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt b/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt
index 521de0805bf..b22d57bccf9 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt
@@ -18,7 +18,7 @@
 try {
     [$_POST, $_FILES] = request_parse_body();
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt b/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt
index 9c4fe6c3cd7..0a6fec7e430 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt
@@ -23,7 +23,7 @@
 try {
     [$_POST, $_FILES] = request_parse_body();
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt b/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt
index 384344e6c17..4747a7da691 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt
@@ -21,7 +21,7 @@
 try {
     [$_POST, $_FILES] = request_parse_body();
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt b/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt
index 77674100303..96fb2a4470e 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt
@@ -22,7 +22,7 @@
 try {
     [$_POST, $_FILES] = request_parse_body();
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt b/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt
index 9656071c765..70403fe6697 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt
@@ -13,7 +13,7 @@
 try {
     [$_POST, $_FILES] = request_parse_body();
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt
index acad79c9e33..0e0efa446e1 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt
@@ -5,14 +5,14 @@

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

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

 ?>
diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt
index b1efa0dbc91..6a081ae3def 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt
@@ -8,7 +8,7 @@
         'upload_max_filesize' => '1GB',
     ]);
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt
index b61416cdf13..3e6debbfcf3 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt
@@ -7,8 +7,8 @@
     request_parse_body(options: [
         'max_input_vars' => [],
     ]);
-} catch (Error $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt
index ad0c2a90623..f8a0ab49b50 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt
@@ -25,7 +25,7 @@
         'max_file_uploads' => 1,
     ]);
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt
index 990102abd85..d52cf1f4c30 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt
@@ -23,7 +23,7 @@
         'max_input_vars' => 1,
     ]);
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt
index e9d8d51b242..8a2065e8f13 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt
@@ -24,7 +24,7 @@
         'max_multipart_body_parts' => 1,
     ]);
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt
index 7a66faa7dba..564277c7e37 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt
@@ -23,7 +23,7 @@
         'post_max_size' => '302',
     ]);
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt
index 981a1d6799d..2e5cd967566 100644
--- a/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt
+++ b/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt
@@ -19,7 +19,7 @@
         'upload_max_filesize' => '128',
     ]);
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/http/request_parse_body/options_array_references.phpt b/ext/standard/tests/http/request_parse_body/options_array_references.phpt
index 6c6c0c15765..19c0d91d9b0 100644
--- a/ext/standard/tests/http/request_parse_body/options_array_references.phpt
+++ b/ext/standard/tests/http/request_parse_body/options_array_references.phpt
@@ -7,8 +7,8 @@
 try {
     request_parse_body($options);
 } catch (Throwable $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Request does not provide a content type
+RequestParseBodyException: Request does not provide a content type
diff --git a/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt b/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt
index 087b11841ca..9eb4f739b03 100644
--- a/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt
+++ b/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt
@@ -13,7 +13,7 @@
 try {
     [$_POST, $_FILES] = request_parse_body();
 } catch (Throwable $e) {
-    echo get_class($e), ': ', $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($_POST, $_FILES);
diff --git a/ext/standard/tests/mail/gh13415.phpt b/ext/standard/tests/mail/gh13415.phpt
index f507259a8e2..6dac8c527b0 100644
--- a/ext/standard/tests/mail/gh13415.phpt
+++ b/ext/standard/tests/mail/gh13415.phpt
@@ -8,28 +8,28 @@
 try {
     mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \nCc: hacker@example.com"]);
 } catch (Throwable $e) {
-    echo $e->getMessage()."\n\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "CR only:\n";
 try {
     mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \rCc: hacker@example.com"]);
 } catch (Throwable $e) {
-    echo $e->getMessage()."\n\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "CRLF:\n";
 try {
     mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \r\nCc: hacker@example.com"]);
 } catch (Throwable $e) {
-    echo $e->getMessage()."\n\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "NULL:\n";
 try {
     mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \0Cc: hacker@example.com"]);
 } catch (Throwable $e) {
-    echo $e->getMessage()."\n\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --CLEAN--
@@ -40,13 +40,10 @@
 ?>
 --EXPECTF--
 LF only:
-Header "Reply-To" contains LF character that is not allowed in the header
-
+ValueError: Header "Reply-To" contains LF character that is not allowed in the header
 CR only:
-Header "Reply-To" contains CR character that is not allowed in the header
-
+ValueError: Header "Reply-To" contains CR character that is not allowed in the header
 CRLF:
-Header "Reply-To" contains CRLF characters that are used as a line separator and are not allowed in the header
-
+ValueError: Header "Reply-To" contains CRLF characters that are used as a line separator and are not allowed in the header
 NULL:
-Header "Reply-To" contains NULL character that is not allowed in the header
+ValueError: Header "Reply-To" contains NULL character that is not allowed in the header
diff --git a/ext/standard/tests/mail/gh7875.phpt b/ext/standard/tests/mail/gh7875.phpt
index 1f8346a0715..e0360feea93 100644
--- a/ext/standard/tests/mail/gh7875.phpt
+++ b/ext/standard/tests/mail/gh7875.phpt
@@ -34,8 +34,8 @@ function exception_error_handler($severity, $message, $file, $line) {
 try {
 	mail('recipient@example.com', 'Subject', 'Body', []);
 	echo 'Not Reached';
-} catch (\Exception $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump(file_exists(__DIR__ . "/gh7875.mail.out"));
 }
 ?>
@@ -46,5 +46,5 @@ function exception_error_handler($severity, $message, $file, $line) {
 @unlink(__DIR__ . "/gh7875.mail.out");
 ?>
 --EXPECTF--
-mail(): Failed to open stream: Permission denied
+ErrorException: mail(): Failed to open stream: Permission denied
 bool(false)
diff --git a/ext/standard/tests/mail/mail_basic7.phpt b/ext/standard/tests/mail/mail_basic7.phpt
index ffc3fd241f0..6663acdfa77 100644
--- a/ext/standard/tests/mail/mail_basic7.phpt
+++ b/ext/standard/tests/mail/mail_basic7.phpt
@@ -43,50 +43,50 @@

 try {
     mail($to, $subject, $message, ['orig-date' => array('foo1')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['from' => array('foo2')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['sender' => array('foo3')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['reply-to' => array('foo4')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['to' => array('foo5')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['bcc' => array('foo6')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['message-id' => array('foo7')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['in-reply-to'=> array('foo8')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\n\n************* TEST ******************\n";
@@ -98,44 +98,44 @@

 try {
     mail($to, $subject, $message, ['foo1' => array('foo2'=>'bar1')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['foo2' => array('foo2', array('foo3'))]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['foo3' => array(123)]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['foo4' => array(123.456)]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['foo5' => array(FALSE)]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['foo6' => array(NULL)]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['foo7' => array(new StdClass)]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\n\n************* TEST ******************\n";
@@ -150,50 +150,50 @@

 try {
     mail($to, $subject, $message, ['*:foo1' => array('bar1')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['foo2:::' => array('bar1')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['foo3()' => array('bar1')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['foo4@' => array('bar1')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ['foo5|' => array('bar1')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ["\0foo6" => array('bar1')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ["foo7\0" => array('bar1')]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     mail($to, $subject, $message, ["foo8" => array()]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 var_dump(mail($to, $subject, $message, ["foo9" => '%&$#!']));
@@ -202,8 +202,8 @@

 try {
     mail($to, $subject, $message, ["foo10" => "abc\0\tdef"]);
-} catch (TypeError|ValueError $exception) {
-    echo get_class($exception) . ": " . $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 ?>
diff --git a/ext/standard/tests/mail/mail_null_bytes.phpt b/ext/standard/tests/mail/mail_null_bytes.phpt
index 2254b7b8fff..3ddaee73b77 100644
--- a/ext/standard/tests/mail/mail_null_bytes.phpt
+++ b/ext/standard/tests/mail/mail_null_bytes.phpt
@@ -5,34 +5,34 @@

 try {
     mail("foo\0bar", "x", "y");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     mail("x", "foo\0bar", "y");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     mail("x", "y", "foo\0bar");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     mail("x", "y", "z", "foo\0bar");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     mail("x", "y", "z", "q", "foo\0bar");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-mail(): Argument #1 ($to) must not contain any null bytes
-mail(): Argument #2 ($subject) must not contain any null bytes
-mail(): Argument #3 ($message) must not contain any null bytes
-mail(): Argument #4 ($additional_headers) must not contain any null bytes
-mail(): Argument #5 ($additional_params) must not contain any null bytes
+ValueError: mail(): Argument #1 ($to) must not contain any null bytes
+ValueError: mail(): Argument #2 ($subject) must not contain any null bytes
+ValueError: mail(): Argument #3 ($message) must not contain any null bytes
+ValueError: mail(): Argument #4 ($additional_headers) must not contain any null bytes
+ValueError: mail(): Argument #5 ($additional_params) must not contain any null bytes
diff --git a/ext/standard/tests/math/base_convert_error.phpt b/ext/standard/tests/math/base_convert_error.phpt
index 3d253606e03..3a0ee83a856 100644
--- a/ext/standard/tests/math/base_convert_error.phpt
+++ b/ext/standard/tests/math/base_convert_error.phpt
@@ -11,24 +11,24 @@ class classA

 try {
     base_convert(1234, 1, 10);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     base_convert(1234, 10, 37);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

 ?>
 --EXPECT--
 *** Testing base_convert() : error conditions ***
-base_convert(): Argument #2 ($from_base) must be between 2 and 36 (inclusive)
-base_convert(): Argument #3 ($to_base) must be between 2 and 36 (inclusive)
-base_convert(): Argument #1 ($num) must be of type string, classA given
+ValueError: base_convert(): Argument #2 ($from_base) must be between 2 and 36 (inclusive)
+ValueError: base_convert(): Argument #3 ($to_base) must be between 2 and 36 (inclusive)
+TypeError: base_convert(): Argument #1 ($num) must be of type string, classA given
diff --git a/ext/standard/tests/math/base_convert_overflow.phpt b/ext/standard/tests/math/base_convert_overflow.phpt
index 0f74bdc76a6..5e32ca25fc6 100644
--- a/ext/standard/tests/math/base_convert_overflow.phpt
+++ b/ext/standard/tests/math/base_convert_overflow.phpt
@@ -7,4 +7,4 @@
 --EXPECTF--

 Notice: Input number is larger than PHP_INT_MAX, precision has been lost in conversion in %s on line %d
-string(18) "2ee03c32ad644bd1e1"
\ No newline at end of file
+string(18) "2ee03c32ad644bd1e1"
diff --git a/ext/standard/tests/math/base_convert_variation1.phpt b/ext/standard/tests/math/base_convert_variation1.phpt
index fd06465ab57..f4b00e9293d 100644
--- a/ext/standard/tests/math/base_convert_variation1.phpt
+++ b/ext/standard/tests/math/base_convert_variation1.phpt
@@ -54,8 +54,8 @@
     echo "\n-- Iteration $iterator --\n";
     try {
         var_dump(base_convert($input, 10, 8));
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
     $iterator++;
 }
@@ -125,7 +125,7 @@
 string(1) "0"

 -- Iteration 17 --
-base_convert(): Argument #1 ($num) must be of type string, array given
+TypeError: base_convert(): Argument #1 ($num) must be of type string, array given

 -- Iteration 18 --

@@ -143,4 +143,4 @@
 string(1) "0"

 -- Iteration 21 --
-base_convert(): Argument #1 ($num) must be of type string, resource given
+TypeError: base_convert(): Argument #1 ($num) must be of type string, resource given
diff --git a/ext/standard/tests/math/bindec_variation1_64bit.phpt b/ext/standard/tests/math/bindec_variation1_64bit.phpt
index 56bbbd35649..25f2ec9c7db 100644
--- a/ext/standard/tests/math/bindec_variation1_64bit.phpt
+++ b/ext/standard/tests/math/bindec_variation1_64bit.phpt
@@ -57,8 +57,8 @@
     echo "\n-- Iteration $iterator --\n";
     try {
         var_dump(bindec($input));
-    } catch (TypeError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     $iterator++;
 };
@@ -127,7 +127,7 @@
 int(0)

 -- Iteration 16 --
-bindec(): Argument #1 ($binary_string) must be of type string, array given
+TypeError: bindec(): Argument #1 ($binary_string) must be of type string, array given

 -- Iteration 17 --

@@ -145,4 +145,4 @@
 int(0)

 -- Iteration 20 --
-bindec(): Argument #1 ($binary_string) must be of type string, resource given
+TypeError: bindec(): Argument #1 ($binary_string) must be of type string, resource given
diff --git a/ext/standard/tests/math/clamp.phpt b/ext/standard/tests/math/clamp.phpt
index beb4c8d5314..aeaadeb8492 100644
--- a/ext/standard/tests/math/clamp.phpt
+++ b/ext/standard/tests/math/clamp.phpt
@@ -22,14 +22,14 @@ function check_clamp_result($value, $min, $max) {
 function check_clamp_exception($value, $min, $max) {
     try {
         var_dump(clamp($value, $min, $max));
-    } catch (ValueError $error) {
-        echo $error->getMessage(), "\n";
+    } catch (Throwable $error) {
+        echo $error::class, ': ', $error->getMessage(), "\n";
     }

     try {
         var_dump(make_clamp_fcc()($value, $min, $max));
-    } catch (ValueError $error) {
-        echo $error->getMessage(), "\n";
+    } catch (Throwable $error) {
+        echo $error::class, ': ', $error->getMessage(), "\n";
     }
 }

@@ -92,13 +92,13 @@ function check_clamp_exception($value, $min, $max) {
 InvalidArgumentException
 RuntimeException
 LogicException
-clamp(): Argument #2 ($min) must not be NAN
-clamp(): Argument #2 ($min) must not be NAN
-clamp(): Argument #3 ($max) must not be NAN
-clamp(): Argument #3 ($max) must not be NAN
-clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
-clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
-clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
-clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
-clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
-clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
+ValueError: clamp(): Argument #2 ($min) must not be NAN
+ValueError: clamp(): Argument #2 ($min) must not be NAN
+ValueError: clamp(): Argument #3 ($max) must not be NAN
+ValueError: clamp(): Argument #3 ($max) must not be NAN
+ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
+ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
+ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
+ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
+ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
+ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
diff --git a/ext/standard/tests/math/decbin_basic.phpt b/ext/standard/tests/math/decbin_basic.phpt
index aaeb58e000a..26e1dd2f1c5 100644
--- a/ext/standard/tests/math/decbin_basic.phpt
+++ b/ext/standard/tests/math/decbin_basic.phpt
@@ -19,8 +19,8 @@
 foreach ($values as $value) {
     try {
        var_dump(decbin($value));
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -43,6 +43,6 @@
 Deprecated: Implicit conversion from float-string "3.9505e3" to int loses precision in %s on line %d
 string(12) "111101101110"
 string(6) "100111"
-decbin(): Argument #1 ($num) must be of type int, string given
+TypeError: decbin(): Argument #1 ($num) must be of type int, string given
 string(1) "1"
 string(1) "0"
diff --git a/ext/standard/tests/math/decbin_basiclong_64bit.phpt b/ext/standard/tests/math/decbin_basiclong_64bit.phpt
index 16fd6b97b80..1740af17031 100644
--- a/ext/standard/tests/math/decbin_basiclong_64bit.phpt
+++ b/ext/standard/tests/math/decbin_basiclong_64bit.phpt
@@ -23,8 +23,8 @@
     echo "--- testing: $longVal ---\n";
     try {
         var_dump(decbin($longVal));
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -55,7 +55,7 @@
 --- testing: 9223372036854775806 ---
 string(63) "111111111111111111111111111111111111111111111111111111111111110"
 --- testing: 9.2233720368548E+18 ---
-decbin(): Argument #1 ($num) must be of type int, float given
+TypeError: decbin(): Argument #1 ($num) must be of type int, float given
 --- testing: -9223372036854775807 ---
 string(64) "1000000000000000000000000000000000000000000000000000000000000001"
 --- testing: -9.2233720368548E+18 ---
diff --git a/ext/standard/tests/math/decbin_variation1_64bit.phpt b/ext/standard/tests/math/decbin_variation1_64bit.phpt
index 0d4e18307ea..46b6e4af9fb 100644
--- a/ext/standard/tests/math/decbin_variation1_64bit.phpt
+++ b/ext/standard/tests/math/decbin_variation1_64bit.phpt
@@ -39,8 +39,8 @@
     echo "\n-- Iteration $iterator --\n";
     try {
         var_dump(decbin($input));
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -61,10 +61,10 @@
 string(64) "1111111111111111111111111111111111111111111111111111011011010111"

 -- Iteration 5 --
-decbin(): Argument #1 ($num) must be of type int, float given
+TypeError: decbin(): Argument #1 ($num) must be of type int, float given

 -- Iteration 6 --
-decbin(): Argument #1 ($num) must be of type int, float given
+TypeError: decbin(): Argument #1 ($num) must be of type int, float given

 -- Iteration 7 --
 string(37) "1110010111110100110010001101000001000"
@@ -82,7 +82,7 @@
 string(1) "0"

 -- Iteration 12 --
-decbin(): Argument #1 ($num) must be of type int, string given
+TypeError: decbin(): Argument #1 ($num) must be of type int, string given

 -- Iteration 13 --
-decbin(): Argument #1 ($num) must be of type int, string given
+TypeError: decbin(): Argument #1 ($num) must be of type int, string given
diff --git a/ext/standard/tests/math/dechex_basic.phpt b/ext/standard/tests/math/dechex_basic.phpt
index 04c1d393e70..61f3b6a8585 100644
--- a/ext/standard/tests/math/dechex_basic.phpt
+++ b/ext/standard/tests/math/dechex_basic.phpt
@@ -19,8 +19,8 @@
 foreach ($values as $value) {
     try {
         var_dump(dechex($value));
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -43,6 +43,6 @@
 Deprecated: Implicit conversion from float-string "3.9505e3" to int loses precision in %s on line %d
 string(3) "f6e"
 string(2) "27"
-dechex(): Argument #1 ($num) must be of type int, string given
+TypeError: dechex(): Argument #1 ($num) must be of type int, string given
 string(1) "1"
 string(1) "0"
diff --git a/ext/standard/tests/math/dechex_basiclong_64bit.phpt b/ext/standard/tests/math/dechex_basiclong_64bit.phpt
index 85051ea4567..19301f38546 100644
--- a/ext/standard/tests/math/dechex_basiclong_64bit.phpt
+++ b/ext/standard/tests/math/dechex_basiclong_64bit.phpt
@@ -23,8 +23,8 @@
     echo "--- testing: $longVal ---\n";
     try {
         var_dump(dechex($longVal));
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -55,7 +55,7 @@
 --- testing: 9223372036854775806 ---
 string(16) "7ffffffffffffffe"
 --- testing: 9.2233720368548E+18 ---
-dechex(): Argument #1 ($num) must be of type int, float given
+TypeError: dechex(): Argument #1 ($num) must be of type int, float given
 --- testing: -9223372036854775807 ---
 string(16) "8000000000000001"
 --- testing: -9.2233720368548E+18 ---
diff --git a/ext/standard/tests/math/dechex_variation1_64bit.phpt b/ext/standard/tests/math/dechex_variation1_64bit.phpt
index bd597b2f996..6f63d31dde5 100644
--- a/ext/standard/tests/math/dechex_variation1_64bit.phpt
+++ b/ext/standard/tests/math/dechex_variation1_64bit.phpt
@@ -39,8 +39,8 @@
     echo "\n-- Iteration $iterator --\n";
     try {
         var_dump(dechex($input));
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -61,10 +61,10 @@
 string(16) "fffffffffffff6d7"

 -- Iteration 5 --
-dechex(): Argument #1 ($num) must be of type int, float given
+TypeError: dechex(): Argument #1 ($num) must be of type int, float given

 -- Iteration 6 --
-dechex(): Argument #1 ($num) must be of type int, float given
+TypeError: dechex(): Argument #1 ($num) must be of type int, float given

 -- Iteration 7 --
 string(10) "1cbe991a08"
@@ -82,7 +82,7 @@
 string(1) "0"

 -- Iteration 12 --
-dechex(): Argument #1 ($num) must be of type int, string given
+TypeError: dechex(): Argument #1 ($num) must be of type int, string given

 -- Iteration 13 --
-dechex(): Argument #1 ($num) must be of type int, string given
+TypeError: dechex(): Argument #1 ($num) must be of type int, string given
diff --git a/ext/standard/tests/math/decoct_basic.phpt b/ext/standard/tests/math/decoct_basic.phpt
index 30d6712bb47..31bfa96a49f 100644
--- a/ext/standard/tests/math/decoct_basic.phpt
+++ b/ext/standard/tests/math/decoct_basic.phpt
@@ -19,8 +19,8 @@
 foreach ($values as $value) {
     try {
        var_dump(decoct($value));
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -43,6 +43,6 @@
 Deprecated: Implicit conversion from float-string "3.9505e3" to int loses precision in %s on line %d
 string(4) "7556"
 string(2) "47"
-decoct(): Argument #1 ($num) must be of type int, string given
+TypeError: decoct(): Argument #1 ($num) must be of type int, string given
 string(1) "1"
 string(1) "0"
diff --git a/ext/standard/tests/math/decoct_basiclong_64bit.phpt b/ext/standard/tests/math/decoct_basiclong_64bit.phpt
index a4e951176cd..d958db52e32 100644
--- a/ext/standard/tests/math/decoct_basiclong_64bit.phpt
+++ b/ext/standard/tests/math/decoct_basiclong_64bit.phpt
@@ -23,8 +23,8 @@
    echo "--- testing: $longVal ---\n";
    try {
       var_dump(decoct($longVal));
-   } catch (TypeError $exception) {
-       echo $exception->getMessage() . "\n";
+   } catch (Throwable $exception) {
+       echo $exception::class, ': ', $exception->getMessage(), "\n";
    }
 }

@@ -55,7 +55,7 @@
 --- testing: 9223372036854775806 ---
 string(21) "777777777777777777776"
 --- testing: 9.2233720368548E+18 ---
-decoct(): Argument #1 ($num) must be of type int, float given
+TypeError: decoct(): Argument #1 ($num) must be of type int, float given
 --- testing: -9223372036854775807 ---
 string(22) "1000000000000000000001"
 --- testing: -9.2233720368548E+18 ---
diff --git a/ext/standard/tests/math/decoct_variation1_64bit.phpt b/ext/standard/tests/math/decoct_variation1_64bit.phpt
index cc4b69f0756..56e468a72ef 100644
--- a/ext/standard/tests/math/decoct_variation1_64bit.phpt
+++ b/ext/standard/tests/math/decoct_variation1_64bit.phpt
@@ -39,8 +39,8 @@
     echo "\n-- Iteration $iterator --\n";
     try {
         var_dump(decoct($input));
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -61,10 +61,10 @@
 string(22) "1777777777777777773327"

 -- Iteration 5 --
-decoct(): Argument #1 ($num) must be of type int, float given
+TypeError: decoct(): Argument #1 ($num) must be of type int, float given

 -- Iteration 6 --
-decoct(): Argument #1 ($num) must be of type int, float given
+TypeError: decoct(): Argument #1 ($num) must be of type int, float given

 -- Iteration 7 --
 string(13) "1627646215010"
@@ -82,7 +82,7 @@
 string(1) "0"

 -- Iteration 12 --
-decoct(): Argument #1 ($num) must be of type int, string given
+TypeError: decoct(): Argument #1 ($num) must be of type int, string given

 -- Iteration 13 --
-decoct(): Argument #1 ($num) must be of type int, string given
+TypeError: decoct(): Argument #1 ($num) must be of type int, string given
diff --git a/ext/standard/tests/math/gh17384.phpt b/ext/standard/tests/math/gh17384.phpt
index eff207a906a..77165bc50e3 100644
--- a/ext/standard/tests/math/gh17384.phpt
+++ b/ext/standard/tests/math/gh17384.phpt
@@ -11,15 +11,15 @@
     foreach ([9876543210, -9876543210] as $decimals) {
         try {
             number_format($number, $decimals);
-        } catch (ValueError $exception) {
-            echo $exception->getMessage(), "\n";
+        } catch (Throwable $exception) {
+            echo $exception::class, ': ', $exception->getMessage(), "\n";
         }
     }
 }

 ?>
 --EXPECT--
-number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647
-number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647
-number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647
-number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647
+ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647
+ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647
+ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647
+ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647
diff --git a/ext/standard/tests/math/hexdec_variation1_64bit.phpt b/ext/standard/tests/math/hexdec_variation1_64bit.phpt
index c892b8049fc..c4c2a716d3f 100644
--- a/ext/standard/tests/math/hexdec_variation1_64bit.phpt
+++ b/ext/standard/tests/math/hexdec_variation1_64bit.phpt
@@ -61,8 +61,8 @@
     echo "\n-- Iteration $iterator --\n";
     try {
         var_dump(hexdec($input));
-    } catch (TypeError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     $iterator++;
 };
@@ -133,7 +133,7 @@
 int(0)

 -- Iteration 18 --
-hexdec(): Argument #1 ($hex_string) must be of type string, array given
+TypeError: hexdec(): Argument #1 ($hex_string) must be of type string, array given

 -- Iteration 19 --

@@ -151,4 +151,4 @@
 int(2748)

 -- Iteration 22 --
-hexdec(): Argument #1 ($hex_string) must be of type string, resource given
+TypeError: hexdec(): Argument #1 ($hex_string) must be of type string, resource given
diff --git a/ext/standard/tests/math/intdiv.phpt b/ext/standard/tests/math/intdiv.phpt
index b441cb0a868..4bc58c573ab 100644
--- a/ext/standard/tests/math/intdiv.phpt
+++ b/ext/standard/tests/math/intdiv.phpt
@@ -11,12 +11,12 @@
 try {
   var_dump(intdiv(PHP_INT_MIN, -1));
 } catch (Throwable $e) {
-  echo "Exception: " . $e->getMessage() . "\n";
+  echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
   var_dump(intdiv(1, 0));
 } catch (Throwable $e) {
-  echo "Exception: " . $e->getMessage() . "\n";
+  echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -27,5 +27,5 @@
 int(1)
 int(1)
 int(1)
-Exception: Division of PHP_INT_MIN by -1 is not an integer
-Exception: Division by zero
+ArithmeticError: Division of PHP_INT_MIN by -1 is not an integer
+DivisionByZeroError: Division by zero
diff --git a/ext/standard/tests/math/log_error.phpt b/ext/standard/tests/math/log_error.phpt
index 4c90c20a205..85e9baba3f2 100644
--- a/ext/standard/tests/math/log_error.phpt
+++ b/ext/standard/tests/math/log_error.phpt
@@ -6,9 +6,9 @@
 <?php
 try {
     log(36, -4);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-log(): Argument #2 ($base) must be greater than 0
+ValueError: log(): Argument #2 ($base) must be greater than 0
diff --git a/ext/standard/tests/math/octdec_variation1.phpt b/ext/standard/tests/math/octdec_variation1.phpt
index c24d2e8e6be..214875b7638 100644
--- a/ext/standard/tests/math/octdec_variation1.phpt
+++ b/ext/standard/tests/math/octdec_variation1.phpt
@@ -57,8 +57,8 @@
     echo "\n-- Iteration $iterator --\n";
     try {
         var_dump(octdec($input));
-    } catch (TypeError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     $iterator++;
 };
@@ -136,7 +136,7 @@
 int(0)

 -- Iteration 18 --
-octdec(): Argument #1 ($octal_string) must be of type string, array given
+TypeError: octdec(): Argument #1 ($octal_string) must be of type string, array given

 -- Iteration 19 --

@@ -154,5 +154,5 @@
 int(0)

 -- Iteration 22 --
-octdec(): Argument #1 ($octal_string) must be of type string, resource given
+TypeError: octdec(): Argument #1 ($octal_string) must be of type string, resource given
 ---Done---
diff --git a/ext/standard/tests/math/pow_basic_64bit.phpt b/ext/standard/tests/math/pow_basic_64bit.phpt
index 7496c2d1b52..83cd9670f34 100644
--- a/ext/standard/tests/math/pow_basic_64bit.phpt
+++ b/ext/standard/tests/math/pow_basic_64bit.phpt
@@ -276,4 +276,3 @@ function safe_to_string(int|float $number): string {
 ..... Exponent = -500 Result = 0
 ..... Exponent = 2147483647 Result = -INF
 ..... Exponent = -2147483648 Result = 0
-
diff --git a/ext/standard/tests/math/pow_variation1_64bit.phpt b/ext/standard/tests/math/pow_variation1_64bit.phpt
index debc8b16d2b..a7c85cbaa57 100644
--- a/ext/standard/tests/math/pow_variation1_64bit.phpt
+++ b/ext/standard/tests/math/pow_variation1_64bit.phpt
@@ -58,8 +58,8 @@ class classA
 foreach ($inputs as $input) {
     try {
         var_dump(pow($input, 3));
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 fclose($fp);
@@ -78,11 +78,11 @@ class classA
 int(0)
 int(1)
 int(0)
-Unsupported operand types: string ** int
-Unsupported operand types: array ** int
-Unsupported operand types: string ** int
+TypeError: Unsupported operand types: string ** int
+TypeError: Unsupported operand types: array ** int
+TypeError: Unsupported operand types: string ** int
 float(1157.625)
 int(8)
 float(0.000250047)
-Unsupported operand types: classA ** int
-Unsupported operand types: resource ** int
+TypeError: Unsupported operand types: classA ** int
+TypeError: Unsupported operand types: resource ** int
diff --git a/ext/standard/tests/math/pow_variation2.phpt b/ext/standard/tests/math/pow_variation2.phpt
index 47a4845faad..5b96e9ca3e4 100644
--- a/ext/standard/tests/math/pow_variation2.phpt
+++ b/ext/standard/tests/math/pow_variation2.phpt
@@ -54,8 +54,8 @@ class classA
 foreach ($inputs as $input) {
     try {
         var_dump(pow(20.3, $input));
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 fclose($fp);
@@ -74,11 +74,11 @@ class classA
 float(1)
 float(20.3)
 float(1)
-Unsupported operand types: float ** string
-Unsupported operand types: float ** array
-Unsupported operand types: float ** string
+TypeError: Unsupported operand types: float ** string
+TypeError: Unsupported operand types: float ** array
+TypeError: Unsupported operand types: float ** string
 float(15532029.564086)
 float(412.09)
 float(1.2088495422866)
-Unsupported operand types: float ** classA
-Unsupported operand types: float ** resource
+TypeError: Unsupported operand types: float ** classA
+TypeError: Unsupported operand types: float ** resource
diff --git a/ext/standard/tests/math/round_valid_rounding_mode.phpt b/ext/standard/tests/math/round_valid_rounding_mode.phpt
index d7e4655a298..009e21cd94f 100644
--- a/ext/standard/tests/math/round_valid_rounding_mode.phpt
+++ b/ext/standard/tests/math/round_valid_rounding_mode.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     var_dump(round(1.5, mode: 1234));
-} catch (ValueError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-round(): Argument #3 ($mode) must be a valid rounding mode (RoundingMode::*)
+ValueError: round(): Argument #3 ($mode) must be a valid rounding mode (RoundingMode::*)
diff --git a/ext/standard/tests/misc/exec_basic1.phpt b/ext/standard/tests/misc/exec_basic1.phpt
index e08d6a93899..5f49eea6403 100644
--- a/ext/standard/tests/misc/exec_basic1.phpt
+++ b/ext/standard/tests/misc/exec_basic1.phpt
@@ -10,21 +10,21 @@
 $cmd = "echo abc\n\0command";
 try {
     var_dump(exec($cmd, $output));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(system($cmd, $output));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(passthru($cmd, $output));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-exec(): Argument #1 ($command) must not contain any null bytes
-system(): Argument #1 ($command) must not contain any null bytes
-passthru(): Argument #1 ($command) must not contain any null bytes
+ValueError: exec(): Argument #1 ($command) must not contain any null bytes
+ValueError: system(): Argument #1 ($command) must not contain any null bytes
+ValueError: passthru(): Argument #1 ($command) must not contain any null bytes
diff --git a/ext/standard/tests/misc/gh14774.phpt b/ext/standard/tests/misc/gh14774.phpt
index 1f9cd921e03..9127782344f 100644
--- a/ext/standard/tests/misc/gh14774.phpt
+++ b/ext/standard/tests/misc/gh14774.phpt
@@ -9,15 +9,15 @@
 foreach([INF, -INF, 10e300, -10e300, NAN, -NAN] as $var) {
 	try {
 		time_sleep_until($var);
-	} catch (\ValueError $e) {
-		echo $e->getMessage() . PHP_EOL;
+	} catch (Throwable $e) {
+		echo $e::class, ': ', $e->getMessage(), "\n";
 	}
 }
 ?>
 --EXPECTF--
-time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
-time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
-time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
-time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
-time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
-time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
+ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
+ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
+ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
+ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
+ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
+ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d
diff --git a/ext/standard/tests/network/bug69523.phpt b/ext/standard/tests/network/bug69523.phpt
index 5552ca2afdf..c0eac16bcf1 100644
--- a/ext/standard/tests/network/bug69523.phpt
+++ b/ext/standard/tests/network/bug69523.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     setcookie('', 'foo');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-setcookie(): Argument #1 ($name) must not be empty
+ValueError: setcookie(): Argument #1 ($name) must not be empty
diff --git a/ext/standard/tests/network/bug69948.phpt b/ext/standard/tests/network/bug69948.phpt
index c2a72aac872..730aeab4770 100644
--- a/ext/standard/tests/network/bug69948.phpt
+++ b/ext/standard/tests/network/bug69948.phpt
@@ -4,19 +4,19 @@
 <?php
 try {
     var_dump(setcookie('foo', 'bar', 0, 'asdf;asdf'));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(setcookie('foo', 'bar', 0, '/', 'foobar; secure'));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 ===DONE===
 --EXPECTHEADERS--
 --EXPECT--
-setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
-setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
 ===DONE===
diff --git a/ext/standard/tests/network/bug79405.phpt b/ext/standard/tests/network/bug79405.phpt
index ca1f7b0f3f2..101a1c9aa12 100644
--- a/ext/standard/tests/network/bug79405.phpt
+++ b/ext/standard/tests/network/bug79405.phpt
@@ -5,15 +5,15 @@
 $host = "localhost\0.example.com";
 try {
 	var_dump(gethostbyname($host));
-} catch(Error $e) {
-	print $e->getMessage()."\n";
+} catch(Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 var_dump(gethostbynamel($host));
-} catch(Error $e) {
-	print $e->getMessage()."\n";
+} catch(Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-gethostbyname(): Argument #1 ($hostname) must not contain any null bytes
-gethostbynamel(): Argument #1 ($hostname) must not contain any null bytes
\ No newline at end of file
+ValueError: gethostbyname(): Argument #1 ($hostname) must not contain any null bytes
+ValueError: gethostbynamel(): Argument #1 ($hostname) must not contain any null bytes
diff --git a/ext/standard/tests/network/dns_check_record_error_conditions.phpt b/ext/standard/tests/network/dns_check_record_error_conditions.phpt
index de33d74bce6..b3364613dc8 100644
--- a/ext/standard/tests/network/dns_check_record_error_conditions.phpt
+++ b/ext/standard/tests/network/dns_check_record_error_conditions.phpt
@@ -4,16 +4,16 @@
 <?php
 try {
     dns_check_record('');
-} catch (\ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 try {
     // A random DNS Mode
     dns_check_record('php.net', 15263480);
-} catch (\ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-dns_check_record(): Argument #1 ($hostname) must not be empty
-dns_check_record(): Argument #2 ($type) must be a valid DNS record type
+ValueError: dns_check_record(): Argument #1 ($hostname) must not be empty
+ValueError: dns_check_record(): Argument #2 ($type) must be a valid DNS record type
diff --git a/ext/standard/tests/network/dns_get_record_error_conditions.phpt b/ext/standard/tests/network/dns_get_record_error_conditions.phpt
index 6506aca4108..c6a380ebdb8 100644
--- a/ext/standard/tests/network/dns_get_record_error_conditions.phpt
+++ b/ext/standard/tests/network/dns_get_record_error_conditions.phpt
@@ -5,27 +5,27 @@
 try {
     // A random DNS Mode
     dns_get_record('php.net', 15263480);
-} catch (\ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 try {
     // DNS Mode 0
     $auth = [];
     $additional = [];
     dns_get_record('php.net', 0, $auth, $additional, true);
-} catch (\ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 try {
     // A random DNS Mode
     $auth = [];
     $additional = [];
     dns_get_record('php.net', 15263480, $auth, $additional, true);
-} catch (\ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-dns_get_record(): Argument #2 ($type) must be a DNS_* constant
-dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true
-dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true
+ValueError: dns_get_record(): Argument #2 ($type) must be a DNS_* constant
+ValueError: dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true
+ValueError: dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true
diff --git a/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt b/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt
index 3d082c8e952..5f835329e33 100644
--- a/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt
+++ b/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt
@@ -6,57 +6,57 @@
 <?php
 try {
     dns_check_record("\0");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     dns_get_mx("\0", $out);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     dns_get_record("\0");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     getprotobyname("\0");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     getservbyname("\0", "tcp");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     getservbyname("x", "tcp\0");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     getservbyport(0, "tcp\0");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     inet_pton("\0");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     ip2long("\0");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-dns_check_record(): Argument #1 ($hostname) must not contain any null bytes
-dns_get_mx(): Argument #1 ($hostname) must not contain any null bytes
-dns_get_record(): Argument #1 ($hostname) must not contain any null bytes
-getprotobyname(): Argument #1 ($protocol) must not contain any null bytes
-getservbyname(): Argument #1 ($service) must not contain any null bytes
-getservbyname(): Argument #2 ($protocol) must not contain any null bytes
-getservbyport(): Argument #2 ($protocol) must not contain any null bytes
-inet_pton(): Argument #1 ($ip) must not contain any null bytes
-ip2long(): Argument #1 ($ip) must not contain any null bytes
+ValueError: dns_check_record(): Argument #1 ($hostname) must not contain any null bytes
+ValueError: dns_get_mx(): Argument #1 ($hostname) must not contain any null bytes
+ValueError: dns_get_record(): Argument #1 ($hostname) must not contain any null bytes
+ValueError: getprotobyname(): Argument #1 ($protocol) must not contain any null bytes
+ValueError: getservbyname(): Argument #1 ($service) must not contain any null bytes
+ValueError: getservbyname(): Argument #2 ($protocol) must not contain any null bytes
+ValueError: getservbyport(): Argument #2 ($protocol) must not contain any null bytes
+ValueError: inet_pton(): Argument #1 ($ip) must not contain any null bytes
+ValueError: ip2long(): Argument #1 ($ip) must not contain any null bytes
diff --git a/ext/standard/tests/network/openlog_null_bytes.phpt b/ext/standard/tests/network/openlog_null_bytes.phpt
index 6d327422781..80cc1301b6b 100644
--- a/ext/standard/tests/network/openlog_null_bytes.phpt
+++ b/ext/standard/tests/network/openlog_null_bytes.phpt
@@ -8,9 +8,9 @@
 <?php
 try {
     openlog("foo\0bar", LOG_NDELAY, LOG_USER);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-openlog(): Argument #1 ($prefix) must not contain any null bytes
+ValueError: openlog(): Argument #1 ($prefix) must not contain any null bytes
diff --git a/ext/standard/tests/network/setcookie_array_option_error.phpt b/ext/standard/tests/network/setcookie_array_option_error.phpt
index 0fb2ae011c3..5cc41497ded 100644
--- a/ext/standard/tests/network/setcookie_array_option_error.phpt
+++ b/ext/standard/tests/network/setcookie_array_option_error.phpt
@@ -10,45 +10,45 @@
 // Unrecognized key and no valid keys
 try {
     setcookie('name', 'value', ['unknown_key' => 'only']);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 // Numeric key and no valid keys
 try {
     setcookie('name2', 'value2', [0 => 'numeric_key']);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 // Unrecognized key
 try {
     setcookie('name3', 'value3', ['path' => '/path/', 'foo' => 'bar']);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 // Invalid path key content
 try {
     setcookie('name', 'value', ['path' => '/;/']);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 // Invalid domain key content
 try {
     setcookie('name', 'value', ['path' => '/path/', 'domain' => 'ba;r']);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 // Partitioned without secure
 try {
     setcookie('name', 'value', ['partitioned' => true]);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // Arguments after options array (will not be set)
 try {
     setcookie('name4', 'value4', [], "path", "domain.tld", true, true);
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 if (PHP_INT_SIZE == 8) {
@@ -67,13 +67,13 @@
 --EXPECTHEADERS--

 --EXPECTF--
-setcookie(): option "unknown_key" is invalid
-setcookie(): option array cannot have numeric keys
-setcookie(): option "foo" is invalid
-setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
-setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
-setcookie(): "partitioned" option cannot be used without "secure" option
-setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array
+ValueError: setcookie(): option "unknown_key" is invalid
+ValueError: setcookie(): option array cannot have numeric keys
+ValueError: setcookie(): option "foo" is invalid
+ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setcookie(): "partitioned" option cannot be used without "secure" option
+ArgumentCountError: setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array
 bool(true)
 array(1) {
   [0]=>
diff --git a/ext/standard/tests/network/setcookie_error.phpt b/ext/standard/tests/network/setcookie_error.phpt
index 90177c714e5..85d126f28ab 100644
--- a/ext/standard/tests/network/setcookie_error.phpt
+++ b/ext/standard/tests/network/setcookie_error.phpt
@@ -9,28 +9,28 @@

 try {
     setcookie('');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     setcookie('invalid=');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     setcookie('name', 'invalid;');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     setcookie('name', 'value', 100, 'invalid;');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     setcookie('name', 'value', 100, 'path', 'invalid;');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 if (PHP_INT_SIZE == 8) {
@@ -50,10 +50,10 @@
 --EXPECTHEADERS--

 --EXPECTF--
-setcookie(): Argument #1 ($name) must not be empty
-setcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
-setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
-setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setcookie(): Argument #1 ($name) must not be empty
+ValueError: setcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
 bool(true)
 array(2) {
   [0]=>
diff --git a/ext/standard/tests/network/setrawcookie_error.phpt b/ext/standard/tests/network/setrawcookie_error.phpt
index 9aae95673df..88fd3ec86af 100644
--- a/ext/standard/tests/network/setrawcookie_error.phpt
+++ b/ext/standard/tests/network/setrawcookie_error.phpt
@@ -9,28 +9,28 @@

 try {
     setrawcookie('');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     setrawcookie('invalid=');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     setrawcookie('name', 'invalid;');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     setrawcookie('name', 'value', 100, 'invalid;');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     setrawcookie('name', 'value', 100, 'path', 'invalid;');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 if (PHP_INT_SIZE == 8) {
@@ -50,11 +50,11 @@
 --EXPECTHEADERS--

 --EXPECTF--
-setrawcookie(): Argument #1 ($name) must not be empty
-setrawcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
-setrawcookie(): Argument #2 ($value) cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
-setrawcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
-setrawcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setrawcookie(): Argument #1 ($name) must not be empty
+ValueError: setrawcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setrawcookie(): Argument #2 ($value) cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setrawcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
+ValueError: setrawcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
 bool(true)
 array(1) {
   [0]=>
diff --git a/ext/standard/tests/password/password_bcrypt_errors.phpt b/ext/standard/tests/password/password_bcrypt_errors.phpt
index 5d823cba021..0bf136da9cc 100644
--- a/ext/standard/tests/password/password_bcrypt_errors.phpt
+++ b/ext/standard/tests/password/password_bcrypt_errors.phpt
@@ -5,23 +5,23 @@
 //-=-=-=-
 try {
     password_hash("foo", PASSWORD_BCRYPT, array("cost" => 3));
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => 32)));
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     var_dump(password_hash("null\0password", PASSWORD_BCRYPT));
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Invalid bcrypt cost parameter specified: 3
-Invalid bcrypt cost parameter specified: 32
-Bcrypt password must not contain null character
+ValueError: Invalid bcrypt cost parameter specified: 3
+ValueError: Invalid bcrypt cost parameter specified: 32
+ValueError: Bcrypt password must not contain null character
diff --git a/ext/standard/tests/poll/gh22759.phpt b/ext/standard/tests/poll/gh22759.phpt
index 3df68c4f131..c1ad108bed8 100644
--- a/ext/standard/tests/poll/gh22759.phpt
+++ b/ext/standard/tests/poll/gh22759.phpt
@@ -25,8 +25,8 @@

 try {
     $second->remove();
-} catch (Io\Poll\InactiveWatcherException $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "done\n";
@@ -34,5 +34,5 @@
 --EXPECT--
 NULL
 bool(false)
-Cannot remove inactive watcher
+Io\Poll\InactiveWatcherException: Cannot remove inactive watcher
 done
diff --git a/ext/standard/tests/poll/poll_clone_not_allowed.phpt b/ext/standard/tests/poll/poll_clone_not_allowed.phpt
index f31c4c2ecd7..00befedb4d0 100644
--- a/ext/standard/tests/poll/poll_clone_not_allowed.phpt
+++ b/ext/standard/tests/poll/poll_clone_not_allowed.phpt
@@ -12,15 +12,15 @@
 foreach ([$ctx, $handle, $watcher] as $obj) {
     try {
         clone $obj;
-    } catch (Error $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 echo "done\n";
 ?>
 --EXPECT--
-Trying to clone an uncloneable object of class Io\Poll\Context
-Trying to clone an uncloneable object of class StreamPollHandle
-Trying to clone an uncloneable object of class Io\Poll\Watcher
+Error: Trying to clone an uncloneable object of class Io\Poll\Context
+Error: Trying to clone an uncloneable object of class StreamPollHandle
+Error: Trying to clone an uncloneable object of class Io\Poll\Watcher
 done
diff --git a/ext/standard/tests/poll/poll_ctx_backend_unix.phpt b/ext/standard/tests/poll/poll_ctx_backend_unix.phpt
index 89f4f3eea10..19e709f5193 100644
--- a/ext/standard/tests/poll/poll_ctx_backend_unix.phpt
+++ b/ext/standard/tests/poll/poll_ctx_backend_unix.phpt
@@ -18,11 +18,11 @@
 var_dump($backend->name);
 try {
     new Io\Poll\Context(Io\Poll\Backend::WSAPoll);
-} catch (\Io\Poll\BackendUnavailableException $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 enum(Io\Poll\Backend::%s)
 string(4) "Poll"
-string(29) "Backend WSAPoll not available"
+Io\Poll\BackendUnavailableException: Backend WSAPoll not available
diff --git a/ext/standard/tests/poll/poll_double_construct.phpt b/ext/standard/tests/poll/poll_double_construct.phpt
index 1fa5b65db38..9378da372cf 100644
--- a/ext/standard/tests/poll/poll_double_construct.phpt
+++ b/ext/standard/tests/poll/poll_double_construct.phpt
@@ -9,20 +9,20 @@
 $handle = new StreamPollHandle($r);
 try {
     $handle->__construct($r);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

 echo "done\n";
 ?>
 --EXPECT--
-StreamPollHandle object is already constructed
-Io\Poll\Context object is already constructed
+Error: StreamPollHandle object is already constructed
+Error: Io\Poll\Context object is already constructed
 done
diff --git a/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt b/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt
index 8753cad7eb8..f1c588379a3 100644
--- a/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt
+++ b/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt
@@ -11,9 +11,9 @@

 try {
     pt_stream_poll_add($poll_ctx, $socket1w, [Io\Poll\Event::Write], "socket2_data");
-} catch (Io\Poll\HandleAlreadyWatchedException $e) {
-    echo "ERROR: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-ERROR: Handle already added
+Io\Poll\HandleAlreadyWatchedException: Handle already added
diff --git a/ext/standard/tests/poll/poll_watcher_outlives_context.phpt b/ext/standard/tests/poll/poll_watcher_outlives_context.phpt
index 2c058d5b896..897f606f1b1 100644
--- a/ext/standard/tests/poll/poll_watcher_outlives_context.phpt
+++ b/ext/standard/tests/poll/poll_watcher_outlives_context.phpt
@@ -16,20 +16,20 @@

 try {
     $watcher->remove();
-} catch (Io\Poll\InactiveWatcherException $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $watcher->modifyEvents([Io\Poll\Event::Write]);
-} catch (Io\Poll\InactiveWatcherException $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "done\n";
 ?>
 --EXPECT--
 bool(false)
-Cannot remove inactive watcher
-Cannot modify inactive watcher
+Io\Poll\InactiveWatcherException: Cannot remove inactive watcher
+Io\Poll\InactiveWatcherException: Cannot modify inactive watcher
 done
diff --git a/ext/standard/tests/serialize/__serialize_002.phpt b/ext/standard/tests/serialize/__serialize_002.phpt
index 72851eed4bc..c72466bab42 100644
--- a/ext/standard/tests/serialize/__serialize_002.phpt
+++ b/ext/standard/tests/serialize/__serialize_002.phpt
@@ -11,10 +11,10 @@ public function __serialize() {

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

 ?>
 --EXPECT--
-Test::__serialize() must return an array
+TypeError: Test::__serialize() must return an array
diff --git a/ext/standard/tests/serialize/__serialize_007.phpt b/ext/standard/tests/serialize/__serialize_007.phpt
index 32cad44dba9..7e20a17c649 100644
--- a/ext/standard/tests/serialize/__serialize_007.phpt
+++ b/ext/standard/tests/serialize/__serialize_007.phpt
@@ -6,10 +6,10 @@
 $payload = 'O:13:"ArrayIterator":2:{i:0;i:0;s:1:"x";R:2;}';
 try {
     var_dump(unserialize($payload));
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Incomplete or ill-typed serialization data
+UnexpectedValueException: Incomplete or ill-typed serialization data
diff --git a/ext/standard/tests/serialize/bug64354_1.phpt b/ext/standard/tests/serialize/bug64354_1.phpt
index 499b66466f0..82ade85ea12 100644
--- a/ext/standard/tests/serialize/bug64354_1.phpt
+++ b/ext/standard/tests/serialize/bug64354_1.phpt
@@ -10,16 +10,16 @@ function($class) {

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

 try {
     var_dump(unserialize('a:2:{i:0;O:1:"A":0:{}i:1;O:1:"A":0:{}}'));
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(6) "Failed"
-string(6) "Failed"
+Exception: Failed
+Exception: Failed
diff --git a/ext/standard/tests/serialize/bug64354_2.phpt b/ext/standard/tests/serialize/bug64354_2.phpt
index 67530513215..ed183ee869a 100644
--- a/ext/standard/tests/serialize/bug64354_2.phpt
+++ b/ext/standard/tests/serialize/bug64354_2.phpt
@@ -16,9 +16,9 @@ function($class) {

 try {
     var_dump(unserialize('a:2:{i:0;O:1:"A":0:{}i:1;O:1:"B":0:{}}'));
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-string(6) "Failed"
+Exception: Failed
diff --git a/ext/standard/tests/serialize/bug64354_3.phpt b/ext/standard/tests/serialize/bug64354_3.phpt
index e3832e653bb..0f6ae36e422 100644
--- a/ext/standard/tests/serialize/bug64354_3.phpt
+++ b/ext/standard/tests/serialize/bug64354_3.phpt
@@ -21,10 +21,10 @@ public function unserialize($data) {

 try {
     serialize($data);
-} catch (Exception $e) {
-    var_dump($e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
-string(6) "Failed"
+Exception: Failed
diff --git a/ext/standard/tests/serialize/bug73341.phpt b/ext/standard/tests/serialize/bug73341.phpt
index 460575c0a06..d9f7bb88637 100644
--- a/ext/standard/tests/serialize/bug73341.phpt
+++ b/ext/standard/tests/serialize/bug73341.phpt
@@ -5,29 +5,29 @@
 try {
 $token = 'a:2:{i:0;O:1:"0":2:{s:1:"0";i:0;s:1:"0";a:1:{i:0;C:11:"ArrayObject":7:{x:i:0;r}';
 $obj = unserialize($token);
-} catch(Exception $e) {
-    echo $e->getMessage()."\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 $token = 'a:2:{i:0;O:1:"0":2:0s:1:"0";i:0;s:1:"0";a:1:{i:0;C:11:"ArrayObject":7:{x:i:0;r}';
 $obj = unserialize($token);
-} catch(Exception $e) {
-    echo $e->getMessage()."\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 $inner = 'x:i:1;O:8:"stdClass":1:{};m:a:0:{}';
 $exploit = 'C:11:"ArrayObject":'.strlen($inner).':{'.$inner.'}';
 unserialize($exploit);
-} catch(Exception $e) {
-    echo $e->getMessage()."\n";
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
-Error at offset 6 of 7 bytes
+UnexpectedValueException: Error at offset 6 of 7 bytes

 Warning: unserialize(): Error at offset 19 of 79 bytes in %s on line %d

 Warning: ArrayObject::unserialize(): Unexpected end of serialized data in %sbug73341.php on line %d
-Error at offset 24 of 34 bytes
+UnexpectedValueException: Error at offset 24 of 34 bytes
diff --git a/ext/standard/tests/serialize/bug81111.phpt b/ext/standard/tests/serialize/bug81111.phpt
index aa5002eaf70..5a004476abb 100644
--- a/ext/standard/tests/serialize/bug81111.phpt
+++ b/ext/standard/tests/serialize/bug81111.phpt
@@ -10,8 +10,8 @@ public function __unserialize($value) { return new self('file'); }

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

 $anon = new class () {
@@ -21,33 +21,33 @@ public function __unserialize($value) { }

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

 try {
     unserialize("O:13:\"MySplFileInfo\":0:{}");
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     unserialize("C:13:\"MySplFileInfo\":0:{}");
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $name = $anon::class;
 try {
     unserialize("O:" . strlen($name) . ":\"" . $name . "\":0:{}");
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
-Serialization of 'MySplFileInfo' is not allowed
-Serialization of 'class@anonymous' is not allowed
-Unserialization of 'MySplFileInfo' is not allowed
-Unserialization of 'MySplFileInfo' is not allowed
+Exception: Serialization of 'MySplFileInfo' is not allowed
+Exception: Serialization of 'class@anonymous' is not allowed
+Exception: Unserialization of 'MySplFileInfo' is not allowed
+Exception: Unserialization of 'MySplFileInfo' is not allowed

 Warning: unserialize(): Error at offset 0 of %d bytes in %s on line %d
diff --git a/ext/standard/tests/serialize/gh15169.phpt b/ext/standard/tests/serialize/gh15169.phpt
index 19c1415b05c..8f1135b7e37 100644
--- a/ext/standard/tests/serialize/gh15169.phpt
+++ b/ext/standard/tests/serialize/gh15169.phpt
@@ -27,8 +27,8 @@ class Node

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

 while ($next = $firstNode->next) {
@@ -37,4 +37,4 @@ class Node

 ?>
 --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/ext/standard/tests/serialize/incomplete_class.phpt b/ext/standard/tests/serialize/incomplete_class.phpt
index 2ead760508c..57f2b413cb6 100644
--- a/ext/standard/tests/serialize/incomplete_class.phpt
+++ b/ext/standard/tests/serialize/incomplete_class.phpt
@@ -9,8 +9,8 @@

 try {
     $o->test = "a";
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($o->test);
 var_dump($o->test2);
@@ -20,7 +20,7 @@
 --EXPECTF--
 object(__PHP_Incomplete_Class)#%d (0) {
 }
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition

 Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
 NULL
diff --git a/ext/standard/tests/serialize/max_depth.phpt b/ext/standard/tests/serialize/max_depth.phpt
index 09418e5c61d..2a26a095d0d 100644
--- a/ext/standard/tests/serialize/max_depth.phpt
+++ b/ext/standard/tests/serialize/max_depth.phpt
@@ -14,14 +14,14 @@ function create_nested_data($depth, $prefix, $suffix, $inner = 'i:0;') {
 echo "Invalid max_depth:\n";
 try {
     unserialize('i:0;', ['max_depth' => 'foo']);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     unserialize('i:0;', ['max_depth' => -1]);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "Array:\n";
@@ -108,8 +108,8 @@ public function unserialize($str) {
 ?>
 --EXPECTF--
 Invalid max_depth:
-unserialize(): Option "max_depth" must be of type int, string given
-unserialize(): Option "max_depth" must be greater than or equal to 0
+TypeError: unserialize(): Option "max_depth" must be of type int, string given
+ValueError: unserialize(): Option "max_depth" must be greater than or equal to 0
 Array:
 bool(true)

diff --git a/ext/standard/tests/serialize/serialization_objects_005.phpt b/ext/standard/tests/serialize/serialization_objects_005.phpt
index e38ead00695..839e2f74f80 100644
--- a/ext/standard/tests/serialize/serialization_objects_005.phpt
+++ b/ext/standard/tests/serialize/serialization_objects_005.phpt
@@ -37,37 +37,37 @@
 try {
     $ref2 = "ref1.original";
     $incomplete->p = &$ref2;
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($incomplete->p);
 $ref2 = "ref1.changed";
 var_dump($incomplete->p);
 try {
     $incomplete->p = "p.changed";
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($ref1);

 var_dump(isset($incomplete->x));
 try {
     $incomplete->x = "x.new";
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(isset($incomplete->x));
 try {
     unset($incomplete->x);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump($incomplete->x);

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

 echo "Done";
@@ -101,25 +101,25 @@

 Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
 NULL
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition

 Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
 NULL

 Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
 NULL
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
 string(9) "p.changed"

 Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
 bool(false)
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition

 Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
 bool(false)
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition

 Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
 NULL
-The script tried to call a method on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: The script tried to call a method on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
 Done
diff --git a/ext/standard/tests/serialize/serialization_objects_010.phpt b/ext/standard/tests/serialize/serialization_objects_010.phpt
index bf980325945..35e5fff0e92 100644
--- a/ext/standard/tests/serialize/serialization_objects_010.phpt
+++ b/ext/standard/tests/serialize/serialization_objects_010.phpt
@@ -13,13 +13,13 @@ public function unserialize($blah) {

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

 echo "Done";
 ?>
 --EXPECTF--
 Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
-C::serialize() must return a string or NULL
+Exception: C::serialize() must return a string or NULL
 Done
diff --git a/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt b/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt
index ef2f575d581..80068715222 100644
--- a/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt
+++ b/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt
@@ -8,10 +8,10 @@
 $str = 'C:16:"SplObjectStorage":25:{x:i:-9223372036854775808;}';
 try {
     var_dump(unserialize($str));
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Error at offset 24 of 25 bytes
+UnexpectedValueException: Error at offset 24 of 25 bytes
diff --git a/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt b/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt
index 0e41ee82a5f..dbfe89c2354 100644
--- a/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt
+++ b/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt
@@ -12,8 +12,8 @@ class Test {
 STR;
 try {
     var_dump(unserialize($s));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $s = <<<'STR'
@@ -23,7 +23,7 @@ class Test {

 ?>
 --EXPECTF--
-Cannot assign stdClass to property Test::$prop of type int
+TypeError: Cannot assign stdClass to property Test::$prop of type int

 Warning: unserialize(): Error at offset 38 of 38 bytes in %s on line %d
 bool(false)
diff --git a/ext/standard/tests/serialize/typed_property_refs.phpt b/ext/standard/tests/serialize/typed_property_refs.phpt
index 9c71d460c2c..e40c33bbafe 100644
--- a/ext/standard/tests/serialize/typed_property_refs.phpt
+++ b/ext/standard/tests/serialize/typed_property_refs.phpt
@@ -34,28 +34,28 @@ class D {

 try {
     var_dump(unserialize('O:1:"A":2:{s:1:"a";N;s:1:"b";R:2;}'));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(unserialize('O:1:"B":2:{s:1:"a";N;s:1:"b";R:2;}'));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(unserialize('O:1:"C":2:{s:1:"a";i:1;s:1:"b";R:2;}'));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(unserialize('O:1:"C":2:{s:1:"b";s:1:"x";s:1:"a";R:2;}'));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(unserialize('O:1:"D":2:{s:1:"a";i:1;s:1:"b";R:2;}'));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -78,8 +78,8 @@ class D {
   ["b"]=>
   &int(1)
 }
-Cannot assign null to property A::$a of type int
-Cannot assign null to property B::$b of type int
-Cannot assign int to property C::$b of type string
-Cannot assign string to property C::$a of type int
-Reference with value of type int held by property D::$a of type int is not compatible with property D::$b of type float
+TypeError: Cannot assign null to property A::$a of type int
+TypeError: Cannot assign null to property B::$b of type int
+TypeError: Cannot assign int to property C::$b of type string
+TypeError: Cannot assign string to property C::$a of type int
+TypeError: Reference with value of type int held by property D::$a of type int is not compatible with property D::$b of type float
diff --git a/ext/standard/tests/serialize/unserialize_abstract_class.phpt b/ext/standard/tests/serialize/unserialize_abstract_class.phpt
index e835e504669..e32d49315b1 100644
--- a/ext/standard/tests/serialize/unserialize_abstract_class.phpt
+++ b/ext/standard/tests/serialize/unserialize_abstract_class.phpt
@@ -6,10 +6,10 @@
 $payload = 'O:23:"RecursiveFilterIterator":0:{}';
 try {
     var_dump(unserialize($payload));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot instantiate abstract class RecursiveFilterIterator
+Error: Cannot instantiate abstract class RecursiveFilterIterator
diff --git a/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt b/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt
index f390c36a78f..cd1404099f4 100644
--- a/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt
+++ b/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt
@@ -10,25 +10,25 @@ class foo {

 try {
     unserialize($s, ["allowed_classes" => null]);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     unserialize($s, ["allowed_classes" => 0]);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }


 try {
     unserialize($s, ["allowed_classes" => 1]);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-unserialize(): Option "allowed_classes" must be of type array|bool, null given
-unserialize(): Option "allowed_classes" must be of type array|bool, int given
-unserialize(): Option "allowed_classes" must be of type array|bool, int given
+TypeError: unserialize(): Option "allowed_classes" must be of type array|bool, null given
+TypeError: unserialize(): Option "allowed_classes" must be of type array|bool, int given
+TypeError: unserialize(): Option "allowed_classes" must be of type array|bool, int given
diff --git a/ext/standard/tests/serialize/unserialize_callback_func/non_existing.phpt b/ext/standard/tests/serialize/unserialize_callback_func/non_existing.phpt
index 650ba56330d..7f5964c5c39 100644
--- a/ext/standard/tests/serialize/unserialize_callback_func/non_existing.phpt
+++ b/ext/standard/tests/serialize/unserialize_callback_func/non_existing.phpt
@@ -5,9 +5,9 @@
 ini_set('unserialize_callback_func','Nonexistent');
 try {
     unserialize('O:3:"FOO":0:{}');
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Invalid callback Nonexistent, function "Nonexistent" not found or invalid function name
+Error: Invalid callback Nonexistent, function "Nonexistent" not found or invalid function name
diff --git a/ext/standard/tests/serialize/unserialize_leak.phpt b/ext/standard/tests/serialize/unserialize_leak.phpt
index bbc4bb6faca..d58ebba301f 100644
--- a/ext/standard/tests/serialize/unserialize_leak.phpt
+++ b/ext/standard/tests/serialize/unserialize_leak.phpt
@@ -6,11 +6,11 @@
 $payload = 'C:16:"SplObjectStorage":113:{x:i:2;O:8:"stdClass":1:{},a:2:{s:4:"prev";i:2;s:4:"next";O:8:"stdClass":0:{}};r:7;,R:2;s:4:"next";;r:3;};m:a:0:{}}';
 try {
     var_dump(unserialize($payload));
-} catch (Exception $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
 Warning: SplObjectStorage::unserialize(): Unexpected end of serialized data in %s on line %d
-Error at offset 24 of 113 bytes
+UnexpectedValueException: Error at offset 24 of 113 bytes
diff --git a/ext/standard/tests/setcookie_samesite_validation.phpt b/ext/standard/tests/setcookie_samesite_validation.phpt
index 3827f04fe8d..4dc2be18b6c 100644
--- a/ext/standard/tests/setcookie_samesite_validation.phpt
+++ b/ext/standard/tests/setcookie_samesite_validation.phpt
@@ -21,20 +21,20 @@
 // Invalid values
 try {
     setcookie('test', 'value', ['samesite' => 'Invalid']);
-} catch (ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     setcookie('test', 'value', ['samesite' => "Strict\r\nX-Injected: evil"]);
-} catch (ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     setrawcookie('test', 'value', ['samesite' => 'Invalid']);
-} catch (ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -47,6 +47,6 @@
 bool(true)
 bool(true)
 bool(true)
-setcookie(): "samesite" option must be "Strict", "Lax", "None", or ""
-setcookie(): "samesite" option must be "Strict", "Lax", "None", or ""
-setrawcookie(): "samesite" option must be "Strict", "Lax", "None", or ""
+ValueError: setcookie(): "samesite" option must be "Strict", "Lax", "None", or ""
+ValueError: setcookie(): "samesite" option must be "Strict", "Lax", "None", or ""
+ValueError: setrawcookie(): "samesite" option must be "Strict", "Lax", "None", or ""
diff --git a/ext/standard/tests/streams/bug44712.phpt b/ext/standard/tests/streams/bug44712.phpt
index 04b7e5ce409..94ba0e55e01 100644
--- a/ext/standard/tests/streams/bug44712.phpt
+++ b/ext/standard/tests/streams/bug44712.phpt
@@ -5,9 +5,9 @@
 $ctx = stream_context_get_default();
 try {
     stream_context_set_params($ctx, array("options" => 1));
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Invalid stream/context parameter
+TypeError: Invalid stream/context parameter
diff --git a/ext/standard/tests/streams/bug54623.phpt b/ext/standard/tests/streams/bug54623.phpt
index d7383fcc8f7..c1ca5ee0972 100644
--- a/ext/standard/tests/streams/bug54623.phpt
+++ b/ext/standard/tests/streams/bug54623.phpt
@@ -11,11 +11,11 @@
 fclose($sock2);
 try {
     fwrite($sock, "3");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
 int(%d)
 int(%d)
-fwrite(): Argument #1 ($stream) must be an open stream resource
+TypeError: fwrite(): Argument #1 ($stream) must be an open stream resource
diff --git a/ext/standard/tests/streams/bug61115.phpt b/ext/standard/tests/streams/bug61115.phpt
index 9dfc27a9438..76db1cd7f1d 100644
--- a/ext/standard/tests/streams/bug61115.phpt
+++ b/ext/standard/tests/streams/bug61115.phpt
@@ -9,9 +9,9 @@
 stream_context_set_params($resourceFileTemp, array());
 try {
     preg_replace('', function() {}, $resourceFileTemp);
-} catch (\TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-preg_replace(): Argument #2 ($replacement) must be of type array|string, Closure given
+TypeError: preg_replace(): Argument #2 ($replacement) must be of type array|string, Closure given
diff --git a/ext/standard/tests/streams/bug67626.phpt b/ext/standard/tests/streams/bug67626.phpt
index 54be1b51130..c7e5764977f 100644
--- a/ext/standard/tests/streams/bug67626.phpt
+++ b/ext/standard/tests/streams/bug67626.phpt
@@ -32,16 +32,16 @@ public function stream_write()

 try {
     fread($fp, 42);
-} catch (Exception $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
-echo "\n";
+
 try {
     fwrite($fp, 'foobar');
-} catch (Exception $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-stream_read_exception
-stream_write_exception
+Exception: stream_read_exception
+Exception: stream_write_exception
diff --git a/ext/standard/tests/streams/bug71884.phpt b/ext/standard/tests/streams/bug71884.phpt
index 3c5f841b3d3..32a457d56d9 100644
--- a/ext/standard/tests/streams/bug71884.phpt
+++ b/ext/standard/tests/streams/bug71884.phpt
@@ -6,9 +6,9 @@
 $arr[0]['A']=0;
 try {
     stream_context_get_default($arr);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Options should have the form ["wrappername"]["optionname"] = $value
+ValueError: Options should have the form ["wrappername"]["optionname"] = $value
diff --git a/ext/standard/tests/streams/bug74951.phpt b/ext/standard/tests/streams/bug74951.phpt
index 2668f541fb3..ccb4a05028b 100644
--- a/ext/standard/tests/streams/bug74951.phpt
+++ b/ext/standard/tests/streams/bug74951.phpt
@@ -9,8 +9,8 @@ public function n($_) {}

 try {
 	stream_wrapper_register('e0ploit','Stream00ploiter');
-} catch (\Throwable $e) {
-    echo $e::class, ': ', $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
diff --git a/ext/standard/tests/streams/bug76857.phpt b/ext/standard/tests/streams/bug76857.phpt
index efc549e683a..6f4e10515b1 100644
--- a/ext/standard/tests/streams/bug76857.phpt
+++ b/ext/standard/tests/streams/bug76857.phpt
@@ -17,4 +17,4 @@
 --CLEAN--
 <?php
 @unlink(__DIR__ . '/bug76857_data.txt');
-?>
\ No newline at end of file
+?>
diff --git a/ext/standard/tests/streams/gh14506.phpt b/ext/standard/tests/streams/gh14506.phpt
index 3d82350221d..76d4701160f 100644
--- a/ext/standard/tests/streams/gh14506.phpt
+++ b/ext/standard/tests/streams/gh14506.phpt
@@ -64,14 +64,14 @@ function stream_flush(): bool
 $empty = [];
 try {
     stream_select($streams, $streams,$empty, 0);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 fflush($readStream);
 try {
     fclose($readStream);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -91,5 +91,5 @@ function stream_flush(): bool
 Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s on line %d

 Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s on line %d
-No stream arrays were passed
-fclose(): Argument #1 ($stream) must be an open stream resource
+ValueError: No stream arrays were passed
+TypeError: fclose(): Argument #1 ($stream) must be an open stream resource
diff --git a/ext/standard/tests/streams/gh14780.phpt b/ext/standard/tests/streams/gh14780.phpt
index c0fc4e621a9..188f79faf3a 100644
--- a/ext/standard/tests/streams/gh14780.phpt
+++ b/ext/standard/tests/streams/gh14780.phpt
@@ -10,29 +10,29 @@
 $err = null;
 try {
 	pfsockopen('udp://127.0.0.1', '63844', $code, $err, (PHP_INT_MAX/100000)+1);
-} catch (\ValueError $e) {
-	echo $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pfsockopen('udp://127.0.0.1', '63844', $code, $err, (PHP_INT_MIN/100000)-1);
-} catch (\ValueError $e) {
-	echo $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(pfsockopen('udp://127.0.0.1', '63844', $code, $err, -1));
 try {
 	pfsockopen('udp://127.0.0.1', '63844', $code, $err, NAN);
-} catch (\ValueError $e) {
-	echo $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pfsockopen('udp://127.0.0.1', '63844', $code, $err, INF);
-} catch (\ValueError $e) {
-	echo $e->getMessage();
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECTF--
-pfsockopen(): Argument #5 ($timeout) must be -1 or between 0 and %s
-pfsockopen(): Argument #5 ($timeout) must be -1 or between 0 and %s
+ValueError: pfsockopen(): Argument #5 ($timeout) must be -1 or between 0 and %s
+ValueError: pfsockopen(): Argument #5 ($timeout) must be -1 or between 0 and %s
 resource(%d) of type (persistent stream)
-pfsockopen(): Argument #5 ($timeout) must be -1 or between 0 and %s
-pfsockopen(): Argument #5 ($timeout) must be -1 or between 0 and %s
+ValueError: pfsockopen(): Argument #5 ($timeout) must be -1 or between 0 and %s
+ValueError: pfsockopen(): Argument #5 ($timeout) must be -1 or between 0 and %s
diff --git a/ext/standard/tests/streams/gh15908.phpt b/ext/standard/tests/streams/gh15908.phpt
index 31714b20530..38c01727b79 100644
--- a/ext/standard/tests/streams/gh15908.phpt
+++ b/ext/standard/tests/streams/gh15908.phpt
@@ -26,8 +26,8 @@ function stream_eof() {
 $f = fopen("test://", "r");
 try {
     file_put_contents(__DIR__."/gh15908.tmp", $f, FILE_USE_INCLUDE_PATH, $f);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --CLEAN--
@@ -35,4 +35,4 @@ function stream_eof() {
 @unlink(__DIR__."/gh15908.tmp");
 ?>
 --EXPECT--
-file_put_contents(): supplied resource is not a valid Stream-Context resource
+TypeError: file_put_contents(): supplied resource is not a valid Stream-Context resource
diff --git a/ext/standard/tests/streams/non_finite_values.phpt b/ext/standard/tests/streams/non_finite_values.phpt
index 5dba0d3b482..76a66878a4a 100644
--- a/ext/standard/tests/streams/non_finite_values.phpt
+++ b/ext/standard/tests/streams/non_finite_values.phpt
@@ -6,8 +6,8 @@
 foreach ([NAN, -NAN, INF, -INF] as $value) {
     try {
         stream_socket_accept($socket, $value);
-    } catch (ValueError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 fclose($socket);
@@ -15,17 +15,17 @@
 foreach ([NAN, -NAN, INF, -INF] as $value) {
     try {
         stream_socket_client("tcp://0.0.0.0:14781", timeout: $value);
-    } catch (ValueError $e) {
-        echo $e->getMessage(), "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 ?>
 --EXPECT--
-stream_socket_accept(): Argument #2 ($timeout) must be a finite value
-stream_socket_accept(): Argument #2 ($timeout) must be a finite value
-stream_socket_accept(): Argument #2 ($timeout) must be a finite value
-stream_socket_accept(): Argument #2 ($timeout) must be a finite value
-stream_socket_client(): Argument #4 ($timeout) must be a finite value
-stream_socket_client(): Argument #4 ($timeout) must be a finite value
-stream_socket_client(): Argument #4 ($timeout) must be a finite value
-stream_socket_client(): Argument #4 ($timeout) must be a finite value
+ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value
+ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value
+ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value
+ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value
+ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value
+ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value
+ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value
+ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value
diff --git a/ext/standard/tests/streams/stream_context_create_error.phpt b/ext/standard/tests/streams/stream_context_create_error.phpt
index 0789fa34869..871f9dd10b0 100644
--- a/ext/standard/tests/streams/stream_context_create_error.phpt
+++ b/ext/standard/tests/streams/stream_context_create_error.phpt
@@ -4,23 +4,23 @@
 <?php
 try {
     stream_context_create(['ssl' => "abc"]);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => ['ssl' => "abc"]]);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => false]);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Options should have the form ["wrappername"]["optionname"] = $value
-Options should have the form ["wrappername"]["optionname"] = $value
-Invalid stream/context parameter
+ValueError: Options should have the form ["wrappername"]["optionname"] = $value
+ValueError: Options should have the form ["wrappername"]["optionname"] = $value
+TypeError: Invalid stream/context parameter
diff --git a/ext/standard/tests/streams/stream_context_set_option_error.phpt b/ext/standard/tests/streams/stream_context_set_option_error.phpt
index e52bb882f66..23f12f7a84c 100644
--- a/ext/standard/tests/streams/stream_context_set_option_error.phpt
+++ b/ext/standard/tests/streams/stream_context_set_option_error.phpt
@@ -6,30 +6,30 @@
 $ctx = stream_context_create();
 try {
     stream_context_set_option($ctx, [], "x");
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     stream_context_set_option($ctx, [], null, "x");
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     stream_context_set_option($ctx, "x");
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     stream_context_set_option($ctx, "x", "y");
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
-stream_context_set_option(): Argument #3 ($option_name) must be null when argument #2 ($wrapper_or_options) is an array
-stream_context_set_option(): Argument #4 ($value) cannot be provided when argument #2 ($wrapper_or_options) is an array
+ValueError: stream_context_set_option(): Argument #3 ($option_name) must be null when argument #2 ($wrapper_or_options) is an array
+ValueError: stream_context_set_option(): Argument #4 ($value) cannot be provided when argument #2 ($wrapper_or_options) is an array

 Deprecated: Calling stream_context_set_option() with 2 arguments is deprecated, use stream_context_set_options() instead in %s on line %d
-stream_context_set_option(): Argument #3 ($option_name) cannot be null when argument #2 ($wrapper_or_options) is a string
-stream_context_set_option(): Argument #4 ($value) must be provided when argument #2 ($wrapper_or_options) is a string
+ValueError: stream_context_set_option(): Argument #3 ($option_name) cannot be null when argument #2 ($wrapper_or_options) is a string
+ValueError: stream_context_set_option(): Argument #4 ($value) must be provided when argument #2 ($wrapper_or_options) is a string
diff --git a/ext/standard/tests/streams/stream_context_set_options_error.phpt b/ext/standard/tests/streams/stream_context_set_options_error.phpt
index b047e14f133..3fbdb92dec6 100644
--- a/ext/standard/tests/streams/stream_context_set_options_error.phpt
+++ b/ext/standard/tests/streams/stream_context_set_options_error.phpt
@@ -13,9 +13,9 @@

 try {
     stream_context_set_options($process, []);
-} catch (TypeError $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-stream_context_set_options(): Argument #1 ($context) must be a valid stream/context
+TypeError: stream_context_set_options(): Argument #1 ($context) must be a valid stream/context
diff --git a/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt b/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt
index e20e294180c..d25223b34db 100644
--- a/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt
+++ b/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt
@@ -37,4 +37,3 @@
 ?>
 --EXPECTF--
 server-delay:conn-nodelay
-
diff --git a/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt b/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt
index 6f470c61d1a..f4d7b745c64 100644
--- a/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt
+++ b/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt
@@ -11,8 +11,8 @@

 try {
     $stream = fopen('php://nonexistent', 'r', false, $context);
-} catch (StreamException $e) {
-    echo "Caught: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     echo "Code: " . $e->getCode() . "\n";

     $errors = $e->getErrors();
@@ -25,7 +25,7 @@

 ?>
 --EXPECTF--
-Caught: Failed to open stream: operation failed
+StreamException: Failed to open stream: operation failed
 Code: 21
 Wrapper: PHP
 Error code name: OpenFailed
diff --git a/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt b/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt
index 49c18616dad..ea68cc0c52d 100644
--- a/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt
+++ b/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt
@@ -40,8 +40,8 @@ function stream_test_errors($title, $contextOptions) {
         $write = NULL;
         $except = NULL;
         stream_select($read, $write, $except, 0, 0, $context);
-    } catch (StreamException $e) {
-        echo 'EXCEPTION: ' . $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     $errors = stream_last_errors();
@@ -130,7 +130,7 @@ function stream_test_errors($title, $contextOptions) {
   [1] CastNotSupported: Cannot represent a stream of type user-space as a select()able descriptor

 AUTO EXCEPTION
-EXCEPTION: TestStream::stream_cast is not implemented!
+StreamException: TestStream::stream_cast is not implemented!
 Error details:
 - Message: TestStream::stream_read - read 10 bytes more data than requested (8202 read, 8192 max) - excess data will be lost
 - Code: UserspaceInvalidReturn
diff --git a/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt b/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt
index 46fc0f7fd34..2eab61497b6 100644
--- a/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt
+++ b/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt
@@ -9,10 +9,10 @@
             'error_mode' => StreamErrorMode::Exception,
         ]
     ]);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Stream error handling options cannot be set on the default context
+ValueError: Stream error handling options cannot be set on the default context
diff --git a/ext/standard/tests/streams/stream_get_contents_negative_length.phpt b/ext/standard/tests/streams/stream_get_contents_negative_length.phpt
index a12b98422c3..7930b8f9298 100644
--- a/ext/standard/tests/streams/stream_get_contents_negative_length.phpt
+++ b/ext/standard/tests/streams/stream_get_contents_negative_length.phpt
@@ -9,11 +9,11 @@

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

 ?>
 --EXPECT--
 string(2) "bc"
-stream_get_contents(): Argument #2 ($length) must be greater than or equal to -1
+ValueError: stream_get_contents(): Argument #2 ($length) must be greater than or equal to -1
diff --git a/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt b/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt
index 55bdd1860a4..8a61a9fdd8f 100644
--- a/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt
+++ b/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt
@@ -9,8 +9,8 @@
 fclose($fp);
 try {
     var_dump(stream_get_meta_data($fp));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done";
@@ -19,5 +19,5 @@
 *** Testing stream_get_meta_data() : error conditions ***

 -- Testing stream_get_meta_data() function with closed stream resource --
-stream_get_meta_data(): Argument #1 ($stream) must be an open stream resource
+TypeError: stream_get_meta_data(): Argument #1 ($stream) must be an open stream resource
 Done
diff --git a/ext/standard/tests/streams/stream_read_object_return.phpt b/ext/standard/tests/streams/stream_read_object_return.phpt
index 08555bcc3a9..01733f31fc1 100644
--- a/ext/standard/tests/streams/stream_read_object_return.phpt
+++ b/ext/standard/tests/streams/stream_read_object_return.phpt
@@ -17,9 +17,9 @@ function stream_read() {
 stream_wrapper_register('mystream', MyStream::class);
 try {
     var_dump(file_get_contents('mystream://'));
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
diff --git a/ext/standard/tests/streams/stream_set_chunk_size.phpt b/ext/standard/tests/streams/stream_set_chunk_size.phpt
index 8bb5b46b7f9..4a6749b2de9 100644
--- a/ext/standard/tests/streams/stream_set_chunk_size.phpt
+++ b/ext/standard/tests/streams/stream_set_chunk_size.phpt
@@ -52,13 +52,13 @@ function stream_set_option($option, $arg1, $arg2) {
 echo "\nerror conditions\n";
 try {
     stream_set_chunk_size($f, 0);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 try {
     stream_set_chunk_size($f, -1);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
@@ -90,5 +90,5 @@ function stream_set_option($option, $arg1, $arg2) {
 int(3)

 error conditions
-stream_set_chunk_size(): Argument #2 ($size) must be greater than 0
-stream_set_chunk_size(): Argument #2 ($size) must be greater than 0
+ValueError: stream_set_chunk_size(): Argument #2 ($size) must be greater than 0
+ValueError: stream_set_chunk_size(): Argument #2 ($size) must be greater than 0
diff --git a/ext/standard/tests/streams/stream_set_timeout_error.phpt b/ext/standard/tests/streams/stream_set_timeout_error.phpt
index 5567cb15991..ef0577eb496 100644
--- a/ext/standard/tests/streams/stream_set_timeout_error.phpt
+++ b/ext/standard/tests/streams/stream_set_timeout_error.phpt
@@ -22,8 +22,8 @@
 fclose($client);
 try {
     var_dump( stream_set_timeout($client, $seconds) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Testing stream_set_timeout() function with a stream that does not support timeouts --\n";
@@ -39,7 +39,7 @@
 *** Testing stream_set_timeout() : error conditions ***

 -- Testing stream_set_timeout() function with a closed socket --
-stream_set_timeout(): Argument #1 ($stream) must be an open stream resource
+TypeError: stream_set_timeout(): Argument #1 ($stream) must be an open stream resource

 -- Testing stream_set_timeout() function with a stream that does not support timeouts --
 bool(false)
diff --git a/ext/standard/tests/strings/bug33605.phpt b/ext/standard/tests/strings/bug33605.phpt
index 94b57b20dcd..85ae253ba81 100644
--- a/ext/standard/tests/strings/bug33605.phpt
+++ b/ext/standard/tests/strings/bug33605.phpt
@@ -4,10 +4,10 @@
 <?php
 try {
     substr_compare("aa", "a", -99999999, -1, 0);
-} catch (\ValueError $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-substr_compare(): Argument #4 ($length) must be greater than or equal to 0
+ValueError: substr_compare(): Argument #4 ($length) must be greater than or equal to 0
diff --git a/ext/standard/tests/strings/bug36944.phpt b/ext/standard/tests/strings/bug36944.phpt
index d7756124985..17526e938b1 100644
--- a/ext/standard/tests/strings/bug36944.phpt
+++ b/ext/standard/tests/strings/bug36944.phpt
@@ -5,25 +5,25 @@

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

 try {
     var_dump(strncasecmp("test ", "E", -1));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(strncasecmp("test ", "E", 10));
 var_dump(strncasecmp("test ", "E", 0));

 ?>
 --EXPECTF--
-strncmp(): Argument #3 ($length) must be greater than or equal to 0
+ValueError: strncmp(): Argument #3 ($length) must be greater than or equal to 0
 int(%d)
 int(0)
-strncasecmp(): Argument #3 ($length) must be greater than or equal to 0
+ValueError: strncasecmp(): Argument #3 ($length) must be greater than or equal to 0
 int(%d)
 int(0)
diff --git a/ext/standard/tests/strings/bug40754.phpt b/ext/standard/tests/strings/bug40754.phpt
index 41032a9405f..12ecc5c02e3 100644
--- a/ext/standard/tests/strings/bug40754.phpt
+++ b/ext/standard/tests/strings/bug40754.phpt
@@ -12,62 +12,62 @@

 try {
     var_dump(substr_count("abcde", "abc", $v, $v));
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

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

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

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

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

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

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

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

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

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

 var_dump(strncmp("abcde", "abc", $v));
@@ -80,16 +80,16 @@
 string(6) "abcdex"
 int(0)
 int(0)
-substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-substr_compare(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack)
-strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: substr_compare(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack)
+ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 int(1)
 string(8) "abcdeabc"
 string(0) ""
diff --git a/ext/standard/tests/strings/bug54322.phpt b/ext/standard/tests/strings/bug54322.phpt
index 8f12cd80f7f..69da00906bb 100644
--- a/ext/standard/tests/strings/bug54322.phpt
+++ b/ext/standard/tests/strings/bug54322.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     var_dump(get_html_translation_table(NAN, 0, "UTF-8") > 0);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-get_html_translation_table(): Argument #1 ($table) must be of type int, float given
+TypeError: get_html_translation_table(): Argument #1 ($table) must be of type int, float given
diff --git a/ext/standard/tests/strings/bug67249.phpt b/ext/standard/tests/strings/bug67249.phpt
index a0e0843f4b1..2a68656e871 100644
--- a/ext/standard/tests/strings/bug67249.phpt
+++ b/ext/standard/tests/strings/bug67249.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     var_dump(sprintf("%'", "foo"));
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Missing padding character
+ValueError: Missing padding character
diff --git a/ext/standard/tests/strings/bug69751.phpt b/ext/standard/tests/strings/bug69751.phpt
index 0820142d304..42bed00819e 100644
--- a/ext/standard/tests/strings/bug69751.phpt
+++ b/ext/standard/tests/strings/bug69751.phpt
@@ -5,24 +5,24 @@

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

 try {
     sprintf('%3$s, %2$s %1$s', "a", "b");
-} catch (ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     sprintf('%2147483648$s, %2$s %1$s', "a", "b");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECTF--
-Argument number specifier must not be empty
-4 arguments are required, 3 given
-Argument number specifier must be greater than zero and less than %d
+ValueError: Argument number specifier must not be empty
+ArgumentCountError: 4 arguments are required, 3 given
+ValueError: Argument number specifier must be greater than zero and less than %d
diff --git a/ext/standard/tests/strings/bug78833.phpt b/ext/standard/tests/strings/bug78833.phpt
index 7712e133fac..d5eeb99013e 100644
--- a/ext/standard/tests/strings/bug78833.phpt
+++ b/ext/standard/tests/strings/bug78833.phpt
@@ -4,9 +4,9 @@
 <?php
 try {
     var_dump(pack("E2E2147483647H*", 0x0, 0x0, 0x0));
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-Type E: too few arguments
+ValueError: Type E: too few arguments
diff --git a/ext/standard/tests/strings/chr_error.phpt b/ext/standard/tests/strings/chr_error.phpt
index aee28604d5b..1585acff87a 100644
--- a/ext/standard/tests/strings/chr_error.phpt
+++ b/ext/standard/tests/strings/chr_error.phpt
@@ -8,16 +8,16 @@
 echo "\n-- Testing chr() function with no arguments --\n";
 try {
     var_dump( chr() );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Testing chr() function with more than expected no. of arguments --\n";
 $extra_arg = 10;
 try {
     var_dump( chr(72, $extra_arg) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -25,7 +25,7 @@
 *** Testing chr() : error conditions ***

 -- Testing chr() function with no arguments --
-chr() expects exactly 1 argument, 0 given
+ArgumentCountError: chr() expects exactly 1 argument, 0 given

 -- Testing chr() function with more than expected no. of arguments --
-chr() expects exactly 1 argument, 2 given
+ArgumentCountError: chr() expects exactly 1 argument, 2 given
diff --git a/ext/standard/tests/strings/chunk_split_variation5.phpt b/ext/standard/tests/strings/chunk_split_variation5.phpt
index 8f51c001eec..d4ada8ba14f 100644
--- a/ext/standard/tests/strings/chunk_split_variation5.phpt
+++ b/ext/standard/tests/strings/chunk_split_variation5.phpt
@@ -35,9 +35,9 @@
   try {
     var_dump( chunk_split($str, $values[$count], $ending) );
   } catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
   } catch (\ValueError $e) {
-      echo $e->getMessage() . "\n";
+      echo $e::class, ': ', $e->getMessage(), "\n";
   }
 }

@@ -45,12 +45,12 @@
 --EXPECTF--
 *** Testing chunk_split() : different integer values for 'chunklen' ***
 -- Iteration 0 --
-chunk_split(): Argument #2 ($length) must be greater than 0
+ValueError: chunk_split(): Argument #2 ($length) must be greater than 0
 -- Iteration 1 --
 string(213) "T||h||i||s|| ||c||o||n||t||a||i||n||s||	||a||n||d|| ||s||p||e||c||i||a||l|| ||c||h||a||r|| ||&|| ||n||u||m||b||e||r||s|| ||1||2||3||.||
 ||I||t|| ||a||l||s||o|| ||c||h||e||c||k||s|| ||f||o||r|| ||%0|| ||c||h||a||r||"
 -- Iteration 2 --
-chunk_split(): Argument #2 ($length) must be greater than 0
+ValueError: chunk_split(): Argument #2 ($length) must be greater than 0
 -- Iteration 3 --
 string(73) "This contains	and special char & numbers 123.
 It also checks for %0 char||"
@@ -61,6 +61,6 @@
 string(73) "This contains	and special char & numbers 123.
 It also checks for %0 char||"
 -- Iteration 6 --
-chunk_split(): Argument #2 ($length) must be of type int, float given
+TypeError: chunk_split(): Argument #2 ($length) must be of type int, float given
 -- Iteration 7 --
-chunk_split(): Argument #2 ($length) must be greater than 0
+ValueError: chunk_split(): Argument #2 ($length) must be greater than 0
diff --git a/ext/standard/tests/strings/chunk_split_variation8.phpt b/ext/standard/tests/strings/chunk_split_variation8.phpt
index b0c889494e4..00d58c6b87e 100644
--- a/ext/standard/tests/strings/chunk_split_variation8.phpt
+++ b/ext/standard/tests/strings/chunk_split_variation8.phpt
@@ -43,9 +43,9 @@
   try {
     var_dump( chunk_split($heredoc_str, $values[$count], $ending) );
   } catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
   } catch (\ValueError $e) {
-      echo $e->getMessage() . "\n";
+      echo $e::class, ': ', $e->getMessage(), "\n";
   }
 }

@@ -53,14 +53,14 @@
 --EXPECT--
 *** Testing chunk_split() : different 'chunklen' with heredoc 'str' ***
 -- Iteration 1 --
-chunk_split(): Argument #2 ($length) must be greater than 0
+ValueError: chunk_split(): Argument #2 ($length) must be greater than 0
 -- Iteration 2 --
 string(504) "T:::h:::i:::s:::':::s::: :::h:::e:::r:::e:::d:::o:::c::: :::s:::t:::r:::i:::n:::g::: :::w:::i:::t:::h::: :::	::: :::a:::n:::d::: :::
 ::: :::w:::h:::i:::t:::e::: :::s:::p:::a:::c:::e::: :::c:::h:::a:::r:::.:::
 :::I:::t::: :::h:::a:::s::: :::_:::s:::p:::e:::c:::i:::@:::l::: :::c:::h:::@:::r:::$::: :::2:::2:::2:::2::: :::!:::!:::!:::N:::o:::w::: :::\:::k::: :::a:::s::: :::e:::s:::c:::a:::p:::e::: :::c:::h:::a:::r::: :::t:::o::: :::t:::e:::s:::t:::
 :::c:::h:::u:::n:::k:::_:::s:::p:::l:::i:::t:::(:::):::"
 -- Iteration 3 --
-chunk_split(): Argument #2 ($length) must be greater than 0
+ValueError: chunk_split(): Argument #2 ($length) must be greater than 0
 -- Iteration 4 --
 string(129) "This's heredoc string with 	 and
  white space char.
@@ -77,6 +77,6 @@
 It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test
 chunk_split():::"
 -- Iteration 7 --
-chunk_split(): Argument #2 ($length) must be of type int, float given
+TypeError: chunk_split(): Argument #2 ($length) must be of type int, float given
 -- Iteration 8 --
-chunk_split(): Argument #2 ($length) must be greater than 0
+ValueError: chunk_split(): Argument #2 ($length) must be greater than 0
diff --git a/ext/standard/tests/strings/count_chars_basic.phpt b/ext/standard/tests/strings/count_chars_basic.phpt
index ccf8cd47ac0..8d541b2fb0c 100644
--- a/ext/standard/tests/strings/count_chars_basic.phpt
+++ b/ext/standard/tests/strings/count_chars_basic.phpt
@@ -16,8 +16,8 @@

 try {
     count_chars($string, 5);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -1569,4 +1569,4 @@
 }
 string(18) " Rabcdefghimnorstu"
 string(476) "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f5051535455565758595a5b5c5d5e5f606a6b6c7071767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"
-count_chars(): Argument #2 ($mode) must be between 0 and 4 (inclusive)
+ValueError: count_chars(): Argument #2 ($mode) must be between 0 and 4 (inclusive)
diff --git a/ext/standard/tests/strings/crypt.phpt b/ext/standard/tests/strings/crypt.phpt
index 1d236565553..75e3a62adaf 100644
--- a/ext/standard/tests/strings/crypt.phpt
+++ b/ext/standard/tests/strings/crypt.phpt
@@ -20,8 +20,8 @@

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

 ?>
@@ -30,4 +30,4 @@
 EXT
 MD5
 BLO
-crypt() expects exactly 2 arguments, 1 given
+ArgumentCountError: crypt() expects exactly 2 arguments, 1 given
diff --git a/ext/standard/tests/strings/dirname_error.phpt b/ext/standard/tests/strings/dirname_error.phpt
index 16b0e94939d..2ea670359b0 100644
--- a/ext/standard/tests/strings/dirname_error.phpt
+++ b/ext/standard/tests/strings/dirname_error.phpt
@@ -7,11 +7,11 @@
 // Bad arg
 try {
     dirname("/var/tmp/bar.gz", 0);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 *** Testing error conditions ***
-dirname(): Argument #2 ($levels) must be greater than or equal to 1
+ValueError: dirname(): Argument #2 ($levels) must be greater than or equal to 1
diff --git a/ext/standard/tests/strings/dirname_multi.phpt b/ext/standard/tests/strings/dirname_multi.phpt
index 1c7875ad156..c1e7ad0d8a9 100644
--- a/ext/standard/tests/strings/dirname_multi.phpt
+++ b/ext/standard/tests/strings/dirname_multi.phpt
@@ -10,14 +10,14 @@
 for ($i=0 ; $i<5 ; $i++) {
     try {
         var_dump(dirname("/foo/bar/baz", $i));
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 var_dump(dirname("/foo/bar/baz", PHP_INT_MAX));
 ?>
 --EXPECT--
-dirname(): Argument #2 ($levels) must be greater than or equal to 1
+ValueError: dirname(): Argument #2 ($levels) must be greater than or equal to 1
 string(8) "/foo/bar"
 string(4) "/foo"
 string(1) "/"
diff --git a/ext/standard/tests/strings/explode.phpt b/ext/standard/tests/strings/explode.phpt
index 248fade7605..0d54b9dae14 100644
--- a/ext/standard/tests/strings/explode.phpt
+++ b/ext/standard/tests/strings/explode.phpt
@@ -16,18 +16,18 @@

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

 var_dump(explode("a", ""));
@@ -35,8 +35,8 @@
 var_dump(explode("a", NULL));
 try {
     var_dump(explode(NULL, "a"));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(explode("abc", "acb"));
 var_dump(explode("somestring", "otherstring"));
@@ -62,9 +62,9 @@
   4 => 'd',
 )
 d6bee42a771449205344c0938ad4f035
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
 array(1) {
   [0]=>
   string(0) ""
@@ -79,7 +79,7 @@
   [0]=>
   string(0) ""
 }
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
 array(1) {
   [0]=>
   string(3) "acb"
diff --git a/ext/standard/tests/strings/explode1.phpt b/ext/standard/tests/strings/explode1.phpt
index 022654a5764..2acd74bee09 100644
--- a/ext/standard/tests/strings/explode1.phpt
+++ b/ext/standard/tests/strings/explode1.phpt
@@ -29,23 +29,23 @@

     try {
         var_dump( explode($delimiter, $string, -1) );
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         var_dump( explode($delimiter, $string, 0) );
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         var_dump( explode($delimiter, $string, 1) );
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     try {
         var_dump( explode($delimiter, $string, 2) );
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
     $counter++;
 }
@@ -91,15 +91,15 @@ public function __toString() {
 --EXPECT--
 *** Testing explode() for basic operations ***
 -- Iteration 1 --
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
 -- Iteration 2 --
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
 -- Iteration 3 --
 array(1) {
   [0]=>
@@ -201,10 +201,10 @@ public function __toString() {
   string(56) "234NULL23abcd00000TRUEFALSE-11.234444true-11.24%PHP%ZEND"
 }
 -- Iteration 7 --
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
-explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
 -- Iteration 8 --
 array(2) {
   [0]=>
diff --git a/ext/standard/tests/strings/fprintf_error.phpt b/ext/standard/tests/strings/fprintf_error.phpt
index 39bc3ebff3b..8cc0060bcf9 100644
--- a/ext/standard/tests/strings/fprintf_error.phpt
+++ b/ext/standard/tests/strings/fprintf_error.phpt
@@ -9,29 +9,29 @@
 /* zero argument */
 try {
     var_dump( fprintf() );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 /* scalar argument */
 try {
     var_dump( fprintf(3) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 /* NULL argument */
 try {
     var_dump( fprintf(NULL) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
 ?>
 --EXPECT--
 *** Testing Error Conditions ***
-fprintf() expects at least 2 arguments, 0 given
-fprintf() expects at least 2 arguments, 1 given
-fprintf() expects at least 2 arguments, 1 given
+ArgumentCountError: fprintf() expects at least 2 arguments, 0 given
+ArgumentCountError: fprintf() expects at least 2 arguments, 1 given
+ArgumentCountError: fprintf() expects at least 2 arguments, 1 given
 Done
diff --git a/ext/standard/tests/strings/gh11982.phpt b/ext/standard/tests/strings/gh11982.phpt
index e5e45e7e196..48993697f85 100644
--- a/ext/standard/tests/strings/gh11982.phpt
+++ b/ext/standard/tests/strings/gh11982.phpt
@@ -23,4 +23,3 @@
   [1]=>
   string(1) "a"
 }
-
diff --git a/ext/standard/tests/strings/gh18823_strict.phpt b/ext/standard/tests/strings/gh18823_strict.phpt
index 39ae11ef61b..469cdeb9279 100644
--- a/ext/standard/tests/strings/gh18823_strict.phpt
+++ b/ext/standard/tests/strings/gh18823_strict.phpt
@@ -5,15 +5,15 @@
 declare(strict_types=1);
 try {
     setlocale(LC_ALL, 0, "0");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     setlocale(LC_ALL, "0", 0);
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-setlocale(): Argument #2 ($locales) must be of type array|string|null, int given
-setlocale(): Argument #3 must be of type ?string, int given
+TypeError: setlocale(): Argument #2 ($locales) must be of type array|string|null, int given
+TypeError: setlocale(): Argument #3 must be of type ?string, int given
diff --git a/ext/standard/tests/strings/gh18823_weak.phpt b/ext/standard/tests/strings/gh18823_weak.phpt
index 2a2b82d9aaa..13d70e571f1 100644
--- a/ext/standard/tests/strings/gh18823_weak.phpt
+++ b/ext/standard/tests/strings/gh18823_weak.phpt
@@ -23,9 +23,9 @@ public function __toString(): string {

 try {
     setlocale(LC_ALL, new MyStringableThrow);
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-no
+Error: no
diff --git a/ext/standard/tests/strings/implode_error.phpt b/ext/standard/tests/strings/implode_error.phpt
index 417b3591e0d..762e8bf1ab5 100644
--- a/ext/standard/tests/strings/implode_error.phpt
+++ b/ext/standard/tests/strings/implode_error.phpt
@@ -5,25 +5,25 @@
 /* only glue */
 try {
     var_dump(implode("glue"));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 /* NULL as pieces */
 try {
     var_dump(implode("glue", NULL));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 /* integer as glue */
 try {
     var_dump(implode(12, "pieces"));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given
-implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given
-implode(): Argument #2 ($array) must be of type ?array, string given
+TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given
+TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given
+TypeError: implode(): Argument #2 ($array) must be of type ?array, string given
diff --git a/ext/standard/tests/strings/implode_variation.phpt b/ext/standard/tests/strings/implode_variation.phpt
index 2cc0870f39f..e721447c2eb 100644
--- a/ext/standard/tests/strings/implode_variation.phpt
+++ b/ext/standard/tests/strings/implode_variation.phpt
@@ -49,8 +49,8 @@
   echo "-- Iteration $counter --\n";
   try {
        var_dump(implode($glue, $pieces));
-  } catch (TypeError $exception) {
-      echo $exception->getMessage() . "\n";
+  } catch (Throwable $exception) {
+      echo $exception::class, ': ', $exception->getMessage(), "\n";
   }
   $counter++;
 }
@@ -59,8 +59,8 @@
 echo "\n*** Testing implode() on empty string ***\n";
 try {
     implode("");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 /* checking sub-arrays */
@@ -69,13 +69,13 @@
 var_dump(implode("TEST", $sub_array));
 try {
    var_dump(implode(array(1, 2, 3, 4), $sub_array));
-} catch (TypeError $exception) {
-  echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+  echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 try {
    var_dump(implode(2, $sub_array));
-} catch (TypeError $exception) {
-  echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+  echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\n*** Testing implode() on objects ***\n";
@@ -185,7 +185,7 @@ function __toString() {
 -- Iteration 3 --
 string(27) "20-6391PHP string%0with%0...%0"
 -- Iteration 4 --
-implode(): Argument #1 ($separator) must be of type string, array given
+TypeError: implode(): Argument #1 ($separator) must be of type string, array given
 -- Iteration 5 --
 string(27) "20-6391PHP string%0with%0...%0"
 -- Iteration 6 --
@@ -198,7 +198,7 @@ function __toString() {
 string(43) "2\00\0-639\01\0PHP\0\0\0 \0string%0with%0...%0"

 *** Testing implode() on empty string ***
-implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given
+TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given

 *** Testing implode() on sub-arrays ***

@@ -206,7 +206,7 @@ function __toString() {

 Warning: Array to string conversion in %s on line %d
 string(27) "ArrayTESTArrayTESTPHPTEST50"
-implode(): Argument #1 ($separator) must be of type string, array given
+TypeError: implode(): Argument #1 ($separator) must be of type string, array given

 Warning: Array to string conversion in %s

diff --git a/ext/standard/tests/strings/join_error.phpt b/ext/standard/tests/strings/join_error.phpt
index 0029bcc34b0..1a7ede606b7 100644
--- a/ext/standard/tests/strings/join_error.phpt
+++ b/ext/standard/tests/strings/join_error.phpt
@@ -10,8 +10,8 @@

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

 echo "Done\n";
@@ -20,5 +20,5 @@
 *** Testing join() : error conditions ***

 -- Testing join() with less than expected no. of arguments --
-join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given
+TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given
 Done
diff --git a/ext/standard/tests/strings/join_variation4.phpt b/ext/standard/tests/strings/join_variation4.phpt
index 21774b4bca2..786047b602e 100644
--- a/ext/standard/tests/strings/join_variation4.phpt
+++ b/ext/standard/tests/strings/join_variation4.phpt
@@ -40,8 +40,8 @@
   echo "-- Iteration $counter --\n";
   try {
     var_dump(join($glues[$index], $pieces));
-  } catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+  } catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
   }
   $counter++;
 }
@@ -57,7 +57,7 @@
 -- Iteration 3 --
 string(47) "20-639-1.34441PHP 6999.99999999string%0with%0...%0"
 -- Iteration 4 --
-join(): Argument #1 ($separator) must be of type string, array given
+TypeError: join(): Argument #1 ($separator) must be of type string, array given
 -- Iteration 5 --
 string(47) "20-639-1.34441PHP 6999.99999999string%0with%0...%0"
 -- Iteration 6 --
diff --git a/ext/standard/tests/strings/join_variation5.phpt b/ext/standard/tests/strings/join_variation5.phpt
index 9e5898d8c10..d4d1e4d9f67 100644
--- a/ext/standard/tests/strings/join_variation5.phpt
+++ b/ext/standard/tests/strings/join_variation5.phpt
@@ -15,8 +15,8 @@
 // glue as array & pieces as array containing sub array
 try {
     var_dump(join(array(1, 2, 3, 4), $sub_array));
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 // numeric value as glue, pieces as array containing sub array
@@ -35,7 +35,7 @@

 Warning: Array to string conversion in %s on line %d
 string(27) "ArrayTESTArrayTESTPHPTEST50"
-join(): Argument #1 ($separator) must be of type string, array given
+TypeError: join(): Argument #1 ($separator) must be of type string, array given

 Warning: Array to string conversion in %s on line %d

diff --git a/ext/standard/tests/strings/levenshtein_error_conditions.phpt b/ext/standard/tests/strings/levenshtein_error_conditions.phpt
index 55e144b3b25..d87474a5f13 100644
--- a/ext/standard/tests/strings/levenshtein_error_conditions.phpt
+++ b/ext/standard/tests/strings/levenshtein_error_conditions.phpt
@@ -9,15 +9,15 @@
 var_dump(levenshtein('AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsu', 'A'));
 try {
     var_dump(levenshtein('AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuv', 'A'));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 echo '--- String 2 ---' . \PHP_EOL;
 var_dump(levenshtein('A', 'AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsu'));
 try {
     var_dump(levenshtein('A', 'AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuv'));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // TODO ValueError for negative costs?
diff --git a/ext/standard/tests/strings/md5_file.phpt b/ext/standard/tests/strings/md5_file.phpt
index a6fba9ea038..fb1e2311d38 100644
--- a/ext/standard/tests/strings/md5_file.phpt
+++ b/ext/standard/tests/strings/md5_file.phpt
@@ -31,8 +31,8 @@
 /* No filename */
 try {
     var_dump( md5_file("") );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 /* invalid filename */
 var_dump( md5_file("aZrq16u") );
@@ -64,7 +64,7 @@
 ?>
 --EXPECTF--
 *** Testing for error conditions ***
-Path must not be empty
+ValueError: Path must not be empty

 Warning: md5_file(): Failed to open stream: No such file or directory in %s on line %d
 bool(false)
diff --git a/ext/standard/tests/strings/metaphone.phpt b/ext/standard/tests/strings/metaphone.phpt
index bb2d30adf94..0fc4bb81ce4 100644
--- a/ext/standard/tests/strings/metaphone.phpt
+++ b/ext/standard/tests/strings/metaphone.phpt
@@ -8,8 +8,8 @@

 try {
     var_dump(metaphone("valid phrase", -1));
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(metaphone("valid phrase", 0));
 var_dump(metaphone("valid phrase", 10000));
@@ -35,7 +35,7 @@
 string(0) ""

 Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
-metaphone(): Argument #2 ($max_phonemes) must be greater than or equal to 0
+ValueError: metaphone(): Argument #2 ($max_phonemes) must be greater than or equal to 0

 Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
 string(6) "FLTFRS"
diff --git a/ext/standard/tests/strings/parse_str_null_bytes.phpt b/ext/standard/tests/strings/parse_str_null_bytes.phpt
index fd0d94bb0fc..d5bfd7b4eaa 100644
--- a/ext/standard/tests/strings/parse_str_null_bytes.phpt
+++ b/ext/standard/tests/strings/parse_str_null_bytes.phpt
@@ -5,10 +5,10 @@

 try {
     parse_str("a=1\0&b=2", $result);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-parse_str(): Argument #1 ($string) must not contain any null bytes
+ValueError: parse_str(): Argument #1 ($string) must not contain any null bytes
diff --git a/ext/standard/tests/strings/pathinfo.phpt b/ext/standard/tests/strings/pathinfo.phpt
index 1ff42a66121..78fefaa7e78 100644
--- a/ext/standard/tests/strings/pathinfo.phpt
+++ b/ext/standard/tests/strings/pathinfo.phpt
@@ -17,44 +17,44 @@

 try {
 	pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_DIRNAME);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_BASENAME);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_EXTENSION);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_BASENAME);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
 	pathinfo(__FILE__, PATHINFO_DIRNAME-1);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
 	pathinfo(__FILE__, PATHINFO_ALL+1);
-} catch (\ValueError $e) {
-	echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+	echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "Done\n";
@@ -128,12 +128,12 @@
 string(8) "pathinfo"
 string(3) "php"
 string(%d) "%s%estrings"
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants
-pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants
+ValueError: pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants
 Done
diff --git a/ext/standard/tests/strings/printf_64bit.phpt b/ext/standard/tests/strings/printf_64bit.phpt
index 083b7b2979d..42f5626b081 100644
--- a/ext/standard/tests/strings/printf_64bit.phpt
+++ b/ext/standard/tests/strings/printf_64bit.phpt
@@ -30,8 +30,8 @@
 echo "\n*** Output for zero argument ***\n";
 try {
     printf();
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 /* Number of arguments not matching as specified in format field */
@@ -41,13 +41,13 @@
 $name = "voudras";
 try {
     printf("%d $string %s", $nbr, $name);
-} catch (\ArgumentCountError $e) {
-    print('Error found: '.$e->getMessage());
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }


 /* Scalar argument */
-echo "\n*** Output for scalar argument ***\n";
+echo "*** Output for scalar argument ***\n";
 printf(3);

 /* Float type variations */
@@ -204,11 +204,11 @@
 echo"\n\n*** Output for invalid width(-15) specifier ***\n";
 try {
     printf("%030.-15s", $tempstring);
-} catch (ValueError $e) {
-    echo $e->getMessage();
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

-echo"\n\n*** Output for '%F' as the format parameter ***\n";
+echo "\n*** Output for '%F' as the format parameter ***\n";
 printf("%F",1.23456789e10);

 echo"\n\n*** Output for '%X' as the format parameter ***\n";
@@ -233,10 +233,10 @@
 ?>
 --EXPECTF--
 *** Output for zero argument ***
-printf() expects at least 1 argument, 0 given
+ArgumentCountError: printf() expects at least 1 argument, 0 given

 *** Output for insufficient number of arguments ***
-Error found: 5 arguments are required, 3 given
+ArgumentCountError: 5 arguments are required, 3 given
 *** Output for scalar argument ***
 3

@@ -676,7 +676,7 @@
 12345678900.0000000000%d

 *** Output for invalid width(-15) specifier ***
-Unknown format specifier "-"
+ValueError: Unknown format specifier "-"

 *** Output for '%F' as the format parameter ***
 12345678900.000000
diff --git a/ext/standard/tests/strings/printf_error.phpt b/ext/standard/tests/strings/printf_error.phpt
index 2842f5cea12..75ec02fd898 100644
--- a/ext/standard/tests/strings/printf_error.phpt
+++ b/ext/standard/tests/strings/printf_error.phpt
@@ -8,8 +8,8 @@
 echo "\n-- Testing printf() function with Zero arguments --\n";
 try {
     var_dump( printf() );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Testing printf() function with less than expected no. of arguments --\n";
@@ -22,37 +22,37 @@
 echo "\n-- Call printf with one argument less than expected --\n";
 try {
     var_dump( printf($format1) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( printf($format2,$arg1) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( printf($format3,$arg1,$arg2) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Call printf with two argument less than expected --\n";
 try {
     var_dump( printf($format2) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( printf($format3,$arg1) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Call printf with three argument less than expected --\n";
 try {
     var_dump( printf($format3) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -60,18 +60,18 @@
 *** Testing printf() : error conditions ***

 -- Testing printf() function with Zero arguments --
-printf() expects at least 1 argument, 0 given
+ArgumentCountError: printf() expects at least 1 argument, 0 given

 -- Testing printf() function with less than expected no. of arguments --

 -- Call printf with one argument less than expected --
-2 arguments are required, 1 given
-3 arguments are required, 2 given
-4 arguments are required, 3 given
+ArgumentCountError: 2 arguments are required, 1 given
+ArgumentCountError: 3 arguments are required, 2 given
+ArgumentCountError: 4 arguments are required, 3 given

 -- Call printf with two argument less than expected --
-3 arguments are required, 1 given
-4 arguments are required, 2 given
+ArgumentCountError: 3 arguments are required, 1 given
+ArgumentCountError: 4 arguments are required, 2 given

 -- Call printf with three argument less than expected --
-4 arguments are required, 1 given
+ArgumentCountError: 4 arguments are required, 1 given
diff --git a/ext/standard/tests/strings/setlocale_null_byte.phpt b/ext/standard/tests/strings/setlocale_null_byte.phpt
index 85663b98a71..5fc0d84c082 100644
--- a/ext/standard/tests/strings/setlocale_null_byte.phpt
+++ b/ext/standard/tests/strings/setlocale_null_byte.phpt
@@ -10,38 +10,38 @@ public function __toString(): string {

 try {
     var_dump(setlocale(LC_ALL, "C\0locale"));
-} catch (ValueError $e) {
-    echo $e::class, ": ", $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     var_dump(setlocale(LC_ALL, ["locale\0name", "C"]));
-} catch (ValueError $e) {
-    echo $e::class, ": ", $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     var_dump(@setlocale(LC_ALL, [str_repeat("x", 255), "C\0locale"]));
-} catch (ValueError $e) {
-    echo $e::class, ": ", $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     var_dump(setlocale(LC_ALL, "zz_ZZ.nope", ["C\0locale"]));
-} catch (TypeError $e) {
-    echo $e::class, ": ", $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     var_dump(setlocale(LC_ALL, "zz_ZZ.nope", new NullByteStringable()));
-} catch (ValueError $e) {
-    echo $e::class, ": ", $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     var_dump(setlocale(LC_ALL, [], new NullByteStringable()));
-} catch (ArgumentCountError $e) {
-    echo $e::class, ": ", $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
diff --git a/ext/standard/tests/strings/sha1_file.phpt b/ext/standard/tests/strings/sha1_file.phpt
index 2014eabb98f..7209cea4258 100644
--- a/ext/standard/tests/strings/sha1_file.phpt
+++ b/ext/standard/tests/strings/sha1_file.phpt
@@ -34,8 +34,8 @@
 echo "\n-- No filename --\n";
 try {
     var_dump( sha1_file("") );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- invalid filename --\n";
@@ -47,8 +47,8 @@
 echo "\n-- NULL as filename --\n";
 try {
     var_dump( sha1_file(NULL) );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Hexadecimal Output for Empty file as Argument --\n";
@@ -74,7 +74,7 @@
 *** Testing for error conditions ***

 -- No filename --
-Path must not be empty
+ValueError: Path must not be empty

 -- invalid filename --

@@ -89,7 +89,7 @@
 -- NULL as filename --

 Deprecated: sha1_file(): Passing null to parameter #1 ($filename) of type string is deprecated in %s on line %d
-Path must not be empty
+ValueError: Path must not be empty

 -- Hexadecimal Output for Empty file as Argument --
 string(40) "da39a3ee5e6b4b0d3255bfef95601890afd80709"
diff --git a/ext/standard/tests/strings/sprintf_error.phpt b/ext/standard/tests/strings/sprintf_error.phpt
index bab3fabae31..8f736fd2c6b 100644
--- a/ext/standard/tests/strings/sprintf_error.phpt
+++ b/ext/standard/tests/strings/sprintf_error.phpt
@@ -8,8 +8,8 @@
 echo "\n-- Testing sprintf() function with Zero arguments --\n";
 try {
     var_dump( sprintf() );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\n-- Testing sprintf() function with less than expected no. of arguments --\n";
@@ -22,49 +22,49 @@
 // with one argument less than expected
 try {
     var_dump( sprintf($format1) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( sprintf($format2,$arg1) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( sprintf($format3,$arg1,$arg2) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // with two argument less than expected
 try {
     var_dump( sprintf($format2) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( sprintf($format3,$arg1) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // with three argument less than expected
 try {
     var_dump( sprintf($format3) );
-} catch (\ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

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

 echo "Done";
@@ -73,15 +73,15 @@
 *** Testing sprintf() : error conditions ***

 -- Testing sprintf() function with Zero arguments --
-sprintf() expects at least 1 argument, 0 given
+ArgumentCountError: sprintf() expects at least 1 argument, 0 given

 -- Testing sprintf() function with less than expected no. of arguments --
-2 arguments are required, 1 given
-3 arguments are required, 2 given
-4 arguments are required, 3 given
-3 arguments are required, 1 given
-4 arguments are required, 2 given
-4 arguments are required, 1 given
-101 arguments are required, 1 given
-Missing format specifier at end of string
+ArgumentCountError: 2 arguments are required, 1 given
+ArgumentCountError: 3 arguments are required, 2 given
+ArgumentCountError: 4 arguments are required, 3 given
+ArgumentCountError: 3 arguments are required, 1 given
+ArgumentCountError: 4 arguments are required, 2 given
+ArgumentCountError: 4 arguments are required, 1 given
+ArgumentCountError: 101 arguments are required, 1 given
+ValueError: Missing format specifier at end of string
 Done
diff --git a/ext/standard/tests/strings/sprintf_star.phpt b/ext/standard/tests/strings/sprintf_star.phpt
index 0c8a211e5c4..8e7e0f1b8b1 100644
--- a/ext/standard/tests/strings/sprintf_star.phpt
+++ b/ext/standard/tests/strings/sprintf_star.phpt
@@ -40,38 +40,38 @@

 try {
     printf("%.*G\n", "foo", 1.5);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     printf("%.*G\n", -100, 1.5);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     printf("%.*s\n", -1, "Foo");
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     printf("%*G\n", -1, $f);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     printf("%9999999999999999999999.f\n", $f);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     printf("%.9999999999999999999999f\n", $f);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -104,9 +104,9 @@
      1.235
      1.235

-Precision must be an integer
-Precision must be between -1 and 2147483647
-Precision -1 is only supported for %g, %G, %h and %H
-Width must be between 0 and 2147483647
-Width must be between 0 and 2147483647
-Precision must be between 0 and 2147483647
+ValueError: Precision must be an integer
+ValueError: Precision must be between -1 and 2147483647
+ValueError: Precision -1 is only supported for %g, %G, %h and %H
+ValueError: Width must be between 0 and 2147483647
+ValueError: Width must be between 0 and 2147483647
+ValueError: Precision must be between 0 and 2147483647
diff --git a/ext/standard/tests/strings/sprintf_variation4_64bit.phpt b/ext/standard/tests/strings/sprintf_variation4_64bit.phpt
index 57d9931648a..fb23322f109 100644
--- a/ext/standard/tests/strings/sprintf_variation4_64bit.phpt
+++ b/ext/standard/tests/strings/sprintf_variation4_64bit.phpt
@@ -21,4 +21,3 @@
 --EXPECT--
 string(15) "%u = '43951789'"
 string(27) "%u = '18446744073665599827'"
-
diff --git a/ext/standard/tests/strings/sprintf_variation52.phpt b/ext/standard/tests/strings/sprintf_variation52.phpt
index e7e022a6fae..a31d0996217 100644
--- a/ext/standard/tests/strings/sprintf_variation52.phpt
+++ b/ext/standard/tests/strings/sprintf_variation52.phpt
@@ -20,8 +20,8 @@
 echo"\n-- Testing for invalid width(-15) specifier --\n";
 try {
     var_dump(sprintf("%030.-15s", $tempstring));
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo"\n-- Testing for '%X' as the format parameter --\n";
@@ -50,7 +50,7 @@
 string(65) "12345678900.00000000000000000000000000000000000000000000000000000"

 -- Testing for invalid width(-15) specifier --
-Unknown format specifier "-"
+ValueError: Unknown format specifier "-"

 -- Testing for '%X' as the format parameter --
 string(1) "C"
diff --git a/ext/standard/tests/strings/sprintf_variation54.phpt b/ext/standard/tests/strings/sprintf_variation54.phpt
index e925293ceef..7593f310631 100644
--- a/ext/standard/tests/strings/sprintf_variation54.phpt
+++ b/ext/standard/tests/strings/sprintf_variation54.phpt
@@ -11,8 +11,8 @@
         echo "$format with " . (is_resource($value) ? "resource" : json_encode($value)) . ":\n";
         try {
             echo sprintf("%" . $format, $value), "\n";
-        } catch (Error $e) {
-            echo $e->getMessage(), "\n";
+        } catch (Throwable $e) {
+            echo $e::class, ': ', $e->getMessage(), "\n";
         }
         echo "\n";
     }
@@ -52,7 +52,7 @@
 Resource id #%d

 %s with {}:
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string

 d with null:
 0
diff --git a/ext/standard/tests/strings/sscanf_error.phpt b/ext/standard/tests/strings/sscanf_error.phpt
index e04b5e2cbb6..e3c2e222df5 100644
--- a/ext/standard/tests/strings/sscanf_error.phpt
+++ b/ext/standard/tests/strings/sscanf_error.phpt
@@ -12,12 +12,12 @@

 try {
     sscanf($str, $format, $str1, $str2, $extra_str);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
 *** Testing sscanf() : error conditions ***

 -- Testing sscanf() function with more than expected no. of arguments --
-Variable is not assigned by any conversion specifiers
+ValueError: Variable is not assigned by any conversion specifiers
diff --git a/ext/standard/tests/strings/str_decrement_errors.phpt b/ext/standard/tests/strings/str_decrement_errors.phpt
index 3186d24b81e..69d69c3c41e 100644
--- a/ext/standard/tests/strings/str_decrement_errors.phpt
+++ b/ext/standard/tests/strings/str_decrement_errors.phpt
@@ -30,24 +30,24 @@
 foreach ($strings as $s) {
     try {
         var_dump(str_decrement($s));
-    } catch (ValueError $e) {
-        echo $e->getMessage(), PHP_EOL;
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 ?>
 --EXPECT--
-str_decrement(): Argument #1 ($string) must not be empty
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must not be empty
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
diff --git a/ext/standard/tests/strings/str_decrement_underflow.phpt b/ext/standard/tests/strings/str_decrement_underflow.phpt
index 0521497713a..6c120c3ab3d 100644
--- a/ext/standard/tests/strings/str_decrement_underflow.phpt
+++ b/ext/standard/tests/strings/str_decrement_underflow.phpt
@@ -16,17 +16,17 @@
 foreach ($strings as $s) {
     try {
         var_dump(str_decrement($s));
-    } catch (ValueError $e) {
-        echo $e->getMessage(), PHP_EOL;
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 ?>
 --EXPECT--
-str_decrement(): Argument #1 ($string) must not be empty
-str_decrement(): Argument #1 ($string) "0" is out of decrement range
-str_decrement(): Argument #1 ($string) "a" is out of decrement range
-str_decrement(): Argument #1 ($string) "A" is out of decrement range
-str_decrement(): Argument #1 ($string) "00" is out of decrement range
-str_decrement(): Argument #1 ($string) "0a" is out of decrement range
-str_decrement(): Argument #1 ($string) "0A" is out of decrement range
+ValueError: str_decrement(): Argument #1 ($string) must not be empty
+ValueError: str_decrement(): Argument #1 ($string) "0" is out of decrement range
+ValueError: str_decrement(): Argument #1 ($string) "a" is out of decrement range
+ValueError: str_decrement(): Argument #1 ($string) "A" is out of decrement range
+ValueError: str_decrement(): Argument #1 ($string) "00" is out of decrement range
+ValueError: str_decrement(): Argument #1 ($string) "0a" is out of decrement range
+ValueError: str_decrement(): Argument #1 ($string) "0A" is out of decrement range
diff --git a/ext/standard/tests/strings/str_increment_errors.phpt b/ext/standard/tests/strings/str_increment_errors.phpt
index e06d7e4bba8..ba2174e9592 100644
--- a/ext/standard/tests/strings/str_increment_errors.phpt
+++ b/ext/standard/tests/strings/str_increment_errors.phpt
@@ -30,24 +30,24 @@
 foreach ($strings as $s) {
     try {
         var_dump(str_increment($s));
-    } catch (ValueError $e) {
-        echo $e->getMessage(), PHP_EOL;
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }

 ?>
 --EXPECT--
-str_increment(): Argument #1 ($string) must not be empty
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
-str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must not be empty
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
+ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters
diff --git a/ext/standard/tests/strings/str_pad.phpt b/ext/standard/tests/strings/str_pad.phpt
index c7b11e4ac0c..e5b6030b44c 100644
--- a/ext/standard/tests/strings/str_pad.phpt
+++ b/ext/standard/tests/strings/str_pad.phpt
@@ -66,16 +66,16 @@

 try {
     str_pad($input_string, 12, "");
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 /* bad pad_type - passing an undefined one */

 try {
     str_pad($input_string, $pad_length, "+", 15);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -302,5 +302,5 @@
 #### error conditions ####

 --- empty padding string ---
-str_pad(): Argument #3 ($pad_string) must not be empty
-str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH
+ValueError: str_pad(): Argument #3 ($pad_string) must not be empty
+ValueError: str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH
diff --git a/ext/standard/tests/strings/str_pad_variation1.phpt b/ext/standard/tests/strings/str_pad_variation1.phpt
index cb71e61156f..b0837073d83 100644
--- a/ext/standard/tests/strings/str_pad_variation1.phpt
+++ b/ext/standard/tests/strings/str_pad_variation1.phpt
@@ -20,8 +20,8 @@
 $extra_large_pad_length = PHP_INT_MAX*5;
 try {
     var_dump( str_pad($input, $extra_large_pad_length) );
-} catch (\TypeError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $php_int_max_pad_length = PHP_INT_MAX;
@@ -31,6 +31,6 @@
 ?>
 --EXPECTF--
 *** Testing str_pad() function: with large value for for 'pad_length' argument ***
-str_pad(): Argument #2 ($length) must be of type int, float given
+TypeError: str_pad(): Argument #2 ($length) must be of type int, float given

 Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
diff --git a/ext/standard/tests/strings/str_repeat.phpt b/ext/standard/tests/strings/str_repeat.phpt
index 3351e7f8713..0d5ca207d29 100644
--- a/ext/standard/tests/strings/str_repeat.phpt
+++ b/ext/standard/tests/strings/str_repeat.phpt
@@ -30,8 +30,8 @@
 echo "\n\n*** Testing error conditions ***\n";
 try {
     str_repeat($input[0], -1); // Invalid arg for multiplier
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -100,4 +100,4 @@


 *** Testing error conditions ***
-str_repeat(): Argument #2 ($times) must be greater than or equal to 0
+ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0
diff --git a/ext/standard/tests/strings/str_replace_basic.phpt b/ext/standard/tests/strings/str_replace_basic.phpt
index 4dfbd098efc..3139b594fad 100644
--- a/ext/standard/tests/strings/str_replace_basic.phpt
+++ b/ext/standard/tests/strings/str_replace_basic.phpt
@@ -23,8 +23,8 @@
 $fp_copy = $fp;
 try {
     var_dump( str_replace($fp_copy, $fp_copy, $fp_copy, $fp_copy) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump( $fp_copy );
 fclose($fp);
@@ -40,5 +40,5 @@
 int(1)
 string(0) ""
 int(0)
-str_replace(): Argument #1 ($search) must be of type array|string, resource given
+TypeError: str_replace(): Argument #1 ($search) must be of type array|string, resource given
 resource(%d) of type (stream)
diff --git a/ext/standard/tests/strings/str_replace_variation3.phpt b/ext/standard/tests/strings/str_replace_variation3.phpt
index 07c6ef7da34..71370f437d2 100644
--- a/ext/standard/tests/strings/str_replace_variation3.phpt
+++ b/ext/standard/tests/strings/str_replace_variation3.phpt
@@ -82,8 +82,8 @@ function __toString() {

 try {
     str_replace("a", array("q", "q", "c"), array("aaa"), $count);
-} catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 var_dump(str_replace("a", 1, array("aaa", "bbb"), $count));
@@ -98,13 +98,13 @@ function __toString() {
 $resource2 = opendir( "." );
 try {
     var_dump(str_replace("stream", "FOUND", $resource1, $count));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(str_replace("stream", "FOUND", $resource2, $count));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }


@@ -180,7 +180,7 @@ function __toString() {
   string(3) "ccc"
 }
 int(6)
-str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string
+TypeError: str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string
 array(2) {
   [0]=>
   string(3) "111"
@@ -197,8 +197,8 @@ function __toString() {
 int(1)

 -- Testing Resources --
-str_replace(): Argument #3 ($subject) must be of type array|string, resource given
-str_replace(): Argument #3 ($subject) must be of type array|string, resource given
+TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, resource given
+TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, resource given

 -- Testing a longer and heredoc string --
 string(623) "FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789
diff --git a/ext/standard/tests/strings/str_split_variation6.phpt b/ext/standard/tests/strings/str_split_variation6.phpt
index a8c1bbf1a92..ba77a8fe6f7 100644
--- a/ext/standard/tests/strings/str_split_variation6.phpt
+++ b/ext/standard/tests/strings/str_split_variation6.phpt
@@ -27,15 +27,15 @@

     try {
         var_dump( str_split($str, $values[$count]) );
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 ?>
 --EXPECT--
 *** Testing str_split() : different integer values for 'split_length' ***
 -- Iteration 1 --
-str_split(): Argument #2 ($length) must be greater than 0
+ValueError: str_split(): Argument #2 ($length) must be greater than 0
 -- Iteration 2 --
 array(42) {
   [0]=>
@@ -124,7 +124,7 @@
   string(1) "t"
 }
 -- Iteration 3 --
-str_split(): Argument #2 ($length) must be greater than 0
+ValueError: str_split(): Argument #2 ($length) must be greater than 0
 -- Iteration 4 --
 array(1) {
   [0]=>
@@ -143,4 +143,4 @@
   string(42) "This is a string with 123 & escape char \t"
 }
 -- Iteration 7 --
-str_split(): Argument #2 ($length) must be greater than 0
+ValueError: str_split(): Argument #2 ($length) must be greater than 0
diff --git a/ext/standard/tests/strings/str_split_variation7.phpt b/ext/standard/tests/strings/str_split_variation7.phpt
index 17e802b2406..6cc62df6f81 100644
--- a/ext/standard/tests/strings/str_split_variation7.phpt
+++ b/ext/standard/tests/strings/str_split_variation7.phpt
@@ -29,15 +29,15 @@

     try {
         var_dump( str_split($str, $values[$count]) );
-    } catch (\ValueError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }
 }
 ?>
 --EXPECT--
 *** Testing str_split() : different integer values for 'split_length' with heredoc 'str' ***
 -- Iteration 1 --
-str_split(): Argument #2 ($length) must be greater than 0
+ValueError: str_split(): Argument #2 ($length) must be greater than 0
 -- Iteration 2 --
 array(30) {
   [0]=>
@@ -102,7 +102,7 @@
   string(1) "."
 }
 -- Iteration 3 --
-str_split(): Argument #2 ($length) must be greater than 0
+ValueError: str_split(): Argument #2 ($length) must be greater than 0
 -- Iteration 4 --
 array(1) {
   [0]=>
@@ -121,4 +121,4 @@
   string(30) "string with 123,escape char 	."
 }
 -- Iteration 7 --
-str_split(): Argument #2 ($length) must be greater than 0
+ValueError: str_split(): Argument #2 ($length) must be greater than 0
diff --git a/ext/standard/tests/strings/str_word_count.phpt b/ext/standard/tests/strings/str_word_count.phpt
index a8c2af9255f..1f06f1027f4 100644
--- a/ext/standard/tests/strings/str_word_count.phpt
+++ b/ext/standard/tests/strings/str_word_count.phpt
@@ -11,26 +11,26 @@

 try {
     var_dump(str_word_count($str, 3));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     var_dump(str_word_count($str, 123));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

 try {
     var_dump(str_word_count($str, 999999999));
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($str);
@@ -87,10 +87,10 @@
   string(5) "today"
 }
 int(6)
-str_word_count(): Argument #2 ($format) must be a valid format value
-str_word_count(): Argument #2 ($format) must be a valid format value
-str_word_count(): Argument #2 ($format) must be a valid format value
-str_word_count(): Argument #2 ($format) must be a valid format value
+ValueError: str_word_count(): Argument #2 ($format) must be a valid format value
+ValueError: str_word_count(): Argument #2 ($format) must be a valid format value
+ValueError: str_word_count(): Argument #2 ($format) must be a valid format value
+ValueError: str_word_count(): Argument #2 ($format) must be a valid format value
 string(53) "Hello friend, you're
     looking          good today!"
 int(5)
diff --git a/ext/standard/tests/strings/str_word_count1.phpt b/ext/standard/tests/strings/str_word_count1.phpt
index c4f8ecf40a0..62770dc7760 100644
--- a/ext/standard/tests/strings/str_word_count1.phpt
+++ b/ext/standard/tests/strings/str_word_count1.phpt
@@ -7,24 +7,24 @@

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

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

 var_dump($a);
 ?>
 --EXPECTF--
 int(0)
-str_word_count(): Argument #2 ($format) must be a valid format value
+ValueError: str_word_count(): Argument #2 ($format) must be a valid format value

 Warning: Undefined variable $a in %s on line %d
-str_word_count(): Argument #2 ($format) must be a valid format value
+ValueError: str_word_count(): Argument #2 ($format) must be a valid format value

 Warning: Undefined variable $a in %s on line %d
 NULL
diff --git a/ext/standard/tests/strings/strip_tags_variation2.phpt b/ext/standard/tests/strings/strip_tags_variation2.phpt
index 421f8a62ae4..2bf2de0ac82 100644
--- a/ext/standard/tests/strings/strip_tags_variation2.phpt
+++ b/ext/standard/tests/strings/strip_tags_variation2.phpt
@@ -74,8 +74,8 @@ public function __toString(){
       echo "-- Iteration $iterator --\n";
       try {
         var_dump(strip_tags($string, $value));
-      } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+      } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
       }
       $iterator++;
 };
@@ -125,5 +125,5 @@ public function __toString(){
 -- Iteration 20 --
 string(10) "helloworld"
 -- Iteration 21 --
-strip_tags(): Argument #2 ($allowed_tags) must be of type array|string|null, resource given
+TypeError: strip_tags(): Argument #2 ($allowed_tags) must be of type array|string|null, resource given
 Done
diff --git a/ext/standard/tests/strings/stripos_error.phpt b/ext/standard/tests/strings/stripos_error.phpt
index a3e805a709f..f04799519d0 100644
--- a/ext/standard/tests/strings/stripos_error.phpt
+++ b/ext/standard/tests/strings/stripos_error.phpt
@@ -7,15 +7,15 @@
 echo "\n-- Offset beyond the end of the string --\n";
 try {
     stripos("Hello World", "o", 12);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "\n-- Offset before the start of the string --\n";
 try {
     stripos("Hello World", "o", -12);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "*** Done ***";
@@ -24,8 +24,8 @@
 *** Testing stripos() function: error conditions ***

 -- Offset beyond the end of the string --
-stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

 -- Offset before the start of the string --
-stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 *** Done ***
diff --git a/ext/standard/tests/strings/stristr_variation2.phpt b/ext/standard/tests/strings/stristr_variation2.phpt
index 72d5a93df8a..d5c77a6c5d2 100644
--- a/ext/standard/tests/strings/stristr_variation2.phpt
+++ b/ext/standard/tests/strings/stristr_variation2.phpt
@@ -56,8 +56,8 @@ public function __toString() {
   echo "-- Iteration $count --\n";
   try {
     var_dump( stristr("Hello World", $input) );
-  } catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
   }
   $count ++;
 }
@@ -82,11 +82,11 @@ public function __toString() {
 -- Iteration 7 --
 bool(false)
 -- Iteration 8 --
-stristr(): Argument #2 ($needle) must be of type string, array given
+TypeError: stristr(): Argument #2 ($needle) must be of type string, array given
 -- Iteration 9 --
-stristr(): Argument #2 ($needle) must be of type string, array given
+TypeError: stristr(): Argument #2 ($needle) must be of type string, array given
 -- Iteration 10 --
-stristr(): Argument #2 ($needle) must be of type string, array given
+TypeError: stristr(): Argument #2 ($needle) must be of type string, array given
 -- Iteration 11 --
 bool(false)
 -- Iteration 12 --
@@ -98,4 +98,4 @@ public function __toString() {
 -- Iteration 15 --
 bool(false)
 -- Iteration 16 --
-stristr(): Argument #2 ($needle) must be of type string, resource given
+TypeError: stristr(): Argument #2 ($needle) must be of type string, resource given
diff --git a/ext/standard/tests/strings/strncasecmp_error.phpt b/ext/standard/tests/strings/strncasecmp_error.phpt
index 46bbdbe3b0e..8d1f574edaf 100644
--- a/ext/standard/tests/strings/strncasecmp_error.phpt
+++ b/ext/standard/tests/strings/strncasecmp_error.phpt
@@ -11,12 +11,12 @@

 try {
     var_dump( strncasecmp($str1, $str2, $len) );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 *** Testing strncasecmp() function: error conditions ***
 -- Testing strncasecmp() function with invalid argument --
-strncasecmp(): Argument #3 ($length) must be greater than or equal to 0
+ValueError: strncasecmp(): Argument #3 ($length) must be greater than or equal to 0
diff --git a/ext/standard/tests/strings/strncmp_error.phpt b/ext/standard/tests/strings/strncmp_error.phpt
index ed83651072c..63a662bfffc 100644
--- a/ext/standard/tests/strings/strncmp_error.phpt
+++ b/ext/standard/tests/strings/strncmp_error.phpt
@@ -13,11 +13,11 @@

 try {
     var_dump( strncmp($str1, $str2, $len) );
-} catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 *** Testing strncmp() function: error conditions ***
-strncmp(): Argument #3 ($length) must be greater than or equal to 0
+ValueError: strncmp(): Argument #3 ($length) must be greater than or equal to 0
diff --git a/ext/standard/tests/strings/strpbrk_error.phpt b/ext/standard/tests/strings/strpbrk_error.phpt
index 3d7f84e948b..e7fa64d9a88 100644
--- a/ext/standard/tests/strings/strpbrk_error.phpt
+++ b/ext/standard/tests/strings/strpbrk_error.phpt
@@ -7,11 +7,11 @@
 echo "-- Testing strpbrk() function with empty second argument --\n";
 try {
     strpbrk($haystack, '');
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 -- Testing strpbrk() function with empty second argument --
-strpbrk(): Argument #2 ($characters) must be a non-empty string
+ValueError: strpbrk(): Argument #2 ($characters) must be a non-empty string
diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt
index 05913cc1f03..c3dde30ae69 100644
--- a/ext/standard/tests/strings/strpos.phpt
+++ b/ext/standard/tests/strings/strpos.phpt
@@ -83,8 +83,8 @@
   echo "Position of 'Hello' with offset '$offset_values[$i]' is => ";
   try {
     var_dump( strpos($string, "Hello", $offset_values[$i]) );
-  } catch (TypeError $e) {
-    echo "\n", $e->getMessage(), "\n";
+  } catch (Throwable $e) {
+    echo "\n", $e::class, ': ', $e->getMessage(), "\n";
   }
 }

@@ -161,14 +161,14 @@ function __toString() {
 var_dump( strpos($string, "") );
 try {
     strpos($string, "test", strlen($string)+1);  // offset > strlen()
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     strpos($string, "test", -strlen($string)-1);  // offset before start
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 ?>
@@ -227,14 +227,14 @@ function __toString() {
 *** Testing strpos() with possible variations in offset ***
 Position of 'Hello' with offset '1' is => int(74)
 Position of 'Hello' with offset 'string' is =>
-strpos(): Argument #3 ($offset) must be of type int, string given
+TypeError: strpos(): Argument #3 ($offset) must be of type int, string given
 Position of 'Hello' with offset '' is =>
-strpos(): Argument #3 ($offset) must be of type int, string given
+TypeError: strpos(): Argument #3 ($offset) must be of type int, string given
 Position of 'Hello' with offset '0' is => int(0)
 Position of 'Hello' with offset '1' is => int(74)
 Position of 'Hello' with offset '' is => int(0)
 Position of 'Hello' with offset 'string12' is =>
-strpos(): Argument #3 ($offset) must be of type int, string given
+TypeError: strpos(): Argument #3 ($offset) must be of type int, string given
 Position of 'Hello' with offset '-10' is => bool(false)
 Position of 'Hello' with offset '-15' is => int(74)
 Position of 'Hello' with offset '-85' is => int(0)
@@ -278,7 +278,7 @@ function __toString() {

 *** Testing error conditions ***
 int(0)
-strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

 DONE
diff --git a/ext/standard/tests/strings/strripos_offset.phpt b/ext/standard/tests/strings/strripos_offset.phpt
index 59b5374caec..22d5b59aa73 100644
--- a/ext/standard/tests/strings/strripos_offset.phpt
+++ b/ext/standard/tests/strings/strripos_offset.phpt
@@ -5,40 +5,40 @@

 try {
     var_dump(strripos("t", "t", PHP_INT_MAX+1));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

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

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

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

 echo "Done\n";
 ?>
 --EXPECT--
-strripos(): Argument #3 ($offset) must be of type int, float given
-strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+TypeError: strripos(): Argument #3 ($offset) must be of type int, float given
+ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 Done
diff --git a/ext/standard/tests/strings/strrpos_negative_offset.phpt b/ext/standard/tests/strings/strrpos_negative_offset.phpt
index e4ac469ba4b..0783f566a83 100644
--- a/ext/standard/tests/strings/strrpos_negative_offset.phpt
+++ b/ext/standard/tests/strings/strrpos_negative_offset.phpt
@@ -10,8 +10,8 @@
     var_dump(strrpos("haystack", 'a', -4));
     try {
         strrpos("haystack", 'h', -9);
-    } catch (ValueError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
     var_dump(strripos("HAYSTHACk", 'ha', -9));
     var_dump(strripos("HAYSTACK", 'h', -8));
@@ -21,8 +21,8 @@
     var_dump(strripos("HAYSTACK", 'a', -4));
     try {
         strripos("HAYSTACK", 'h', -9);
-    } catch (ValueError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 ?>
 --EXPECT--
@@ -32,11 +32,11 @@
 bool(false)
 int(5)
 int(1)
-strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 int(0)
 int(0)
 int(7)
 bool(false)
 int(5)
 int(1)
-strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
diff --git a/ext/standard/tests/strings/strrpos_offset.phpt b/ext/standard/tests/strings/strrpos_offset.phpt
index 46b37955e4a..2d77fa43fb5 100644
--- a/ext/standard/tests/strings/strrpos_offset.phpt
+++ b/ext/standard/tests/strings/strrpos_offset.phpt
@@ -5,40 +5,40 @@

 try {
     var_dump(strrpos("t", "t", PHP_INT_MAX+1));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

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

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

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

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

 echo "Done\n";
 ?>
 --EXPECT--
-strrpos(): Argument #3 ($offset) must be of type int, float given
-strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+TypeError: strrpos(): Argument #3 ($offset) must be of type int, float given
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 Done
diff --git a/ext/standard/tests/strings/strrpos_variation7.phpt b/ext/standard/tests/strings/strrpos_variation7.phpt
index f73d4129d5c..01d8996b57b 100644
--- a/ext/standard/tests/strings/strrpos_variation7.phpt
+++ b/ext/standard/tests/strings/strrpos_variation7.phpt
@@ -13,8 +13,8 @@
 var_dump( strrpos($empty_string, "") );
 try {
     strrpos($empty_string, "", 1);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 var_dump( strrpos($empty_string, FALSE) );

@@ -24,6 +24,6 @@
 *** Testing strrpos() function: with heredoc strings ***
 -- With empty heredoc string --
 int(0)
-strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 int(0)
 *** Done ***
diff --git a/ext/standard/tests/strings/strtr_variation6.phpt b/ext/standard/tests/strings/strtr_variation6.phpt
index a43bbd24583..a1597e24574 100644
--- a/ext/standard/tests/strings/strtr_variation6.phpt
+++ b/ext/standard/tests/strings/strtr_variation6.phpt
@@ -66,8 +66,8 @@ public function __toString() {
   $from = $from_arr[$index];
   try {
     var_dump(strtr($str, $from, $to));
-  } catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+  } catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
   }
   $count++;
 }
@@ -89,11 +89,11 @@ public function __toString() {
 -- Iteration 6 --
 string(6) "tm0atm"
 -- Iteration 7 --
-strtr(): Argument #2 ($from) must be of type string, array given
+TypeError: strtr(): Argument #2 ($from) must be of type string, array given
 -- Iteration 8 --
-strtr(): Argument #2 ($from) must be of type string, array given
+TypeError: strtr(): Argument #2 ($from) must be of type string, array given
 -- Iteration 9 --
-strtr(): Argument #2 ($from) must be of type string, array given
+TypeError: strtr(): Argument #2 ($from) must be of type string, array given
 -- Iteration 10 --
 string(6) "0a2atm"
 -- Iteration 11 --
@@ -113,4 +113,4 @@ public function __toString() {
 -- Iteration 16 --
 string(6) "012ttm"
 -- Iteration 17 --
-strtr(): Argument #2 ($from) must be of type string, resource given
+TypeError: strtr(): Argument #2 ($from) must be of type string, resource given
diff --git a/ext/standard/tests/strings/strtr_variation8.phpt b/ext/standard/tests/strings/strtr_variation8.phpt
index 31e41ae9e26..aee2fe6a356 100644
--- a/ext/standard/tests/strings/strtr_variation8.phpt
+++ b/ext/standard/tests/strings/strtr_variation8.phpt
@@ -63,8 +63,8 @@ public function __toString() {
     $replace_pairs = $replace_pairs_arr[$index];
     try {
         var_dump(strtr($str, $replace_pairs));
-    } catch (TypeError $e) {
-        echo $e->getMessage() . "\n";
+    } catch (Throwable $e) {
+        echo $e::class, ': ', $e->getMessage(), "\n";
     }

     $count ++;
@@ -78,22 +78,22 @@ public function __toString() {
 *** Testing strtr() function: with unexpected inputs for 'replace_pairs' ***

 -- Iteration 1 --
-strtr(): Argument #2 ($from) must be of type array, int given
+TypeError: strtr(): Argument #2 ($from) must be of type array, int given

 -- Iteration 2 --
-strtr(): Argument #2 ($from) must be of type array, int given
+TypeError: strtr(): Argument #2 ($from) must be of type array, int given

 -- Iteration 3 --
-strtr(): Argument #2 ($from) must be of type array, int given
+TypeError: strtr(): Argument #2 ($from) must be of type array, int given

 -- Iteration 4 --
-strtr(): Argument #2 ($from) must be of type array, float given
+TypeError: strtr(): Argument #2 ($from) must be of type array, float given

 -- Iteration 5 --
-strtr(): Argument #2 ($from) must be of type array, float given
+TypeError: strtr(): Argument #2 ($from) must be of type array, float given

 -- Iteration 6 --
-strtr(): Argument #2 ($from) must be of type array, float given
+TypeError: strtr(): Argument #2 ($from) must be of type array, float given

 -- Iteration 7 --
 string(6) "012atm"
@@ -105,26 +105,26 @@ public function __toString() {
 string(6) "122atm"

 -- Iteration 10 --
-strtr(): Argument #2 ($from) must be of type array, true given
+TypeError: strtr(): Argument #2 ($from) must be of type array, true given

 -- Iteration 11 --
-strtr(): Argument #2 ($from) must be of type array, false given
+TypeError: strtr(): Argument #2 ($from) must be of type array, false given

 -- Iteration 12 --
-strtr(): Argument #2 ($from) must be of type array, true given
+TypeError: strtr(): Argument #2 ($from) must be of type array, true given

 -- Iteration 13 --
-strtr(): Argument #2 ($from) must be of type array, false given
+TypeError: strtr(): Argument #2 ($from) must be of type array, false given

 -- Iteration 14 --
-strtr(): Argument #2 ($from) must be of type array, null given
+TypeError: strtr(): Argument #2 ($from) must be of type array, null given

 -- Iteration 15 --
-strtr(): Argument #2 ($from) must be of type array, null given
+TypeError: strtr(): Argument #2 ($from) must be of type array, null given

 -- Iteration 16 --
-strtr(): Argument #2 ($from) must be of type array, sample given
+TypeError: strtr(): Argument #2 ($from) must be of type array, sample given

 -- Iteration 17 --
-strtr(): Argument #2 ($from) must be of type array, resource given
+TypeError: strtr(): Argument #2 ($from) must be of type array, resource given
 *** Done ***
diff --git a/ext/standard/tests/strings/strval_error.phpt b/ext/standard/tests/strings/strval_error.phpt
index 8ec78f080f2..ef9fb3eacb7 100644
--- a/ext/standard/tests/strings/strval_error.phpt
+++ b/ext/standard/tests/strings/strval_error.phpt
@@ -15,8 +15,8 @@ class MyClass
 echo "\n-- Testing strval() function with object which has not toString() method  --\n";
 try {
     var_dump( strval(new MyClass()) );
-} catch (Error $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -24,4 +24,4 @@ class MyClass
 *** Testing strval() : error conditions ***

 -- Testing strval() function with object which has not toString() method  --
-Object of class MyClass could not be converted to string
+Error: Object of class MyClass could not be converted to string
diff --git a/ext/standard/tests/strings/substr_compare.phpt b/ext/standard/tests/strings/substr_compare.phpt
index 51d093a65fa..a44f1fe18e3 100644
--- a/ext/standard/tests/strings/substr_compare.phpt
+++ b/ext/standard/tests/strings/substr_compare.phpt
@@ -17,8 +17,8 @@

 try {
     substr_compare("abcde", "abc", 0, -1);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(substr_compare("abcde", "abc", -1, NULL, -5) > 0);
 ?>
@@ -34,5 +34,5 @@
 bool(true)
 int(0)
 Test
-substr_compare(): Argument #4 ($length) must be greater than or equal to 0
+ValueError: substr_compare(): Argument #4 ($length) must be greater than or equal to 0
 bool(true)
diff --git a/ext/standard/tests/strings/substr_count_basic.phpt b/ext/standard/tests/strings/substr_count_basic.phpt
index efb5806d162..67a74b0e9fc 100644
--- a/ext/standard/tests/strings/substr_count_basic.phpt
+++ b/ext/standard/tests/strings/substr_count_basic.phpt
@@ -6,13 +6,13 @@
 echo "***Testing basic operations ***\n";
 try {
     substr_count("", "");
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     substr_count("a", "");
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(substr_count("", "a"));
 var_dump(substr_count("", "a"));
@@ -34,8 +34,8 @@
 ?>
 --EXPECT--
 ***Testing basic operations ***
-substr_count(): Argument #2 ($needle) must not be empty
-substr_count(): Argument #2 ($needle) must not be empty
+ValueError: substr_count(): Argument #2 ($needle) must not be empty
+ValueError: substr_count(): Argument #2 ($needle) must not be empty
 int(0)
 int(0)
 int(0)
diff --git a/ext/standard/tests/strings/substr_count_error.phpt b/ext/standard/tests/strings/substr_count_error.phpt
index dc0d3d9834e..132edc6dbc0 100644
--- a/ext/standard/tests/strings/substr_count_error.phpt
+++ b/ext/standard/tests/strings/substr_count_error.phpt
@@ -9,30 +9,30 @@
 /* offset before start */
 try {
     substr_count($str, "t", -20);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 /* offset > size of the string */
 try {
     substr_count($str, "t", 25);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 /* Using offset and length to go beyond the size of the string:
    Exception is expected, as length+offset > length of string */
 try {
     substr_count($str, "i", 5, 7);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 /* length too small */
 try {
     substr_count($str, "t", 2, -20);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "Done\n";
@@ -40,8 +40,8 @@
 ?>
 --EXPECT--
 *** Testing error conditions ***
-substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack)
-substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack)
+ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack)
+ValueError: substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack)
 Done
diff --git a/ext/standard/tests/strings/substr_replace_error.phpt b/ext/standard/tests/strings/substr_replace_error.phpt
index 165cc1e6913..935d07c1ffb 100644
--- a/ext/standard/tests/strings/substr_replace_error.phpt
+++ b/ext/standard/tests/strings/substr_replace_error.phpt
@@ -13,13 +13,13 @@
 echo "\n-- Testing substr_replace() function with start and length as arrays but string not--\n";
 try {
     var_dump(substr_replace($s1, "evening", array(5)));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump(substr_replace($s1, "evening", 5, array(1)));
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -27,5 +27,5 @@
 *** Testing substr_replace() : error conditions ***

 -- Testing substr_replace() function with start and length as arrays but string not--
-substr_replace(): Argument #3 ($offset) cannot be an array when working on a single string
-substr_replace(): Argument #4 ($length) cannot be an array when working on a single string
+TypeError: substr_replace(): Argument #3 ($offset) cannot be an array when working on a single string
+TypeError: substr_replace(): Argument #4 ($length) cannot be an array when working on a single string
diff --git a/ext/standard/tests/strings/unpack_error.phpt b/ext/standard/tests/strings/unpack_error.phpt
index c41185b23ac..afeab26e2bc 100644
--- a/ext/standard/tests/strings/unpack_error.phpt
+++ b/ext/standard/tests/strings/unpack_error.phpt
@@ -5,10 +5,10 @@

 try {
     var_dump(unpack("B", pack("I", 65534)));
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Invalid format type B
+ValueError: Invalid format type B
diff --git a/ext/standard/tests/strings/unpack_offset.phpt b/ext/standard/tests/strings/unpack_offset.phpt
index bd787859c11..a3046c32d6f 100644
--- a/ext/standard/tests/strings/unpack_offset.phpt
+++ b/ext/standard/tests/strings/unpack_offset.phpt
@@ -13,17 +13,17 @@

 try {
     unpack("l", "foo", 10);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     unpack("l", "foo", -1);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
 0x01020304 0x05060708
 0x01020304 0x05060708
-unpack(): Argument #3 ($offset) must be contained in argument #2 ($data)
-unpack(): Argument #3 ($offset) must be contained in argument #2 ($data)
+ValueError: unpack(): Argument #3 ($offset) must be contained in argument #2 ($data)
+ValueError: unpack(): Argument #3 ($offset) must be contained in argument #2 ($data)
diff --git a/ext/standard/tests/strings/vfprintf_error1.phpt b/ext/standard/tests/strings/vfprintf_error1.phpt
index 1c114daee42..c9fc11f6fb2 100644
--- a/ext/standard/tests/strings/vfprintf_error1.phpt
+++ b/ext/standard/tests/strings/vfprintf_error1.phpt
@@ -16,13 +16,13 @@
 $extra_arg = 10;
 try {
     var_dump( vfprintf( $fp, $format, $args, $extra_arg ) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( vfprintf( $fp, "Foo %d", array(6), "bar" ) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 // Close handle
@@ -38,5 +38,5 @@
 ?>
 --EXPECT--
 -- Testing vfprintf() function with more than expected no. of arguments --
-vfprintf() expects exactly 3 arguments, 4 given
-vfprintf() expects exactly 3 arguments, 4 given
+ArgumentCountError: vfprintf() expects exactly 3 arguments, 4 given
+ArgumentCountError: vfprintf() expects exactly 3 arguments, 4 given
diff --git a/ext/standard/tests/strings/vfprintf_error3.phpt b/ext/standard/tests/strings/vfprintf_error3.phpt
index 24991552e0a..4d567ae9a33 100644
--- a/ext/standard/tests/strings/vfprintf_error3.phpt
+++ b/ext/standard/tests/strings/vfprintf_error3.phpt
@@ -13,20 +13,20 @@
 echo "\n-- Testing vfprintf() function with wrong variable types as argument --\n";
 try {
   vfprintf($fp, array( 'foo %d', 'bar %s' ), 3.55552);
-} catch (TypeError $exception) {
-  echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+  echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 try {
     vfprintf($fp, "Foo: %s", "not available");
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     vfprintf($fp, "Foo %y fake", ["not available"]);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 rewind( $fp );
@@ -47,7 +47,7 @@
 ?>
 --EXPECT--
 -- Testing vfprintf() function with wrong variable types as argument --
-vfprintf(): Argument #2 ($format) must be of type string, array given
-vfprintf(): Argument #3 ($values) must be of type array, string given
-Unknown format specifier "y"
+TypeError: vfprintf(): Argument #2 ($format) must be of type string, array given
+TypeError: vfprintf(): Argument #3 ($values) must be of type array, string given
+ValueError: Unknown format specifier "y"
 string(0) ""
diff --git a/ext/standard/tests/strings/vfprintf_error4.phpt b/ext/standard/tests/strings/vfprintf_error4.phpt
index ac938c1ad60..4b75c73731f 100644
--- a/ext/standard/tests/strings/vfprintf_error4.phpt
+++ b/ext/standard/tests/strings/vfprintf_error4.phpt
@@ -13,13 +13,13 @@
 echo "\n-- Testing vfprintf() function with other strangeties  --\n";
 try {
     var_dump( vfprintf( 'foo', 'bar', array( 'baz' ) ) );
-} catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     var_dump( vfprintf( $fp, 'Foo %$c-0202Sd', array( 2 ) ) );
-} catch(\ValueError $e) {
-    print('Error found: '.$e->getMessage().".\n");
+} catch(Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 // Close handle
 fclose( $fp );
@@ -34,5 +34,5 @@
 ?>
 --EXPECT--
 -- Testing vfprintf() function with other strangeties  --
-vfprintf(): Argument #1 ($stream) must be of type resource, string given
-Error found: Argument number specifier must not be empty.
+TypeError: vfprintf(): Argument #1 ($stream) must be of type resource, string given
+ValueError: Argument number specifier must not be empty
diff --git a/ext/standard/tests/strings/vfprintf_variation1.phpt b/ext/standard/tests/strings/vfprintf_variation1.phpt
index 36d98381702..834635afa47 100644
--- a/ext/standard/tests/strings/vfprintf_variation1.phpt
+++ b/ext/standard/tests/strings/vfprintf_variation1.phpt
@@ -33,8 +33,8 @@ function writeAndDump($fp, $format, $args)
         $content = stream_get_contents( $fp );
         var_dump( $content );
         var_dump( $length );
-    } catch (TypeError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -60,7 +60,7 @@ function writeAndDump($fp, $format, $args)
 ?>
 --EXPECT--
 *** Testing vfprintf() : variation functionality ***
-vfprintf(): Argument #3 ($values) must be of type array, null given
+TypeError: vfprintf(): Argument #3 ($values) must be of type array, null given
 string(17) "Foo is 30 and bar"
 int(17)
 string(14) "Foobar testing"
diff --git a/ext/standard/tests/strings/wordwrap.phpt b/ext/standard/tests/strings/wordwrap.phpt
index efa12bef18d..4049eb1e595 100644
--- a/ext/standard/tests/strings/wordwrap.phpt
+++ b/ext/standard/tests/strings/wordwrap.phpt
@@ -29,8 +29,8 @@

 try {
     wordwrap(chr(0), 0, "");
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
@@ -53,4 +53,4 @@
 bool(true)
 bool(true)
 bool(true)
-wordwrap(): Argument #3 ($break) must not be empty
+ValueError: wordwrap(): Argument #3 ($break) must not be empty
diff --git a/ext/standard/tests/strings/wordwrap_error.phpt b/ext/standard/tests/strings/wordwrap_error.phpt
index b93bb80565b..e21e580c498 100644
--- a/ext/standard/tests/strings/wordwrap_error.phpt
+++ b/ext/standard/tests/strings/wordwrap_error.phpt
@@ -24,8 +24,8 @@

 try {
     wordwrap($str, $width, $break, $cut);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "-- width = -10 & cut = false --\n";
@@ -47,7 +47,7 @@
 -- width = 0 & cut = false --
 string(39) "testing<br />\nwordwrap<br />\nfunction"
 -- width = 0 & cut = true --
-wordwrap(): Argument #4 ($cut_long_words) cannot be true when argument #2 ($width) is 0
+ValueError: wordwrap(): Argument #4 ($cut_long_words) cannot be true when argument #2 ($width) is 0
 -- width = -10 & cut = false --
 string(39) "testing<br />\nwordwrap<br />\nfunction"
 -- width = -10 & cut = true --
diff --git a/ext/standard/tests/time/bug60222.phpt b/ext/standard/tests/time/bug60222.phpt
index 0256e2de1d5..22ae73ad086 100644
--- a/ext/standard/tests/time/bug60222.phpt
+++ b/ext/standard/tests/time/bug60222.phpt
@@ -4,16 +4,16 @@
 <?php
     try {
         time_nanosleep(-1, 0);
-    } catch (ValueError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }

     try {
         time_nanosleep(0, -1);
-    } catch (ValueError $exception) {
-        echo $exception->getMessage() . "\n";
+    } catch (Throwable $exception) {
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 ?>
 --EXPECT--
-time_nanosleep(): Argument #1 ($seconds) must be greater than or equal to 0
-time_nanosleep(): Argument #2 ($nanoseconds) must be greater than or equal to 0
+ValueError: time_nanosleep(): Argument #1 ($seconds) must be greater than or equal to 0
+ValueError: time_nanosleep(): Argument #2 ($nanoseconds) must be greater than or equal to 0
diff --git a/ext/standard/tests/url/parse_url_error_002.phpt b/ext/standard/tests/url/parse_url_error_002.phpt
index 8747e568e93..31baa446c51 100644
--- a/ext/standard/tests/url/parse_url_error_002.phpt
+++ b/ext/standard/tests/url/parse_url_error_002.phpt
@@ -11,8 +11,8 @@
 echo "\n\n--> Above range:\n";
 try {
     parse_url($url, 99);
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 echo "Done"
@@ -40,5 +40,5 @@


 --> Above range:
-parse_url(): Argument #2 ($component) must be a valid URL component identifier, 99 given
+ValueError: parse_url(): Argument #2 ($component) must be a valid URL component identifier, 99 given
 Done
diff --git a/ext/standard/tests/versioning/version_compare_invalid_operator.phpt b/ext/standard/tests/versioning/version_compare_invalid_operator.phpt
index c4fffab7332..6cd09a2eb0b 100644
--- a/ext/standard/tests/versioning/version_compare_invalid_operator.phpt
+++ b/ext/standard/tests/versioning/version_compare_invalid_operator.phpt
@@ -6,9 +6,9 @@
 <?php
 try {
     version_compare('1.2', '2.1', '??');
-} catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-version_compare(): Argument #3 ($operator) must be a valid comparison operator
+ValueError: version_compare(): Argument #3 ($operator) must be a valid comparison operator