Commit d7a5e2f2384 for php.net

commit d7a5e2f2384c099d03a02a955f63478afba7f29b
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date:   Sat Aug 15 19:32:41 2026 +0700

    ext/uri: applied fixers to improve test robustness (#23271)

diff --git a/ext/uri/tests/004.phpt b/ext/uri/tests/004.phpt
index a7c2e190683..c6ad96ce99a 100644
--- a/ext/uri/tests/004.phpt
+++ b/ext/uri/tests/004.phpt
@@ -8,8 +8,8 @@

 try {
     new Uri\WhatWg\Url("");
-} catch (Uri\WhatWg\InvalidUrlException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump(Uri\WhatWg\Url::parse(""));
@@ -58,7 +58,7 @@
   ["fragment"]=>
   NULL
 }
-The specified URI is malformed (MissingSchemeNonRelativeUrl)
+Uri\WhatWg\InvalidUrlException: The specified URI is malformed (MissingSchemeNonRelativeUrl)
 NULL
 object(Uri\Rfc3986\Uri)#%d (%d) {
   ["scheme"]=>
diff --git a/ext/uri/tests/007.phpt b/ext/uri/tests/007.phpt
index db051e553fb..9d2f389e251 100644
--- a/ext/uri/tests/007.phpt
+++ b/ext/uri/tests/007.phpt
@@ -5,14 +5,14 @@

 try {
     new Uri\Rfc3986\Uri("https://example.com:8080@username:password/path?q=r#fragment");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     new Uri\WhatWg\Url("https://example.com:8080@username:password/path?q=r#fragment");
-} catch (Uri\WhatWg\InvalidUrlException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($e->errors);
 }

@@ -23,8 +23,8 @@

 ?>
 --EXPECTF--
-The specified URI is malformed
-The specified URI is malformed (PortInvalid)
+Uri\InvalidUriException: The specified URI is malformed
+Uri\WhatWg\InvalidUrlException: The specified URI is malformed (PortInvalid)
 array(%d) {
   [0]=>
   object(Uri\WhatWg\UrlValidationError)#%d (%d) {
diff --git a/ext/uri/tests/015.phpt b/ext/uri/tests/015.phpt
index cf6c09703d2..e3a846f5e31 100644
--- a/ext/uri/tests/015.phpt
+++ b/ext/uri/tests/015.phpt
@@ -9,18 +9,18 @@
 try {
     $reflectionClass = new ReflectionClass(Uri\Rfc3986\Uri::class);
     $reflectionClass->newInstanceWithoutConstructor();
-} catch (ReflectionException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $reflectionClass = new ReflectionClass(Uri\WhatWg\Url::class);
     $reflectionClass->newInstanceWithoutConstructor();
-} catch (ReflectionException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Class Uri\Rfc3986\Uri is an internal class marked as final that cannot be instantiated without invoking its constructor
-Class Uri\WhatWg\Url is an internal class marked as final that cannot be instantiated without invoking its constructor
+ReflectionException: Class Uri\Rfc3986\Uri is an internal class marked as final that cannot be instantiated without invoking its constructor
+ReflectionException: Class Uri\WhatWg\Url is an internal class marked as final that cannot be instantiated without invoking its constructor
diff --git a/ext/uri/tests/023.phpt b/ext/uri/tests/023.phpt
index d52fa340532..8899abc16b6 100644
--- a/ext/uri/tests/023.phpt
+++ b/ext/uri/tests/023.phpt
@@ -17,14 +17,14 @@

 try {
     $uri3->withScheme("");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $uri3->withScheme("http%73");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $url1 = Uri\WhatWg\Url::parse("https://example.com");
@@ -35,14 +35,14 @@

 try {
     $url2->withScheme("");
-} catch (Uri\WhatWg\InvalidUrlException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $url2->withScheme("http%73");
-} catch (Uri\WhatWg\InvalidUrlException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -53,9 +53,9 @@
 string(4) "http"
 NULL
 NULL
-The specified scheme is malformed
-The specified scheme is malformed
+Uri\InvalidUriException: The specified scheme is malformed
+Uri\InvalidUriException: The specified scheme is malformed
 string(5) "https"
 string(4) "http"
-The specified scheme is malformed
-The specified scheme is malformed
+Uri\WhatWg\InvalidUrlException: The specified scheme is malformed
+Uri\WhatWg\InvalidUrlException: The specified scheme is malformed
diff --git a/ext/uri/tests/026.phpt b/ext/uri/tests/026.phpt
index e46c30055cb..179b00d3857 100644
--- a/ext/uri/tests/026.phpt
+++ b/ext/uri/tests/026.phpt
@@ -29,26 +29,26 @@

 try {
     $uri3->withHost("test.com:8080");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $uri3->withHost("t%3As%2Ft.com"); // t:s/t.com
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $uri3->withHost("t:s/t.com");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $uri2->withHost("");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $uri1 = Uri\Rfc3986\Uri::parse("ftp://user:pass@foo.com?query=abc#foo");
@@ -59,8 +59,8 @@

 try {
     $uri1->withHost(null);
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $url1 = Uri\WhatWg\Url::parse("https://example.com");
@@ -77,26 +77,26 @@

 try {
     $url3->withHost("test.com:8080");
-} catch (Uri\WhatWg\InvalidUrlException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $url3->withHost("t%3As%2Ft.com"); // t:s/t.com
-} catch (Uri\WhatWg\InvalidUrlException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $url3->withHost("t:s/t.com");     // t:s/t.com
-} catch (Uri\WhatWg\InvalidUrlException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $url2->withHost(null);
-} catch (Uri\WhatWg\InvalidUrlException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $url1 = Uri\WhatWg\Url::parse("ftp://foo.com?query=abc#foo");
@@ -119,19 +119,19 @@
 string(11) "192.168.0.1"
 string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]"
 string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]"
-The specified host is malformed
-The specified host is malformed
+Uri\InvalidUriException: The specified host is malformed
+Uri\InvalidUriException: The specified host is malformed
 string(7) "foo.com"
 string(8) "test.com"
-Cannot remove the host from a URI that has a userinfo
+Uri\InvalidUriException: Cannot remove the host from a URI that has a userinfo
 string(11) "example.com"
 string(8) "test.com"
 string(8) "test.com"
 string(11) "192.168.0.1"
 string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]"
-The specified host is malformed
-The specified host is malformed (DomainInvalidCodePoint)
-The specified host is malformed
-The specified host is malformed (HostMissing)
+Uri\WhatWg\InvalidUrlException: The specified host is malformed
+Uri\WhatWg\InvalidUrlException: The specified host is malformed (DomainInvalidCodePoint)
+Uri\WhatWg\InvalidUrlException: The specified host is malformed
+Uri\WhatWg\InvalidUrlException: The specified host is malformed (HostMissing)
 string(7) "foo.com"
 string(8) "test.com"
diff --git a/ext/uri/tests/026_userinfo.phpt b/ext/uri/tests/026_userinfo.phpt
index cff2665803a..a29abddf972 100644
--- a/ext/uri/tests/026_userinfo.phpt
+++ b/ext/uri/tests/026_userinfo.phpt
@@ -25,8 +25,8 @@

 try {
     $uri4->withUserInfo("u:s/r");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $uri5 = Uri\Rfc3986\Uri::parse("file:///foo/bar/");
@@ -46,6 +46,6 @@
 string(13) "%75s%2Fr:pass"
 string(11) "us%2Fr:pass"
 NULL
-The specified userinfo is malformed
+Uri\InvalidUriException: The specified userinfo is malformed
 NULL
 string(9) "user:pass"
diff --git a/ext/uri/tests/027.phpt b/ext/uri/tests/027.phpt
index 334d67aa0bb..2309cace93d 100644
--- a/ext/uri/tests/027.phpt
+++ b/ext/uri/tests/027.phpt
@@ -29,8 +29,8 @@

 try {
     $uri1->withPort(1);
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $url1 = Uri\WhatWg\Url::parse("https://example.com:8080");
@@ -63,7 +63,7 @@
 NULL
 int(80)
 NULL
-Cannot set a port without having a host
+Uri\InvalidUriException: Cannot set a port without having a host
 int(8080)
 int(22)
 NULL
diff --git a/ext/uri/tests/028.phpt b/ext/uri/tests/028.phpt
index cfc11b331c8..708a50d4f2e 100644
--- a/ext/uri/tests/028.phpt
+++ b/ext/uri/tests/028.phpt
@@ -25,14 +25,14 @@

 try {
     $uri5->withPath("test");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $uri5->withPath("/#");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $uri1 = Uri\Rfc3986\Uri::parse("/foo");
@@ -73,8 +73,8 @@
 string(10) "/foo%2Fbar"
 string(0) ""
 string(0) ""
-The specified path is malformed
-The specified path is malformed
+Uri\InvalidUriException: The specified path is malformed
+Uri\InvalidUriException: The specified path is malformed
 string(4) "/foo"
 string(3) "bar"
 string(9) "/foo/bar/"
diff --git a/ext/uri/tests/029.phpt b/ext/uri/tests/029.phpt
index 4936cb60db8..c1ce0e10d94 100644
--- a/ext/uri/tests/029.phpt
+++ b/ext/uri/tests/029.phpt
@@ -37,8 +37,8 @@

 try {
     $uri5->withQuery("#");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $url1 = Uri\WhatWg\Url::parse("https://example.com?foo=bar");
@@ -81,7 +81,7 @@
 string(4) "test"
 string(25) "foo=foo%26bar&baz=/qux%3D"
 string(25) "foo=foo%26bar&baz=/qux%3D"
-The specified query is malformed
+Uri\InvalidUriException: The specified query is malformed
 string(7) "foo=bar"
 string(7) "foo=baz"
 NULL
diff --git a/ext/uri/tests/030.phpt b/ext/uri/tests/030.phpt
index 03ed763f779..e3df0f93998 100644
--- a/ext/uri/tests/030.phpt
+++ b/ext/uri/tests/030.phpt
@@ -17,14 +17,14 @@

 try {
     $uri3->withFragment(" ");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $uri1->withFragment("#fragment2");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $uri1 = Uri\Rfc3986\Uri::parse("https://example.com?abc=def");
@@ -57,8 +57,8 @@
 string(9) "fragment2"
 NULL
 NULL
-The specified fragment is malformed
-The specified fragment is malformed
+Uri\InvalidUriException: The specified fragment is malformed
+Uri\InvalidUriException: The specified fragment is malformed
 NULL
 string(8) "fragment"
 string(9) "fragment1"
diff --git a/ext/uri/tests/031.phpt b/ext/uri/tests/031.phpt
index d3cc926b82f..d60190457c1 100644
--- a/ext/uri/tests/031.phpt
+++ b/ext/uri/tests/031.phpt
@@ -12,50 +12,50 @@

 try {
     unserialize('O:15:"Uri\Rfc3986\Uri":1:{i:0;a:0:{}}'); // less than 2 items
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:15:"Uri\Rfc3986\Uri":3:{i:0;a:0:{}i:1;a:0:{}i:2;a:0:{}}'); // more than 2 items
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;N;i:1;a:0:{}}'); // first item is not an array
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;a:0:{}i:1;a:0:{}}'); // first array is empty
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;a:1:{s:3:"uri";i:1;}i:1;a:0:{}}'); // "uri" key in first array is not a string
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;a:1:{s:3:"uri";s:2:"%1";}i:1;a:0:{}}'); // "uri" key in first array contains invalid URI
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;a:1:{s:3:"uri";s:4:"/uri";}i:1;s:0:"";}'); // second item in not an array
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;a:1:{s:3:"uri";s:4:"/uri";}i:1;a:1:{s:5:"prop1";i:123;}}'); // second array contains a property
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $url1 = new Uri\WhatWg\Url("https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists");
@@ -67,56 +67,56 @@

 try {
     unserialize('O:14:"Uri\WhatWg\Url":1:{i:0;a:0:{}}'); // less than 2 items
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:14:"Uri\WhatWg\Url":3:{i:0;a:0:{}i:1;a:0:{}i:2;a:0:{}}'); // more than 2 items
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;N;i:1;a:0:{}}'); // first item is not an array
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:0:{}i:1;a:0:{}}'); // first array is empty
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:2:{s:3:"uri";s:19:"https://example.com";s:1:"a";i:1;}i:1;a:0:{}}'); // "uri" key in first array contains more than 1 item
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";i:1;}i:1;a:0:{}}'); // "uri" key in first array is not a string
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";s:11:"invalid-url";}i:1;a:0:{}}'); // "uri" key in first array contains invalid URL
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";s:19:"https://example.com";}i:1;s:0:"";}'); // second item in not an array
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";s:19:"https://example.com";}i:1;a:1:{s:5:"prop1";i:123;}}'); // second array contains property
-} catch (Exception $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
@@ -140,14 +140,14 @@
   ["fragment"]=>
   string(11) "hash-exists"
 }
-Invalid serialization data for Uri\Rfc3986\Uri object
-Invalid serialization data for Uri\Rfc3986\Uri object
-Invalid serialization data for Uri\Rfc3986\Uri object
-Invalid serialization data for Uri\Rfc3986\Uri object
-Invalid serialization data for Uri\Rfc3986\Uri object
-Invalid serialization data for Uri\Rfc3986\Uri object
-Invalid serialization data for Uri\Rfc3986\Uri object
-Invalid serialization data for Uri\Rfc3986\Uri object
+Exception: Invalid serialization data for Uri\Rfc3986\Uri object
+Exception: Invalid serialization data for Uri\Rfc3986\Uri object
+Exception: Invalid serialization data for Uri\Rfc3986\Uri object
+Exception: Invalid serialization data for Uri\Rfc3986\Uri object
+Exception: Invalid serialization data for Uri\Rfc3986\Uri object
+Exception: Invalid serialization data for Uri\Rfc3986\Uri object
+Exception: Invalid serialization data for Uri\Rfc3986\Uri object
+Exception: Invalid serialization data for Uri\Rfc3986\Uri object
 string(163) "O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";s:99:"https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists";}i:1;a:0:{}}"
 object(Uri\WhatWg\Url)#%d (%d) {
   ["scheme"]=>
