Pre-existing parity gap surfaced while building the PHP 8.6 test scaffolding (see PR #226's "Finding for a follow-up" section; deliberately not fixed there to keep that PR scoped).
getPrototype() (src/ReflectionMethod.php:281) searches the parent class first and does not resolve transitively, so for:
interface I { public function describe(): string; }
abstract class A implements I { abstract public function describe(): string; }
final class C extends A { public function describe(): string { return ''; } }
(new ReflectionMethod(C::class, 'describe'))->getPrototype() returns the method declared in A, while native reflection returns the one from I (native walks up to the original prototype, preferring the interface that introduced the signature).
Expected: match native getPrototype() resolution, including interface-through-abstract chains.
Pre-existing parity gap surfaced while building the PHP 8.6 test scaffolding (see PR #226's "Finding for a follow-up" section; deliberately not fixed there to keep that PR scoped).
getPrototype()(src/ReflectionMethod.php:281) searches the parent class first and does not resolve transitively, so for:(new ReflectionMethod(C::class, 'describe'))->getPrototype()returns the method declared inA, while native reflection returns the one fromI(native walks up to the original prototype, preferring the interface that introduced the signature).Expected: match native
getPrototype()resolution, including interface-through-abstract chains.