-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
  • 157,677
  • 23
  • 242
  • 245
Kermit the Frog
  • 3,949
  • 7
  • 31
  • 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
  • 730
  • 2
  • 6
  • 26