From 8e362996356f2555d493ee3d8285424853955e8f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 25 Jan 2020 13:32:28 +0100 Subject: [PATCH] Fix displaying anonymous classes on PHP >= 7.4.2 --- Exception/FlattenException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Exception/FlattenException.php b/Exception/FlattenException.php index 71dc4fe..5dbf64d 100644 --- a/Exception/FlattenException.php +++ b/Exception/FlattenException.php @@ -172,7 +172,7 @@ public function getMessage() public function setMessage($message) { if (false !== strpos($message, "class@anonymous\0")) { - $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) { + $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0]; }, $message); }