-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP8: Attributes Support #625
Comments
This is valid syntax, but not attribute. <?php
const Attribute = 0;
1 <<Attribute>> 2;
if (1 <<Attribute>> 2) Attribute; |
This is also valid, of course, but since it is not a general description, coloring as an attribute is allowed. <?php
const Attribute = 0;
if (1
<<Attribute>>
2) Attribute; |
https://github.com/php/php-src/pull/5394/files $ref = new \ReflectionFunction(<<A1>> <<A2>> <<A5>> function () { });
$attr = $ref->getAttributes(\stdClass::class, \ReflectionAttribute::IS_INSTANCEOF);
var_dump(count($attr));
print_r(array_map(fn ($a) => $a->getName(), $attr)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Specification
Example
PHP Mode implementation
The text was updated successfully, but these errors were encountered: