View Single Post
  #2  
Old 06-12-2012, 03:54 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
As per Stefan,

Quote:
Assignments are always resolving links, the link() function is more
for passing complex variables to functions
He suggested TStaticVars which could get around my array issue like this,

PHP Code:
function onCreated() {
  
temp.obj1 = new TStaticVar();
  
temp.obj1.num 1;
  
  
temp.obj2 = new TStaticVar();
  
temp.obj2.num 2;
  
  
temp.array = {temp.obj1temp.obj2};
  
temp.array[0].num 5;
  echo(
temp.array[0].num); //Outputs 5
  
echo(temp.obj1.num); //Outputs 5

  
temp.obj1.destroy();
  
temp.obj2.destroy();

It works but is definitely not what I had desired.
Reply With Quote