Re: BC break: ReflectionMethod::invoke() expects parameter1to be object, string given
| From: | Alexander Lisachenko | Date: | Tue, 23 Aug 2016 13:20:31 +0000 |
| Subject: | Re: BC break: ReflectionMethod::invoke() expects parameter1to be object, string given | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95409@lists.php.net to get a copy of this message | ||
2016-08-23 16:13 GMT+03:00 Julien Pauli <jpauli@php.net>:
>
> No, How can this be ? B extends A , not A extends B ...
> In this case, B'sfoo() will be called , which is the equivalent to
> having a reflectionMethod from B , so useless to me.
Ok, how can I invoke Parent::whoami() with reflection and get exactly
"Child" as an output?
class Parent {
public static function whoami() {
echo static::class;
}
}
class Child extends Parent {
public static function whoami() {
echo "Don't call me now!';
parent::whoami();
}
}