Skip to content

Instantly share code, notes, and snippets.

@fabeat
Created December 9, 2010 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabeat/734778 to your computer and use it in GitHub Desktop.
Save fabeat/734778 to your computer and use it in GitHub Desktop.
<?php
class Foo
{
protected $bar = 'TEST';
}
$foo = new Foo();
$bar = new ReflectionProperty($foo, 'bar');
$bar->setAccessible(true);
echo $bar->getValue($foo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment