Commit a1fdc0b934a for php.net

commit a1fdc0b934acf539b1d3acdd10a266e5de8dfaa8
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date:   Wed Aug 12 18:17:12 2026 +0700

    ext/curl: applied fixers to improve test robustness (#23038)

diff --git a/ext/curl/tests/bug48207.phpt b/ext/curl/tests/bug48207.phpt
index 6487076e9ee..68b945f4bf8 100644
--- a/ext/curl/tests/bug48207.phpt
+++ b/ext/curl/tests/bug48207.phpt
@@ -45,7 +45,7 @@
     try {
         curl_setopt($ch, $option, $fp);
     } catch (ValueError $exception) {
-        echo $exception->getMessage(), "\n";
+        echo $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

@@ -54,8 +54,8 @@
 isset($tempname) and is_file($tempname) and @unlink($tempname);
 ?>
 --EXPECT--
-curl_setopt(): The file handle provided for CURLOPT_FILE must be writable
-curl_setopt(): The file handle provided for CURLOPT_WRITEHEADER must be writable
-curl_setopt(): The file handle provided for CURLOPT_STDERR must be writable
+ValueError: curl_setopt(): The file handle provided for CURLOPT_FILE must be writable
+ValueError: curl_setopt(): The file handle provided for CURLOPT_WRITEHEADER must be writable
+ValueError: curl_setopt(): The file handle provided for CURLOPT_STDERR must be writable
 Hello World!
 Hello World!
diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt
index c175df5248f..6a909c39f77 100644
--- a/ext/curl/tests/bug68089.phpt
+++ b/ext/curl/tests/bug68089.phpt
@@ -10,11 +10,11 @@
 try {
     curl_setopt($ch, CURLOPT_URL, $url);
 } catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 ?>
 Done
 --EXPECT--
-curl_setopt(): cURL option CURLOPT_URL must not contain any null bytes
+ValueError: curl_setopt(): cURL option CURLOPT_URL must not contain any null bytes
 Done
diff --git a/ext/curl/tests/bug73147.phpt b/ext/curl/tests/bug73147.phpt
index b0f01e64e31..4561785cb99 100644
--- a/ext/curl/tests/bug73147.phpt
+++ b/ext/curl/tests/bug73147.phpt
@@ -8,8 +8,8 @@
 try {
     var_dump(unserialize($poc));
 } catch(Exception $e) {
-    echo $e->getMessage();
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }
 ?>
 --EXPECT--
-Unserialization of 'CURLFile' is not allowed
+Exception: Unserialization of 'CURLFile' is not allowed
diff --git a/ext/curl/tests/bug80121.phpt b/ext/curl/tests/bug80121.phpt
index a7bf6385367..d750856f06e 100644
--- a/ext/curl/tests/bug80121.phpt
+++ b/ext/curl/tests/bug80121.phpt
@@ -8,21 +8,21 @@
 try {
     new CurlHandle;
 } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     new CurlMultiHandle;
 } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 try {
     new CurlShareHandle;
 } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
-Cannot directly construct CurlHandle, use curl_init() instead
-Cannot directly construct CurlMultiHandle, use curl_multi_init() instead
-Cannot directly construct CurlShareHandle, use curl_share_init() instead
+Error: Cannot directly construct CurlHandle, use curl_init() instead
+Error: Cannot directly construct CurlMultiHandle, use curl_multi_init() instead
+Error: Cannot directly construct CurlShareHandle, use curl_share_init() instead
diff --git a/ext/curl/tests/curl_file_upload.phpt b/ext/curl/tests/curl_file_upload.phpt
index 8b85190ff41..732d626c664 100644
--- a/ext/curl/tests/curl_file_upload.phpt
+++ b/ext/curl/tests/curl_file_upload.phpt
@@ -45,7 +45,7 @@ function testcurl($ch, $name, $mime = '', $postname = '')
 try {
     curl_setopt($ch, CURLOPT_SAFE_UPLOAD, 0);
 } catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 $params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt');
@@ -72,7 +72,7 @@ function testcurl($ch, $name, $mime = '', $postname = '')
 string(%d) "curl_testdata1.txt|text/plain|6"
 string(%d) "foo.txt"
 string(%d) "foo.txt|application/octet-stream|6"
-curl_setopt(): Disabling safe uploads is no longer supported
+ValueError: curl_setopt(): Disabling safe uploads is no longer supported
 string(0) ""
 string(0) ""
 string(%d) "array(1) {
diff --git a/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt b/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt
index 4a90b0a3c52..be671e73ef3 100644
--- a/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt
+++ b/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt
@@ -143,4 +143,3 @@
 bool(true)
 bool(true)
 bool(true)
-
diff --git a/ext/curl/tests/curl_multi_errno_strerror_001.phpt b/ext/curl/tests/curl_multi_errno_strerror_001.phpt
index 80ec44c4c24..9bb9b168f82 100644
--- a/ext/curl/tests/curl_multi_errno_strerror_001.phpt
+++ b/ext/curl/tests/curl_multi_errno_strerror_001.phpt
@@ -13,7 +13,7 @@
 try {
     curl_multi_setopt($mh, -1, -1);
 } catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 $errno = curl_multi_errno($mh);
@@ -23,6 +23,6 @@
 --EXPECT--
 0
 No error
-curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option
+ValueError: curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option
 6
 Unknown option
diff --git a/ext/curl/tests/curl_multi_setopt_basic001.phpt b/ext/curl/tests/curl_multi_setopt_basic001.phpt
index 71d176c0a10..479ae758e0c 100644
--- a/ext/curl/tests/curl_multi_setopt_basic001.phpt
+++ b/ext/curl/tests/curl_multi_setopt_basic001.phpt
@@ -11,10 +11,10 @@
 try {
     curl_multi_setopt($mh, -1, 0);
 } catch (ValueError $exception) {
-    echo $exception->getMessage() . "\n";
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 bool(true)
-curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option
+ValueError: curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option
diff --git a/ext/curl/tests/curl_persistent_share_003.phpt b/ext/curl/tests/curl_persistent_share_003.phpt
index 60a30de4d46..0ed7dfd22e9 100644
--- a/ext/curl/tests/curl_persistent_share_003.phpt
+++ b/ext/curl/tests/curl_persistent_share_003.phpt
@@ -8,9 +8,9 @@
 try {
     $sh = curl_share_init_persistent([CURL_LOCK_DATA_DNS, CURL_LOCK_DATA_CONNECT, 30]);
 } catch (\ValueError $e) {
-    echo $e->getMessage() . PHP_EOL;
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }

 ?>
 --EXPECT--
-curl_share_init_persistent(): Argument #1 ($share_options) must contain only CURL_LOCK_DATA_* constants
+ValueError: curl_share_init_persistent(): Argument #1 ($share_options) must contain only CURL_LOCK_DATA_* constants
diff --git a/ext/curl/tests/curl_persistent_share_004.phpt b/ext/curl/tests/curl_persistent_share_004.phpt
index fe0e7ec2cf0..ffd58abc017 100644
--- a/ext/curl/tests/curl_persistent_share_004.phpt
+++ b/ext/curl/tests/curl_persistent_share_004.phpt
@@ -8,9 +8,9 @@
 try {
     $sh = curl_share_init_persistent([CURL_LOCK_DATA_COOKIE]);
 } catch (\ValueError $e) {
-    echo $e->getMessage() . PHP_EOL;
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }

 ?>
 --EXPECT--
-curl_share_init_persistent(): Argument #1 ($share_options) must not contain CURL_LOCK_DATA_COOKIE because sharing cookies across PHP requests is unsafe
+ValueError: curl_share_init_persistent(): Argument #1 ($share_options) must not contain CURL_LOCK_DATA_COOKIE because sharing cookies across PHP requests is unsafe
diff --git a/ext/curl/tests/curl_persistent_share_005.phpt b/ext/curl/tests/curl_persistent_share_005.phpt
index 8737ba6c39a..7b7403a76f3 100644
--- a/ext/curl/tests/curl_persistent_share_005.phpt
+++ b/ext/curl/tests/curl_persistent_share_005.phpt
@@ -10,9 +10,9 @@
 try {
     curl_share_setopt($sh, CURLOPT_SHARE, CURL_LOCK_DATA_CONNECT);
 } catch (\TypeError $e) {
-    echo $e->getMessage() . PHP_EOL;
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }

 ?>
 --EXPECT--
-curl_share_setopt(): Argument #1 ($share_handle) must be of type CurlShareHandle, CurlSharePersistentHandle given
+TypeError: curl_share_setopt(): Argument #1 ($share_handle) must be of type CurlShareHandle, CurlSharePersistentHandle given
diff --git a/ext/curl/tests/curl_persistent_share_006.phpt b/ext/curl/tests/curl_persistent_share_006.phpt
index ffca764757f..8921ddba890 100644
--- a/ext/curl/tests/curl_persistent_share_006.phpt
+++ b/ext/curl/tests/curl_persistent_share_006.phpt
@@ -8,9 +8,9 @@
 try {
     $sh = curl_share_init_persistent([]);
 } catch (\ValueError $e) {
-    echo $e->getMessage() . PHP_EOL;
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }

 ?>
 --EXPECT--
-curl_share_init_persistent(): Argument #1 ($share_options) must not be empty
+ValueError: curl_share_init_persistent(): Argument #1 ($share_options) must not be empty
diff --git a/ext/curl/tests/curl_seekfunction_error.phpt b/ext/curl/tests/curl_seekfunction_error.phpt
index 134e8115dc5..31808d78a3c 100644
--- a/ext/curl/tests/curl_seekfunction_error.phpt
+++ b/ext/curl/tests/curl_seekfunction_error.phpt
@@ -31,14 +31,14 @@ function run_upload(string $host, callable $seek): void
 try {
     run_upload($host, fn($ch, $offset, $origin) => 'not an int');
 } catch (\TypeError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\nReturning an out-of-range int:\n";
 try {
     run_upload($host, fn($ch, $offset, $origin) => 42);
 } catch (\ValueError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\nThrowing from the callback:\n";
@@ -47,7 +47,7 @@ function run_upload(string $host, callable $seek): void
         throw new \RuntimeException('boom from seek');
     });
 } catch (\RuntimeException $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 echo "\nSetting the callback to null:\n";
@@ -57,21 +57,21 @@ function run_upload(string $host, callable $seek): void
 try {
     curl_setopt(curl_init(), CURLOPT_SEEKFUNCTION, 42);
 } catch (\TypeError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 ?>
 --EXPECT--
 Returning a non-int:
-The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK
+TypeError: The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK

 Returning an out-of-range int:
-The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK
+ValueError: The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK

 Throwing from the callback:
-boom from seek
+RuntimeException: boom from seek

 Setting the callback to null:
 bool(true)

 Setting a non-callable scalar:
-curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_SEEKFUNCTION, no array or string given
+TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_SEEKFUNCTION, no array or string given
diff --git a/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt b/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt
index 7193642dcab..b523acc1648 100644
--- a/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt
+++ b/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt
@@ -87,14 +87,14 @@
     var_dump(curl_setopt($ch, CURLINFO_HEADER_OUT, true));
 }
 catch (\ValueError $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 $chCopy = curl_copy_handle($ch);
 try {
     var_dump(curl_setopt($chCopy, CURLINFO_HEADER_OUT, true));
 }
 catch (\ValueError $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(curl_setopt($chCopy, CURLOPT_DEBUGFUNCTION, null));
 var_dump(curl_setopt($chCopy, CURLINFO_HEADER_OUT, true));
@@ -138,7 +138,7 @@
     var_dump($result = curl_exec($ch));
 }
 catch (\RuntimeException $e) {
-    var_dump($e->getMessage());
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 var_dump(curl_getinfo($ch, CURLINFO_HEADER_OUT));

@@ -183,8 +183,8 @@
 bool(true)
 bool(true)
 bool(true)
-string(87) "CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set"
-string(87) "CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set"
+ValueError: CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set
+ValueError: CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set
 bool(true)
 bool(true)

@@ -216,7 +216,7 @@

 ===Test CURLOPT_DEBUGFUNCTION can throw within callback===
 bool(true)
-string(41) "This should get caught after verbose=true"
+RuntimeException: This should get caught after verbose=true
 string(%d) "GET /get.inc?test=file HTTP/%s
 Host: %s:%d
 Accept: */*
diff --git a/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt b/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt
index 39a1d1e3caa..8f507a6c8fd 100644
--- a/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt
+++ b/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt
@@ -73,7 +73,7 @@
 try {
     curl_exec($ch);
 } catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }

 echo "\nTesting with invalid type\n";
@@ -83,7 +83,7 @@
 try {
     curl_exec($ch);
 } catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }

 echo "\nTesting with invalid value\n";
@@ -93,21 +93,21 @@
 try {
     curl_exec($ch);
 } catch (\ValueError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }

 echo "\nTesting with invalid option value\n";
 try {
     curl_setopt($ch, CURLOPT_PREREQFUNCTION, 42);
 } catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }

 echo "\nTesting with invalid option callback\n";
 try {
     curl_setopt($ch, CURLOPT_PREREQFUNCTION, 'function_does_not_exist');
 } catch (\TypeError $e) {
-    echo $e->getMessage() . \PHP_EOL;
+    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }

 echo "\nTesting with null as the callback\n";
@@ -161,19 +161,19 @@
 int(0)

 Testing with no return type
-The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
+TypeError: The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT

 Testing with invalid type
-The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
+TypeError: The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT

 Testing with invalid value
-The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
+ValueError: The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT

 Testing with invalid option value
-curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, no array or string given
+TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, no array or string given

 Testing with invalid option callback
-curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, function "function_does_not_exist" not found or invalid function name
+TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, function "function_does_not_exist" not found or invalid function name

 Testing with null as the callback
 bool(true)
diff --git a/ext/curl/tests/curl_setopt_basic003.phpt b/ext/curl/tests/curl_setopt_basic003.phpt
index 008162c9b47..daeac6b07c1 100644
--- a/ext/curl/tests/curl_setopt_basic003.phpt
+++ b/ext/curl/tests/curl_setopt_basic003.phpt
@@ -20,7 +20,7 @@
 try {
     curl_setopt($ch, CURLOPT_HTTPHEADER, 1);
 } catch (TypeError $exception) {
-    echo $exception->getMessage() . "\n";
+    echo $exception::class, ': ', $exception->getMessage(), "\n";
 }

 $curl_content = curl_exec($ch);
@@ -42,6 +42,6 @@
 ?>
 --EXPECT--
 *** curl_setopt() call with CURLOPT_HTTPHEADER
-curl_setopt(): The CURLOPT_HTTPHEADER option must have an array value
+TypeError: curl_setopt(): The CURLOPT_HTTPHEADER option must have an array value
 bool(false)
 bool(true)
diff --git a/ext/curl/tests/curl_setopt_error.phpt b/ext/curl/tests/curl_setopt_error.phpt
index 0979cec0816..0495d2e56da 100644
--- a/ext/curl/tests/curl_setopt_error.phpt
+++ b/ext/curl/tests/curl_setopt_error.phpt
@@ -13,24 +13,24 @@
 try {
     curl_setopt($ch, '', false);
 } catch (TypeError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     curl_setopt($ch, -10, 0);
 } catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 try {
     curl_setopt($ch, 1000, 0);
 } catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 *** curl_setopt() call with incorrect parameters
-curl_setopt(): Argument #2 ($option) must be of type int, string given
-curl_setopt(): Argument #2 ($option) is not a valid cURL option
-curl_setopt(): Argument #2 ($option) is not a valid cURL option
+TypeError: curl_setopt(): Argument #2 ($option) must be of type int, string given
+ValueError: curl_setopt(): Argument #2 ($option) is not a valid cURL option
+ValueError: curl_setopt(): Argument #2 ($option) is not a valid cURL option
diff --git a/ext/curl/tests/curl_setopt_error_nul_byte.phpt b/ext/curl/tests/curl_setopt_error_nul_byte.phpt
index 23be973b82c..8eae484b51d 100644
--- a/ext/curl/tests/curl_setopt_error_nul_byte.phpt
+++ b/ext/curl/tests/curl_setopt_error_nul_byte.phpt
@@ -24,29 +24,20 @@
     try {
         curl_setopt($ch, constant($option), ["Something: foo\0bar"]);
     } catch (ValueError $exception) {
-        echo $option . ": " . $exception->getMessage() . "\n\n";
+        echo $option, ': ', $exception::class, ': ', $exception->getMessage(), "\n";
     }
 }

 $ch = null;
 ?>
 --EXPECT--
-CURLOPT_HTTP200ALIASES: curl_setopt(): cURL option CURLOPT_HTTP200ALIASES must not contain any null bytes
-
-CURLOPT_HTTPHEADER: curl_setopt(): cURL option CURLOPT_HTTPHEADER must not contain any null bytes
-
-CURLOPT_POSTQUOTE: curl_setopt(): cURL option CURLOPT_POSTQUOTE must not contain any null bytes
-
-CURLOPT_PREQUOTE: curl_setopt(): cURL option CURLOPT_PREQUOTE must not contain any null bytes
-
-CURLOPT_QUOTE: curl_setopt(): cURL option CURLOPT_QUOTE must not contain any null bytes
-
-CURLOPT_TELNETOPTIONS: curl_setopt(): cURL option CURLOPT_TELNETOPTIONS must not contain any null bytes
-
-CURLOPT_MAIL_RCPT: curl_setopt(): cURL option CURLOPT_MAIL_RCPT must not contain any null bytes
-
-CURLOPT_RESOLVE: curl_setopt(): cURL option CURLOPT_RESOLVE must not contain any null bytes
-
-CURLOPT_PROXYHEADER: curl_setopt(): cURL option CURLOPT_PROXYHEADER must not contain any null bytes
-
-CURLOPT_CONNECT_TO: curl_setopt(): cURL option CURLOPT_CONNECT_TO must not contain any null bytes
+CURLOPT_HTTP200ALIASES: ValueError: curl_setopt(): cURL option CURLOPT_HTTP200ALIASES must not contain any null bytes
+CURLOPT_HTTPHEADER: ValueError: curl_setopt(): cURL option CURLOPT_HTTPHEADER must not contain any null bytes
+CURLOPT_POSTQUOTE: ValueError: curl_setopt(): cURL option CURLOPT_POSTQUOTE must not contain any null bytes
+CURLOPT_PREQUOTE: ValueError: curl_setopt(): cURL option CURLOPT_PREQUOTE must not contain any null bytes
+CURLOPT_QUOTE: ValueError: curl_setopt(): cURL option CURLOPT_QUOTE must not contain any null bytes
+CURLOPT_TELNETOPTIONS: ValueError: curl_setopt(): cURL option CURLOPT_TELNETOPTIONS must not contain any null bytes
+CURLOPT_MAIL_RCPT: ValueError: curl_setopt(): cURL option CURLOPT_MAIL_RCPT must not contain any null bytes
+CURLOPT_RESOLVE: ValueError: curl_setopt(): cURL option CURLOPT_RESOLVE must not contain any null bytes
+CURLOPT_PROXYHEADER: ValueError: curl_setopt(): cURL option CURLOPT_PROXYHEADER must not contain any null bytes
+CURLOPT_CONNECT_TO: ValueError: curl_setopt(): cURL option CURLOPT_CONNECT_TO must not contain any null bytes
diff --git a/ext/curl/tests/curl_share_errno_strerror_001.phpt b/ext/curl/tests/curl_share_errno_strerror_001.phpt
index 6a69a3a4877..835b8a8afef 100644
--- a/ext/curl/tests/curl_share_errno_strerror_001.phpt
+++ b/ext/curl/tests/curl_share_errno_strerror_001.phpt
@@ -13,7 +13,7 @@
 try {
     curl_share_setopt($sh, -1, -1);
 } catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 $errno = curl_share_errno($sh);
@@ -23,6 +23,6 @@
 --EXPECT--
 0
 No error
-curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option
+ValueError: curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option
 1
 Unknown share option
diff --git a/ext/curl/tests/curl_share_setopt_basic001.phpt b/ext/curl/tests/curl_share_setopt_basic001.phpt
index d9a9c1788e8..11a5e4d1dc8 100644
--- a/ext/curl/tests/curl_share_setopt_basic001.phpt
+++ b/ext/curl/tests/curl_share_setopt_basic001.phpt
@@ -12,11 +12,11 @@
 try {
     curl_share_setopt($sh, -1, 0);
 } catch (ValueError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }

 ?>
 --EXPECT--
 bool(true)
 bool(true)
-curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option
+ValueError: curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option
diff --git a/ext/curl/tests/gh15547.phpt b/ext/curl/tests/gh15547.phpt
index 489fdd0b999..6b2b0521a1c 100644
--- a/ext/curl/tests/gh15547.phpt
+++ b/ext/curl/tests/gh15547.phpt
@@ -10,20 +10,20 @@
 try {
 	curl_multi_select($mh, -2500000);
 } catch (\ValueError $e) {
-	echo $e->getMessage() . PHP_EOL;
+	echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }
 curl_multi_close($mh);
 $mh = curl_multi_init();
 try {
 	curl_multi_select($mh, 2500000);
 } catch (\ValueError $e) {
-	echo $e->getMessage() . PHP_EOL;
+	echo $e::class, ': ', $e->getMessage(), PHP_EOL;
 }
 curl_multi_close($mh);
 $mh = curl_multi_init();
 var_dump(curl_multi_select($mh, 1000000));
 ?>
 --EXPECTF--
-curl_multi_select(): Argument #2 ($timeout) must be between %d and %f
-curl_multi_select(): Argument #2 ($timeout) must be between %d and %f
+ValueError: curl_multi_select(): Argument #2 ($timeout) must be between %d and %f
+ValueError: curl_multi_select(): Argument #2 ($timeout) must be between %d and %f
 int(0)