Looking at referencing in PHP is pretty much confusing me, can anyone explain to me how this would work:
private $TestArray1 = Array()
private $TestArray2 = Array()
private function test1(){
$this->test2($this->TestArray1);
$this->test2($this->TestArray2);
}
private function test2($Array){
$this->test3($Array);
}
private function test3($Array){
$Array[0] = 1;
}
Where would I be putting the “&” in this, if I wanted to have the private variables TestArray1 and TestArray2 be edited, after it is set in function test3?
So you need to specify
&in the function declaration, and pass parameter as-is.