I'm having a problem with a script that has multiple references to the same object... ie:
$myObj = new SomeObject;
$myRef = &$myObj;
$anotherRef = &$myObj;
$myRef->someProperty = 22; // works
$anotherRef->someProperty = 17; // does not work
echo $myObj->someProperty; // will output 22 not 17
my question is, is this a bug in php?
Is there a work around?
In my app, I have a method call that creates a reference to an object, then returns it.
subsequent calls to that method do not return a reference, but rather a copy of the object, thus any changes made to the returned object do not affect the original object (with the exeption of the first call to the method).