@@ -167,12 +167,12 @@
   ["fragment"]=>
   string(11) "hash-exists"
 }
-Invalid serialization data for Uri\WhatWg\Url object
-Invalid serialization data for Uri\WhatWg\Url object
-Invalid serialization data for Uri\WhatWg\Url object
-Invalid serialization data for Uri\WhatWg\Url object
-Invalid serialization data for Uri\WhatWg\Url object
-Invalid serialization data for Uri\WhatWg\Url object
-Invalid serialization data for Uri\WhatWg\Url object
-Invalid serialization data for Uri\WhatWg\Url object
-Invalid serialization data for Uri\WhatWg\Url object
+Exception: Invalid serialization data for Uri\WhatWg\Url object
+Exception: Invalid serialization data for Uri\WhatWg\Url object
+Exception: Invalid serialization data for Uri\WhatWg\Url object
+Exception: Invalid serialization data for Uri\WhatWg\Url object
+Exception: Invalid serialization data for Uri\WhatWg\Url object
+Exception: Invalid serialization data for Uri\WhatWg\Url object
+Exception: Invalid serialization data for Uri\WhatWg\Url object
+Exception: Invalid serialization data for Uri\WhatWg\Url object
+Exception: Invalid serialization data for Uri\WhatWg\Url object
diff --git a/ext/uri/tests/051.phpt b/ext/uri/tests/051.phpt
index 0485356075a..cb9c975d238 100644
--- a/ext/uri/tests/051.phpt
+++ b/ext/uri/tests/051.phpt
@@ -7,16 +7,16 @@

 try {
     $uri->resolve("á");
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $url = new Uri\WhatWg\Url("https://example.com");

 try {
     $url->resolve("https://1.2.3.4.5");
-} catch (Uri\WhatWg\InvalidUrlException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $softErrors = [];
@@ -26,8 +26,8 @@

 ?>
 --EXPECTF--
-The specified URI is malformed
-The specified URI is malformed (Ipv4TooManyParts)
+Uri\InvalidUriException: The specified URI is malformed
+Uri\WhatWg\InvalidUrlException: The specified URI is malformed (Ipv4TooManyParts)
 string(23) "https://example.com/foo"
 array(%d) {
   [0]=>
diff --git a/ext/uri/tests/052.phpt b/ext/uri/tests/052.phpt
index 3d8d2053f6e..b0867b02bd5 100644
--- a/ext/uri/tests/052.phpt
+++ b/ext/uri/tests/052.phpt
@@ -7,15 +7,15 @@

 try {
     $r->__construct('bar', Uri\WhatWg\UrlValidationErrorType::HostMissing, false);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($r);

 ?>
 --EXPECTF--
-Cannot modify readonly property Uri\WhatWg\UrlValidationError::$context
+Error: Cannot modify readonly property Uri\WhatWg\UrlValidationError::$context
 object(Uri\WhatWg\UrlValidationError)#%d (%d) {
   ["context"]=>
   string(3) "foo"
diff --git a/ext/uri/tests/053.phpt b/ext/uri/tests/053.phpt
index c88f4d386f3..7f68772e548 100644
--- a/ext/uri/tests/053.phpt
+++ b/ext/uri/tests/053.phpt
@@ -12,26 +12,26 @@

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

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

 try {
     $r->__construct("baz", [], 0);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     $r->__construct("qax", [], 0, null);
-} catch (Error $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 var_dump($r->getMessage());
@@ -41,10 +41,10 @@

 ?>
 --EXPECTF--
-Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors
-Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors
-Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors
-Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors
+Error: Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors
+Error: Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors
+Error: Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors
+Error: Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors
 string(3) "qax"
 array(%d) {
   [%d]=>
diff --git a/ext/uri/tests/054.phpt b/ext/uri/tests/054.phpt
index 757b21cc114..386f88ae93e 100644
--- a/ext/uri/tests/054.phpt
+++ b/ext/uri/tests/054.phpt
@@ -5,12 +5,12 @@

 try {
     new \Uri\WhatWg\Url('http://localhost:99999');
-} catch (Uri\WhatWg\InvalidUrlException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
     var_dump($e->errors[0]->type === \Uri\WhatWg\UrlValidationErrorType::PortOutOfRange);
 }

 ?>
 --EXPECT--
-The specified URI is malformed (PortOutOfRange)
+Uri\WhatWg\InvalidUrlException: The specified URI is malformed (PortOutOfRange)
 bool(true)
diff --git a/ext/uri/tests/055.phpt b/ext/uri/tests/055.phpt
index de240bb6e05..fddb313149d 100644
--- a/ext/uri/tests/055.phpt
+++ b/ext/uri/tests/055.phpt
@@ -5,9 +5,9 @@

 try {
     var_dump(new Uri\Rfc3986\Uri('foo', new Uri\Rfc3986\Uri('bar')));
-} catch (Uri\InvalidUriException $e) {
-    echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
-The specified base URI must be absolute
+Uri\InvalidUriException: The specified base URI must be absolute
diff --git a/ext/uri/tests/101.phpt b/ext/uri/tests/101.phpt
index daa83e45c9f..b00eeac8f80 100644
--- a/ext/uri/tests/101.phpt
+++ b/ext/uri/tests/101.phpt
@@ -7,14 +7,14 @@

 try {
   var_dump(zend_test_uri_parser('invalid uri', "Uri\\WhatWg\\Url"));
-} catch (\Uri\WhatWg\InvalidUrlException $e) {
-  echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+  echo $e::class, ': ', $e->getMessage(), PHP_EOL;
   var_dump($e->errors);
 }

 ?>
 --EXPECTF--
-The specified URI is malformed (MissingSchemeNonRelativeUrl)
+Uri\WhatWg\InvalidUrlException: The specified URI is malformed (MissingSchemeNonRelativeUrl)
 array(1) {
   [0]=>
   object(Uri\WhatWg\UrlValidationError)#%d (3) {
diff --git a/ext/uri/tests/gh19780.phpt b/ext/uri/tests/gh19780.phpt
index fffa25bc37d..24a3fed9e2a 100644
--- a/ext/uri/tests/gh19780.phpt
+++ b/ext/uri/tests/gh19780.phpt
@@ -9,19 +9,19 @@

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

 try {
     new InvalidUrlException('message', [
         1 => new UrlValidationError('context', UrlValidationErrorType::HostMissing, true)
     ]);
-} catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Uri\WhatWg\InvalidUrlException::__construct(): Argument #2 ($errors) must be a list of Uri\WhatWg\UrlValidationError
-Uri\WhatWg\InvalidUrlException::__construct(): Argument #2 ($errors) must be a list of Uri\WhatWg\UrlValidationError
+ValueError: Uri\WhatWg\InvalidUrlException::__construct(): Argument #2 ($errors) must be a list of Uri\WhatWg\UrlValidationError
+ValueError: Uri\WhatWg\InvalidUrlException::__construct(): Argument #2 ($errors) must be a list of Uri\WhatWg\UrlValidationError