On Thu, Dec 16, 2010 at 6:09 PM, Nathan Nobbe <quickshif...@gmail.com>wrote:

> you just have to invoke the function from the context of the
> ReflectionMethod instance
>
> <?php
> class Foo { protected function bar() { echo "foobar\n"; } }
> $m = new ReflectionMethod('Foo', 'bar');
> $m->setAccessible(true);
> $m->invokeArgs(new Foo(), array());
> ?>
>

Thank you, Nathan. That makes perfect sense and would be a good addition to
the documentation page for setAccessible(). Even better, I may even be able
to make use of it in my testing framework since I only want the method to be
exposed for one call from the test method.

David

--
David Harkness
Senior Software Engineer
High Gear Media

Reply via email to