66a48e178e
get_class_methods() was not including methods that came from traits. This diff changes get_class_methods() to look at the Class' method table, instead of the PreClass. With this approach, we could avoid traversing the inheritance hierarchy. However, that changes the order of the methods in the resulting array. So, in order to preserve the order, this diff still traverses the inheritance hierarchy, and methods are added to the array when visiting the class that declared them. This modification changed the order of methods for some "quick" tests with classes derived from builtin classes. However, hhvm was not matching Zend on these tests already, so I updated them. Differential Revision: D940214
17 linhas
260 B
PHP
17 linhas
260 B
PHP
<?php
|
|
|
|
abstract class B {
|
|
private function priv() { echo "B::priv\n"; }
|
|
function func(){
|
|
$this->priv();
|
|
var_dump(get_class_methods($this));
|
|
}
|
|
}
|
|
|
|
class C extends B {
|
|
private function priv() { echo "C::priv\n"; }
|
|
}
|
|
|
|
$obj = new C();
|
|
$obj->func();
|