[php-src] Issue #8421: Attributes that target functions are not valid for anonymous functions defined within a method
| From: | kallesommernielsen | Date: | Thu, 21 Apr 2022 19:26:56 +0000 |
| Subject: | [php-src] Issue #8421: Attributes that target functions are not valid for anonymous functions defined within a method | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241139@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8421
Comment Author: kallesommernielsen
A closure is not a procedural function, a closure is actually a object of the
\Closure
class with the method body being the code executed inside the __invoke() magic method
for which the closure syntax is sugar for really.
I doubt closures will be supported by attributes anytime soon as it will require copying attributes
to the object and you would then only be able to fetch it via ReflectionObject as there
isn't really another reliable way to accomplish this.