-2

If I have the following variable in a class

protected $address

and in a function test, I do

$testAddress = $this->address;

and then

$testAddress['state'] = 'KO';

Does that change the state for $this->address ... meaning any function that uses $this->address will have the modified state?

Phil
  • 141,914
  • 21
  • 225
  • 223
Kermit the Frog
  • 3,789
  • 6
  • 30
  • 39

1 Answers1

0

It will only change the state or value of $testAddress but not $this->address.

As per the given code, nothing yet has been set as value on $address

vishnu
  • 700
  • 2
  • 5
  • 26