Last active
September 5, 2018 11:46
-
-
Save telless/fe942e202b408b1b614faf638d7aea30 to your computer and use it in GitHub Desktop.
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 characters
<?php | |
class A | |
{ | |
public $prop; | |
public function __construct() | |
{ | |
$this->prop = 'prop'; | |
} | |
public function method() | |
{ | |
return 'method'; | |
} | |
} | |
class B extends A | |
{ | |
} | |
print_r((new ReflectionMethod(B::class, 'method'))->invoke(new A()).PHP_EOL); | |
print_r((new ReflectionProperty(B::class, 'prop'))->getValue(new A()).PHP_EOL); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Relates to: https://bugs.php.net/bug.php?id=75231