Arquivos
hhvm/hphp/test/quick/get_class_methods1.php
T
Guilherme Ottoni 66a48e178e Fix get_class_methods() to include trait methods
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
2013-08-27 11:58:29 -07:00

14 linhas
187 B
PHP

<?php
// Copyright 2004-present Facebook. All Rights Reserved.
trait T {
private function bar() {}
public function foo() {}
}
class A {
use T;
}
print_r(get_class_methods('A'));