hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

When invoking an inherited method with a ReflectionMethod, get_called_class() mistakenly returns the parent class

Open jmarrama opened this issue 12 years ago • 1 comments

class Foo {
  public static function bar() {
    echo get_called_class()."\n";
  }
}
class Baz extends Foo { }

$class = new ReflectionClass('Baz');
$method = $class->getMethod('bar');
$method->invoke(null); // Zend prints 'Baz', HHVM prints 'Foo'

This is likely related to something contained in #1600

jmarrama avatar Feb 07 '14 18:02 jmarrama

Thanks for reporting this. Agree with the assessment on #1600.

scannell avatar Feb 07 '14 18:02 scannell