note 126661 added to reflectionclass.getattributes
| From: | sandrenyl at gmail dot com | Date: | Fri, 03 Dec 2021 18:27:25 +0000 |
| Subject: | note 126661 added to reflectionclass.getattributes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217327@lists.php.net to get a copy of this message | ||
When using the method getAttributes() to fetch attributes based on a parent class, the proper flag
constant is ReflectionAttribute::IS_INSTANCEOF (which equals 2 as mentionned by sergiolibe).
<?php
$reflectionClass->getAttributes(SomeParentAttribute::class, ReflectionAttribute::IS_INSTANCEOF);
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 88.136.218.199)
----
Manual Page -- https://php.net/manual/en/reflectionclass.getattributes.php
Edit -- https://main.php.net/note/edit/126661
Del: integrated -- https://main.php.net/note/delete/126661/integrated
Del: useless -- https://main.php.net/note/delete/126661/useless
Del: bad code -- https://main.php.net/note/delete/126661/bad+code
Del: spam -- https://main.php.net/note/delete/126661/spam
Del: non-english -- https://main.php.net/note/delete/126661/non-english
Del: in docs -- https://main.php.net/note/delete/126661/in+docs
Del: other reasons-- https://main.php.net/note/delete/126661
Reject -- https://main.php.net/note/reject/126661
Search -- https://main.php.net/manage/user-notes.php