I'm new to programming in general and references in particular. I want to manipulate individual objects in an array by reference, so that I'm not working on mere copies of the objects I wanted to stick into the array. My question is how to do that.
For example, suppose I have these lines of code:
$obj0 = blah;
$obj1 = blah;
$obj2 = blah;
$myArray = array($obj0, $obj1, $obj2);
When I now access and modify $myArray[1]
, will this be the same as modifying $obj1
? Or would I have to be modifying &$myArray[1]
instead?