[PHP-CVS] [php-src] master: tests: asserted error classes for test introduced in #23123 (#23179)

[email protected] (NickSdot via GitHub)
Newsgroups php.cvs
Message-ID <[email protected]>
Author: NickSdot (NickSdot)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-08-22T14:28:13+01:00

Commit: https://github.com/php/php-src/commit/1dfd465607d2adb73d73610a9067de5c9b17cfb7
Raw diff: https://github.com/php/php-src/commit/1dfd465607d2adb73d73610a9067de5c9b17cfb7.diff

tests: asserted error classes for test introduced in #23123 (#23179)

Changed paths:
  M  Zend/tests/gh23121.phpt


Diff:

diff --git a/Zend/tests/gh23121.phpt b/Zend/tests/gh23121.phpt
index 158794ba04e3..b1a6503a8913 100644
--- a/Zend/tests/gh23121.phpt
+++ b/Zend/tests/gh23121.phpt
@@ -10,27 +10,27 @@ var_dump(is_callable($sxe));
 
 try {
     $sxe();
-} catch (Error $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     call_user_func($sxe);
-} catch (TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 try {
     libxml_set_external_entity_loader($sxe);
-} catch (TypeError $e) {
-    echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 var_dump(libxml_get_external_entity_loader());
 ?>
 --EXPECT--
 bool(false)
-Object of type SimpleXMLElement is not callable
-call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given
-libxml_set_external_entity_loader(): Argument #1 ($resolver_function) must be a valid callback or null, no array or string given
+Error: Object of type SimpleXMLElement is not callable
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given
+TypeError: libxml_set_external_entity_loader(): Argument #1 ($resolver_function) must be a valid callback or null, no array or string given
 NULL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.