PHP: Make a method public by using reflection

raw

code.php

1
2
3
4
5
6
<?php
$object = new SomeClass();
 
$refMethod = new ReflectionMethod($object, 'getDriver');
$refMethod->setAccessible(true);
$refMethod->invoke($object);
Christian Weiske Christian Weiske
owner

History