[php-src] Issue #8421: Attributes that target functions are not valid for anonymous functions defined within a method

From: Date: Thu, 21 Apr 2022 20:03:10 +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-241142@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8421 Comment Author: ollieread > Hm, the [documentation](https://www.php.net/manual/en/language.attributes.classes.php) > doesn't really specify this very well. Technically $this is > bound in the closure which makes it more than a normal function, but it's also not a method, > but TARGET_METHOD currently passes. @beberlei Do you have any > opinions on this? Note that a static closure also only passes the > TARGET_METHOD check. That was what I thought initially, but attributes are relevant to their target structure/element, not their context.

« previous php.bugs (#241142) next »