Created
July 18, 2017 18:10
-
-
Save joubertredrat/5944dcabe753bf949c9becd5d2a3ead4 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 | |
class Foo | |
{ | |
const BAR_ONE = 1; | |
const BAR_TWO = 2; | |
const BAR_THREE = 3; | |
const QUX_1 = 'one'; | |
const QUX_2 = 'two'; | |
const QUX_3 = 'three'; | |
const QUX_CAKE = 'four'; | |
} | |
$reflection = new \ReflectionClass(Foo::class); | |
echo $reflection->getConstants('BAR_'); // will return [1, 2, 3]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment