Created
September 19, 2020 01:54
-
-
Save shin1x1/68273168690caaf44ead6d24db997518 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme; | |
use Attribute; | |
@@Attribute | |
final class Attr1 {} | |
@@Attr1 | |
final class Foo {} | |
$reflectionClass = new \ReflectionClass(Foo::class); | |
$attributes = $reflectionClass->getAttributes(); | |
var_dump($attributes[0]->newInstance()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme; | |
use Attribute; | |
#[Attribute] | |
final class Attr1 {} | |
#[Attr1] | |
final class Foo {} | |
$reflectionClass = new \ReflectionClass(Foo::class); | |
$attributes = $reflectionClass->getAttributes(); | |
var_dump($attributes[0]->newInstance()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment