class Foo {
public function sampleA(){
echo "something ...";
}
}
class Bar {
public function sampleB(){
echo "something ...";
}
}
$objectA = new Foo();
我想直接调用 $objectA->sampleB(),而不是 $objectA->somevariable->sampleB(); 这个怎么做?