0
Iは、クラスA、Bは、C、Dここオブジェクトサイズに基づいて関数パラメータにオブジェクトを渡すときに、パフォーマンスに違いはありますか?
class A {
public $b;
public $c;
public $d;
// Other properties
function __construct() {
$this->b = new B();
$this->c = new C();
$this->d = new D();
}
function process() {
$x = new ExternalClass($this->b, $this->c, $this->d)
// $x = new ExternalClass($this)
}
// other functions.
}
は、パラメータを渡す任意のパフォーマンスの服従がある持っている、の$ this - > C、の$ this - B $この代わりのの$ this - >> dと? 後で$ this-> e、$ this-> fなどのオブジェクトをもっと送る必要があるかもしれません。各オブジェクト変数を渡すのではなく、$ thisオブジェクトを渡すと私はどんなオブジェクトにもアクセスできます。しかし、私は、これに関連するパフォーマンス上の問題があることを知りたい。
100,000回のカップルを行う場合にのみ問題になります。 –