1、例子类、对象
class Foo { private $bar = [1,2]; public function go() { echo "walk to school"; } }
$foo = new Foo();
2、利用反射打印方法
$reflector = new ReflectionClass($foo); var_dump($reflector->getMethod('go'));//查找go 方法并打印 print_r($reflector->getMethods());//打印所以对象所有方法