Last active
April 26, 2024 13:24
-
-
Save samsamm777/7230159 to your computer and use it in GitHub Desktop.
Revisions
-
samsamm777 revised this gist
Oct 30, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ <?php $a = new A(); $reflection = new \ReflectionClass($a); $property = $reflection->getProperty('privateProperty'); $property->setAccessible(true); $property->setValue($a, 'new-value'); -
samsamm777 created this gist
Oct 30, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ <?php $a = new A(); $property = $reflection->getProperty('privateProperty'); $property->setAccessible(true); $property->setValue($a, 'new-value'); echo $a->getPrivateProperty(); //outputs: //new-value