Created
March 30, 2017 03:58
-
-
Save userid/78a19d9a3f59080feea2bfea9e62b6e9 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 | |
| //print_r($_GET); | |
| class A{ | |
| } | |
| class B extends A{ | |
| } | |
| //print_r(get_declared_classes()); | |
| function REData(ReflectionExtension $re, $return=false) { | |
| defined('UNDEFINED') || define('UNDEFINED','%undefined%'); | |
| $_data = []; | |
| $_data['getName:'] = $re->getName() ?: UNDEFINED; | |
| $_data['getVersion:'] = $re->getVersion() ?: UNDEFINED; | |
| $_data['info:'] = $re->info() ?: UNDEFINED; | |
| $_data['getClassName:'] = PHP_EOL.implode(", ",$re->getClassNames()) ?: UNDEFINED; | |
| foreach ($re->getConstants() as $key => $value) $_data['getConstants:'] .= "\n{$key}:={$value}"; | |
| $_data['getDependencies:'] = $re->getDependencies() ?: UNDEFINED; | |
| $_data['getFunctions:'] = PHP_EOL.implode(", ",array_keys($re->getFunctions())) ?: UNDEFINED; | |
| $_data['getINIEntries:'] = $re->getINIEntries() ?: UNDEFINED; | |
| $_data['isPersistent:'] = $re->isPersistent() ?: UNDEFINED; | |
| $_data['isTemporary:'] = $re->isTemporary() ?: UNDEFINED; | |
| return print_r($_data, $return); | |
| } | |
| REData( new ReflectionExtension( 'Reflection' ) ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment