Created
December 5, 2013 04:30
-
-
Save astorm/7800119 to your computer and use it in GitHub Desktop.
A method to make the most careful of system designers weep.
This file contains 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
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