Skip to content

Instantly share code, notes, and snippets.

@astorm
Created December 5, 2013 04:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astorm/7800119 to your computer and use it in GitHub Desktop.
Save astorm/7800119 to your computer and use it in GitHub Desktop.
A method to make the most careful of system designers weep.
protected function _getProtectedPropertyFromObject($property, $object)
{
$r = new ReflectionClass($object);
$p = $r->getProperty($property);
$p->setAccessible(true);
return $p->getValue($object);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment