diff --git a/Debug/WrappedListener.php b/Debug/WrappedListener.php index 3916716..86d3854 100644 --- a/Debug/WrappedListener.php +++ b/Debug/WrappedListener.php @@ -49,7 +49,7 @@ public function __construct($listener, ?string $name, Stopwatch $stopwatch, Even $r = new \ReflectionFunction($listener); if (str_contains($r->name, '{closure}')) { $this->pretty = $this->name = 'closure'; - } elseif ($class = $r->getClosureScopeClass()) { + } elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { $this->name = $class->name; $this->pretty = $this->name.'::'.$r->name; } else {