Skip to content

Commit 8e18a9d

Browse files
Fix getting the name of closures on PHP 8.1.11+
1 parent 8e6ce1c commit 8e18a9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Debug/WrappedListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct($listener, ?string $name, Stopwatch $stopwatch, Even
4949
$r = new \ReflectionFunction($listener);
5050
if (str_contains($r->name, '{closure}')) {
5151
$this->pretty = $this->name = 'closure';
52-
} elseif ($class = $r->getClosureScopeClass()) {
52+
} elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
5353
$this->name = $class->name;
5454
$this->pretty = $this->name.'::'.$r->name;
5555
} else {

0 commit comments

Comments
 (0)