codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?php abstract class A { private $b = 'c'; public function __get($a){ } } class B extends A{} $obj = new B(); $r = new ReflectionObject($obj); $p = $r->getProperty('b'); $p->setAccessible(true); // <--- you set the property to public before you read the value var_dump($p->getValue($obj));
Private
[
?
]
Run code
Submit