Skip to content

Instantly share code, notes, and snippets.

@jacobhenke
Created August 11, 2016 20:00
Show Gist options
  • Save jacobhenke/2c18159e6e2038914458bf5273507e35 to your computer and use it in GitHub Desktop.
Save jacobhenke/2c18159e6e2038914458bf5273507e35 to your computer and use it in GitHub Desktop.
<?php
$temp = function ($object) { //Test Object
if (!is_object($object)) {
throw new \Exception("This is not a Object");
}
if (class_exists(get_class($object), true)) echo "<pre>CLASS NAME = " . get_class($object);
$reflection = new \ReflectionClass(get_class($object));
echo "<br />";
echo $reflection->getDocComment();
echo "<br />";
$metody = $reflection->getMethods();
foreach ($metody as $key => $value) {
echo "<br />" . $value;
}
echo "<br />";
$vars = $reflection->getProperties();
foreach ($vars as $key => $value) {
echo "<br />" . $value;
}
echo "</pre>";
};
echo $temp($OBJECT_TO_TEST); die();
@jacobhenke
Copy link
Author

Gets information about all the methods on an instantiated object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment